Files
prime-rl/configs/math_python/README.md
T
Mika SenghaasandGitHub 594cbabde2 Explicitly handle + log env errors (#1448)
* add math python example

* use ac

* update rl instructinos

* use 8 gpus and no ac

* use offline filtering and val split because inference a bit too quick

* 12k seq len, 2k max tokens, 300 steps

* use hendrycks math with 512 tokens/turn

* zero completion on error

* log error rate

* update math python to use vf version

* fix arg

* fix completion mask type

* fix tests

* handle empty trajectories case

* add changelog

* bump vf

* log err rate and err distribution

* fix instance

* bump vf

* fix dropna only on err col

* also mask out first turn in interleaved mode

* handle skipped rollouts

* remove asc comment
2025-12-17 14:30:56 -08:00

43 lines
1.1 KiB
Markdown

# math-python
## Setup
CLone `verifiers`
```bash
cd ~ && curl -sSL https://raw.githubusercontent.com/PrimeIntellect-ai/verifiers/main/scripts/install.sh | bash && cd -
```
Install the environment as local packages
```bash
uv pip install -e ~/verifiers/environments/math_python
```
This will automatically install the environment, and a pinned verifiers commit (`71006c`) which includes necessary changes to the PythonEnv.
## Eval
Get a quick vibe-check of the model
```bash
vllm serve Qwen/Qwen3-4B-Instruct-2507 --enable-auto-tool-choice --tool-call-parser hermes --max-model-len 8192
```
```bash
uv run --no-sync vf-eval math-python -n 16 -r 1 -c -1 -v -m Qwen/Qwen3-4B-Instruct-2507 -b http://localhost:8000/v1 -a '{"dataset_name": "PrimeIntellect/Hendrycks-Math", "dataset_subset": "default"}' -t 512
```
## RL
Again, make sure to have installed the environment as local packages from verifiers
```bash
uv pip install -e ~/verifiers/environments/math_python
```
Then, run RL in debug mode (small batch size, limited turns, 2 GPUs, etc.)
```bash
uv run --no-sync rl @ configs/math_python/math_python.toml --log.level debug
```