From 12d5aa081ed302ef545444905d3327b2e841c6a4 Mon Sep 17 00:00:00 2001 From: Mika Senghaas Date: Sun, 13 Jul 2025 13:42:43 +0200 Subject: [PATCH] Update README (#578) * Add citation * Add license section * Add eval section * Run eval benchmarks in parallel as well * Nicer print * Disable vllm logs on eval --- CITATION.cff | 12 ++++++++++ README.md | 48 +++++++++++++++++++++----------------- src/prime_rl/eval/envs.py | 6 +++++ src/prime_rl/eval/eval.py | 22 ++++++++++------- src/prime_rl/eval/utils.py | 4 +++- 5 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..ea2c4527 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,12 @@ +# This CITATION.cff file was generated with cffinit. (https://bit.ly/cffinit) +cff-version: 1.2.0 +title: PRIME-RL +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - name: Prime Intellect +repository-code: 'https://github.com/PrimeIntellect-ai/prime-rl' +license: Apache-2.0 +date-released: '2025-07-13' diff --git a/README.md b/README.md index 1f12142b..9cddf5df 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,9 @@ ulimit -n 32000 ### RL -We provide a convenience endpoint `rl` for single-node RL experiments. It configures and startsthe trainer, orchestrator and, optionally, an inference server. It enforces correctly setting shared configs (e.g. the model name or async level should be the same across all modules) and dispatches and monitors subprocesses. To stream the logs from each module, we use file logging, by default only the trainer logs will be displayed on the main process. +We provide a convenience endpoint `rl` for single-node RL experiments. It configures and starts the trainer, orchestrator and, optionally, an inference server. It enforces correctly setting shared configs (e.g. the model name or async level should be the same across all modules) and dispatches and monitors subprocesses. To stream the logs from each module, we use file logging, by default only the trainer logs will be displayed on the main process. + +To check all available configuration options, run `uv run rl --help`. **Reverse Text** @@ -213,15 +215,18 @@ To kill the tmux session when you're done: ### Evals -*TBD* +We provide a convenience endpoint for running a full evaluation suite of common benchmarks such as AIME, MATH-500 or LiveCodeBench against your model using the `eval` entrypoint. -### Synthetic Data +```bash +uv run inference --model.name Qwen/Qwen3-0.6B --max-model-len 2048 +``` -*TBD* +```bash +uv run eval --model.name Qwen/Qwen3-0.6B --benchmarks math500,aime24,aime25 +``` -### Benchmark +To check all available configuration options, run `uv run eval --help`. -*TBD* ## Developer @@ -229,7 +234,7 @@ To kill the tmux session when you're done: ### Setup -1. Optionally, install [pre-commit](https://pre-commit.com) hooks +1. Install [pre-commit](https://pre-commit.com) hooks ```bash uv run pre-commit install @@ -237,20 +242,6 @@ uv run pre-commit install ### Configs -We use `pydantic-settings` to configure `prime-rl`. To get an overview of the available configurations, run the following command: - -```bash -uv run trainer --help -``` - -```bash -uv run orchestrator --help -``` - -```bash -uv run inference --help -``` - **Sources** We support the following sources for configuration, in this order of precedence: @@ -419,6 +410,19 @@ In general, the model used for generating rollouts at step `n` is from `ckpt[n - - When async_level = 0, the rollout and gradient are based on the same model version. This is equivalent to synchronous on-policy training. +## License + +This project is licensed under the Apache 2.0 license, as found in the [License](LICENSE) file. + ## Citation -*TBD* \ No newline at end of file +If you find our work useful, feel free to cite it using + +```tex +@misc{primeintellect2025prime-rl, + author = {Prime Intellect}, + title = {PRIME-RL}, + url = {https://github.com/PrimeIntellect-ai/prime-rl}, + year = {2025} +} +``` diff --git a/src/prime_rl/eval/envs.py b/src/prime_rl/eval/envs.py index 062c04ba..50fff6e6 100644 --- a/src/prime_rl/eval/envs.py +++ b/src/prime_rl/eval/envs.py @@ -17,16 +17,22 @@ if TYPE_CHECKING: HF_HUB_DISABLE_PROGRESS_BARS: str HF_HUB_ETAG_TIMEOUT: int + # vLLM + VLLM_CONFIGURE_LOGGING: int + + _EVAL_ENV_PARSERS = { "HF_HUB_CACHE": str, "HF_HUB_DISABLE_PROGRESS_BARS": str, "HF_HUB_ETAG_TIMEOUT": int, + "VLLM_CONFIGURE_LOGGING": int, **_BASE_ENV_PARSERS, } _EVAL_ENV_DEFAULTS = { "HF_HUB_DISABLE_PROGRESS_BARS": "1", # Disable HF progress bars "HF_HUB_ETAG_TIMEOUT": "500", # Set request timeout to 500s to avoid model download issues + "VLLM_CONFIGURE_LOGGING": "0", # Disable vLLM logging } set_defaults(_EVAL_ENV_DEFAULTS) diff --git a/src/prime_rl/eval/eval.py b/src/prime_rl/eval/eval.py index 6a21ecb3..4b8d4998 100644 --- a/src/prime_rl/eval/eval.py +++ b/src/prime_rl/eval/eval.py @@ -43,15 +43,19 @@ async def eval(config: EvalConfig): # Run benchmarks on base model logger.info(f"Running evals on base model {config.model.name}") - for benchmark in config.benchmarks: - await run_benchmark( - client, - benchmark, - config.model, - config.sampling, - ckpt_step=0, - monitor=monitor, - ) + await asyncio.gather( + *[ + run_benchmark( + client, + benchmark, + config.model, + config.sampling, + ckpt_step=0, + monitor=monitor, + ) + for benchmark in config.benchmarks + ] + ) logger.info("Evaluation finished!") diff --git a/src/prime_rl/eval/utils.py b/src/prime_rl/eval/utils.py index 8d85b889..1566853c 100644 --- a/src/prime_rl/eval/utils.py +++ b/src/prime_rl/eval/utils.py @@ -43,7 +43,9 @@ async def run_benchmark( benchmark_start_time = time.time() benchmark_name = get_benchmark_display_name(benchmark) - logger.info(f"Evaluating {model_config.name} on {benchmark_name} at step {step}") + logger.info( + f"Evaluating {model_config.name} on {benchmark_name} {f'for checkpoint {ckpt_step}' if ckpt_step > 0 else ''}" + ) # Initializing the benchmark dataset logger.debug(f"Loading benchmark dataset ({benchmark})")