Compare commits

...
143 Commits
Author SHA1 Message Date
f870f3cbd8 Feature: bring your own algorithms (#1715)
Release / Push CUDA image to Docker (push) Canceled after 0s
* update loss interface

* refactor: rename grpo_loss to prime_rl_loss and consolidate loss interface

- Rename grpo_loss to prime_rl_loss (uses LossConfig directly)
- Move LossInputs, LossOutputs, LossFn from loss_interface.py into loss.py
- Remove loss_interface.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add bring-your-own-loss support for custom loss functions

- Add CustomLossConfig with path and kwargs fields
- Add LossConfigType union (LossConfig | CustomLossConfig)
- Update setup_loss_fn to handle custom loss imports
- Add _import_object helper for dynamic imports
- Add test for custom loss configuration
- Add docs/bring-your-own-loss.md documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add bring-your-own advantage function support

- Add AdvantageInputs/AdvantageOutputs dataclasses
- Add CustomAdvantageConfig with path and kwargs
- Add setup_advantage_fn for custom advantage imports
- Refactor compute_advantages to use the new interface
- Add tests for custom advantage configuration
- Rename docs to bring-your-own-algorithms.md with both loss and advantage sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: rename path to byo_function in custom configs

More descriptive name that ties into the "bring your own" concept.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: address PR review feedback

- Extract import_object to shared utils (deduplicate from loss.py and advantage.py)
- Add pydantic discriminator types for LossConfigType and AdvantageConfigType
- Rename byo_function to import_path (standard Python terminology)
- Rename grpo_advantage to default_advantage
- Fix train.py AttributeError when using CustomLossConfig
- Fix docs: per-example terminology, loss/advantage descriptions, config examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update prime_rl_loss description

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: handle custom loss metrics in training loop and restore extra=forbid on AdvantageConfig

- Guard mismatch_kl access in micro-step and step logging (custom loss may not emit it)
- Change AdvantageConfig base from BaseModel to BaseConfig to restore extra="forbid" validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: rename prime_rl_loss to default_loss_fn

Consistent with default_advantage naming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: simplify loss setup logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: rename default_advantage to default_advantage_fn

Consistent with default_loss_fn naming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 12:51:59 -08:00
Matej SirovatkaandGitHub bd087277d5 Flash-attention-4 (#1726)
* Feat: initial

* Feat: fa4 cleanup

* Changelog

* Im done

* Fix

* Fix

* changelog

* Cleanup

---------

Signed-off-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com>
2026-02-06 11:25:35 -08:00
db92bb0fc6 fix swe update (#1730)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-02-06 10:32:23 -08:00
c87c19ba86 Add FA3 ring-attention kernel wrapper and benchmark coverage (#1727)
* Add FA3 ring-attention wrapper for CP and benchmark mode

* Remove benchmark script, pass attn_impl directly, add CP+FA3 impl validator

* Extract ring FA3 autograd into ring_attn.py, remove deep nesting from attn.py

* Update changelog for FA3 CP constraint

Co-authored-by: Matej Sirovatka <S1ro1@users.noreply.github.com>

* Fix: comments

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Matej Sirovatka <S1ro1@users.noreply.github.com>
2026-02-05 17:30:53 -08:00
JannikStandGitHub 8695aa10f8 Strip @version suffix from env IDs before loading as Python modules (#1724)
Platform sends versioned env IDs (e.g. d42me/meow@0.1.5) for installation.
The version must be stripped before passing to vf.load_environment() since
importlib.import_module() cannot handle @ in module names.
2026-02-05 20:58:58 +01:00
JannikStandGitHub 0041a93a45 Fix int64 JSON serialization in Chinese character metrics (#1725) 2026-02-05 10:27:59 +01:00
NPandGitHub d2ab3a43a9 handle empty completion_temperatures in prepare_sample (#1720) 2026-02-04 18:34:28 -08:00
2f7f07bf80 feat: Add AMD Instinct MI300X/MI325X peak FLOPS for MFU calculation (#1722)
Add peak BF16 FLOPS specifications for AMD Instinct accelerators:
- MI300X: 1307.4 TFLOPS
- MI325X: 1307.4 TFLOPS (same compute dies as MI300X, more HBM3e)

This enables accurate MFU reporting when training on AMD GPUs instead of
falling back to A100 baseline which produces misleading >100% MFU values.

Co-authored-by: Daniel Zautner <daniel.zautner@silo.ai>
2026-02-04 16:26:09 -08:00
faresobeidandGitHub 456e8cdc6e track chinese characters (#1700)
* track chinese characters

* ruff

* add extra check
2026-02-04 12:09:55 -08:00
9d40e5e6bf fix: use stable checkpoints for orchestrator resume (#1712)
* fix: use stable checkpoints for orchestrator resume

Only consider checkpoints with STABLE file when resuming, preventing
crash when orchestrator restarts before trainer finishes saving weights.

* fix: wait for checkpoint to become stable with timeout instead of skipping

* feat: make stability timeout configurable with 1000s default

* chore: log stability wait every 60s instead of 30s

* fix: add opt-in wait_for_stable_checkpoint config for orchestrator resume

* refactor: extract wait_for_stable_checkpoint helper, minimal orchestrator change

* fix: sort imports

* fix: import resolve_latest_ckpt_step from utils

* fix: formatting

* fix: add wait_for_weights_timeout option to wait for weight dir when resuming

* Update src/prime_rl/orchestrator/utils.py

Co-authored-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Signed-off-by: JannikSt <JannikSt@users.noreply.github.com>

* cleanup contd.

* format

* readd docstring

* remove unused import

* adjust path for stable file

* ensure weight dirs exist

---------

Co-authored-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
2026-02-04 03:08:40 +01:00
JannikStandGitHub d74bf06d27 Add podManagementPolicy: Parallel to inference and trainer StatefulSets (#1718) 2026-02-04 01:52:58 +01:00
JannikStandGitHub 64c214bf9c Add health probes for inference and trainer (#1719)
* Add health probes for inference and trainer components

* Disable health probes by default
2026-02-04 01:51:52 +01:00
e41036a163 Add optimizer state CPU offload (#1694)
* [feature] add optimizer state CPU offload

Add CPUOffloadOptimizer that keeps optimizer states (exp_avg, exp_avg_sq)
on CPU, moving them to GPU only during optimizer.step(). Unlike FSDP's
CPUOffload, this keeps weights on GPU to avoid H2D all-gather overhead.

- Add optim_cpu_offload config option to ModelConfig
- Integrate into SFT trainer
- Works with DTensor/FSDP2 by operating on _local_tensor

Trade-off: saves ~2GB GPU memory for 0.6B model but ~10x slower due to
per-tensor transfer overhead. Best for memory-constrained scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Refactor: move CPU offload logic into setup_optimizer and setup_scheduler

- setup_optimizer now handles wrapping with CPUOffloadOptimizer internally
- setup_scheduler now handles extracting base optimizer from CPUOffloadOptimizer
- Simplified SFT train.py to just pass cpu_offload flag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Shorten docstring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add validation to prevent both cpu offload options enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Move DTensor import to top of file

Co-authored-by: sami <sami@primeintellect.ai>

* docs: add changelog for optim_cpu_offload

Co-authored-by: sami <sami@primeintellect.ai>

* Fix CPU offload pinning race

Co-authored-by: sami <sami@primeintellect.ai>

* fix: avoid mutating DTensor state

Co-authored-by: sami <sami@primeintellect.ai>

* Fix checkpointing with CPUOffloadOptimizer

The checkpoint system uses PyTorch's get_state_dict/set_state_dict which
expect actual Optimizer objects. CPUOffloadOptimizer is a wrapper, so we
need to extract the base optimizer for checkpointing and re-initialize
the wrapper state after loading.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add docstring clarifying _move_states behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix devise

* fix: pass optim_cpu_offload to RL optimizer setup

- Add cpu_offload parameter to setup_optimizer call in RL training
- Add validation to prevent optim_cpu_offload with max_concurrent_runs > 1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-02-03 15:29:37 -08:00
samsjaandGitHub a2ce702a7d update agents md (#1710) 2026-02-03 15:28:56 -08:00
63863647e4 fix rac e condition (#1717)
Co-authored-by: Mika Senghaas <mail@mikasenghaas.de>
2026-02-03 15:28:22 -08:00
a0d889cb72 Add a rate limit on worker job submission (#1711)
* feat: Add task rate limiting for environment workers

* fix: Update maximum sandbox tasks to disable rate limiting

* update lock

* refactor: Remove tasks_per_minute references from tests

* feat: Add optional rate limiting for sandbox tasks per worker

* feat: Add optional rate limiting for task executions

* feat: Add optional rate limiting for tasks per minute

* test: Add tasks_per_minute to env_worker tests

---------

Co-authored-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
2026-02-03 14:13:44 -08:00
Mika SenghaasandGitHub 65ba487034 bump vf (dfc473c) (#1708)
* bump vf

* use ckpt consistently

* fix imports

* make env worker run

* fix utils used in eval and synthesize endpoint

* restore old semaphore behavior

* remove unnessary semaphore setup

* set max_concurrent_groups

* fix to make concurrency global

* fix key error

* access oai_tools safely

* use vf retries

* use new types

* consistent tool handling

* misc
2026-02-03 02:50:02 -08:00
halleriteandGitHub 4fb4639616 add multi-turn support for multi-modal RL (#1703) 2026-02-02 20:06:41 -08:00
JannikStandGitHub 3194b161a6 Add JSON structured logging for log aggregation (#1681)
* Add JSON structured logging option for log aggregation

* Add CHANGELOG entry and fix default value pattern

* Pass JSON logging config to env workers

* Wire JSON logging to all entrypoints (eval, synthesize, sft)

* Pass JSON logging to eval subprocesses

* Rename json to json_logging to avoid Pydantic shadowing warning

* Use flat JSON format for log aggregation instead of loguru serialize

* Fix exception handling in JSON logger sinks

* Remove [verifiers] prefix from intercepted logs

* Fix outdated docstring for intercept_verifiers_logging

* Refactor JSON logging: dedupe, non-blocking sinks, fix CHANGELOG

* Remove unused close method from _JsonFileSink

* Include worker tag in JSON log output

* Create parent directories for JSON file sink

* Restore [verifiers] prefix for intercepted logs

* Rename json parameter to json_logging in setup_logger for consistency

* Replace tqdm with ProgressTracker for JSON logging compatibility

When JSON logging is enabled, progress bars are replaced with periodic
log messages (every 10%) to avoid garbled output. When disabled, tqdm
works as before.

* Fix file handle leak and emit structured progress events

- Add atexit cleanup for _JsonFileSink file handle
- Progress events now emit structured JSON with type/current/total/percent fields
- Remove unused is_json_logging function
- Add proper type hints for postfix dict

* Add step context to progress events and fix 0% jump

- Add optional step parameter to ProgressTracker
- Include step in JSON output and tqdm desc
- Don't emit 0% on init (only on actual progress)

* Keep tqdm output unchanged, only add step to JSON mode

* Remove enqueue=True from non-JSON handlers to fix tqdm

enqueue=True causes loguru to use background thread which
interferes with tqdm's terminal output. Only needed for JSON mode.

* Remove unreachable else branch in _emit_progress

* Fix typo in get_logger docstring

* Add lock to prevent interleaved JSON output

Both _json_sink (loguru background thread) and _emit_progress write
to stdout - without synchronization they can corrupt JSON lines.

* Route progress through loguru for single output path

Instead of writing directly to stdout (which needed a lock),
progress events now go through loguru with _progress marker.
_build_log_entry detects and formats them specially.

* Add level field to progress events for consistency
2026-02-03 00:21:52 +01:00
Matej SirovatkaandGitHub e71145acc5 Revert "Single cat dataset (#1706)" (#1709)
This reverts commit 309970c3ec.
2026-02-02 18:11:56 +01:00
Matej SirovatkaandGitHub 309970c3ec Single cat dataset (#1706)
* Feat: basic data pipeline

* Feat: single cat dataset
2026-02-01 14:27:19 +01:00
a3ba95b292 fix: eval watcher only picks up checkpoints in increasing order (#1702)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 23:17:39 -08:00
Jackmin801andGitHub f14c8d6c2d user inference pool client instead of starting one for validation (#1704) 2026-01-31 20:39:05 -08:00
Jackmin801andGitHub b798a90d6a [ci] benchmark test (#1696)
* weee test

* add it to gha

* 4gpu test

* add row for 4 x a6000 to benchamrks

* change the baseline a bit

* im not sure if we actually regressed :(

* up tolerance because massed compute suk
2026-01-31 20:13:51 -08:00
JannikStandGitHub e5566f9819 Add HF Hub timeout defaults to Dockerfile (#1699)
Defaults are 10s which causes issues on slow networks or large model downloads.
2026-01-31 16:23:32 -08:00
samsjaandGitHub e794fbe524 fix nccl update (#1693) 2026-01-30 16:06:52 -08:00
halleriteandGitHub 36959cbbac add multimodal training (experimental) (#1680) 2026-01-30 15:23:43 -08:00
a57550349c Lieger kernel model deprecation (#1691)
* Deprecate liger kernel model impl

Co-authored-by: sami <sami@primeintellect.ai>

* Remove liger_kernel impl option

Co-authored-by: sami <sami@primeintellect.ai>

* Restore historical changelog note

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-30 14:46:46 -08:00
Jackmin801andGitHub 53ddafcbee remove cc check for grouped mm (#1692) 2026-01-30 14:46:29 -08:00
Jackmin801andGitHub 370221cb4e [fix] dont create config dir on trainer during config validation (#1690)
* dont ever create config dir

* add parsing error back

* remove test for error file on missing config
2026-01-30 12:56:06 -08:00
samsjaandGitHub 3ac5c20543 make nccl broadcast compatbile with dp (#1686) 2026-01-30 11:07:47 -08:00
Jackmin801andGitHub 25f604ed01 [ci] make multi run test do 2 gpu trainer and 2 inference servers (#1682)
* make multi run rl test run on 4xa6000

* make multi run test do 2:2
2026-01-29 15:16:42 -08:00
samsjaandGitHub 9ebcb8ef9c update agents (#1679) 2026-01-29 14:46:08 -08:00
manveerandGitHub 96ccece00f Fix bug where hosted RL rollouts were missing final msg (#1683) 2026-01-28 20:58:08 -08:00
kalomazeandGitHub af6709b20c [fix] add Gemma3 support (#1648)
* [fix] add Gemma3 support: final_logit_softcapping and meta device buffer handling

* [fix] handle softcap=0 as disabled

* [fix] use comment not docstring
2026-01-28 15:55:30 -08:00
Jackmin801andGitHub 137e36add5 [fix] zombie guard on checkpoint (#1670)
* zombie guard on checkpoint

* make the cleanup code safer

* make resume from latest stable so we dont try to resume from orchestrator only ckts

* simpler logic

* the old checkpoint step discovery is needed by single packer

* we need to relook for stable step in load_run otherwise packer might ahveincremented the step and we are introuble

* dont set step after ckpt load because we might reset packer progress
2026-01-28 15:41:08 -08:00
samsjaandGitHub 98c05cf656 only master clean weight (#1678) 2026-01-28 13:03:25 -08:00
a622429bfe Wandb async RL inflight (#1677)
* Add inflight rollout metric to scheduler

Co-authored-by: sami <sami@primeintellect.ai>

* Add inflight sample count metric

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-28 10:37:31 -08:00
halleriteandGitHub 4fc312b0b0 add Temperature Scheduler (#1624) 2026-01-27 15:28:06 -08:00
samsjaandGitHub 22674559d4 cancel all rollout eval (#1671) 2026-01-27 11:28:06 -08:00
JannikStandGitHub 667fb388fa bump prime to 0.5.24 (#1673)
* bump prime to >=0.5.24

* update uv.lock for prime 0.5.24
2026-01-26 23:41:41 -08:00
halleriteandGitHub bc5c3cfdb2 bump transformers (#1672) 2026-01-26 22:49:18 -08:00
JannikStandGitHub 9d1581479c Revert "bump prime minimum version to 0.5.23 (#1664)" (#1669)
This reverts commit d6552d6d15.
2026-01-26 17:06:53 -08:00
samsjaandGitHub d83dce6994 fix: support NCCL mode when resuming from checkpoint (#1665)
Add `check_exists` parameter to `get_weight_dir()` to handle NCCL weight
broadcast mode where weights are transmitted via NCCL rather than stored
on disk.
2026-01-26 13:10:09 -08:00
7cc9cd903b update angnts.md (#1658)
* update angnts.md

* Update AGENTS.md

Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>

* Update AGENTS.md

Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>

* Update AGENTS.md

Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
2026-01-26 11:52:58 -08:00
JannikStandGitHub d6552d6d15 bump prime minimum version to 0.5.23 (#1664)
* bump prime minimum version to 0.5.23

* update uv.lock for prime 0.5.23
2026-01-26 20:35:46 +01:00
Jackmin801andGitHub 756b78e7a4 skip openai integ tests if key not set (#1662) 2026-01-26 02:35:39 -08:00
kalomazeandGitHub 4acd5f08bb fix weight update when enforce_eager=True (#1644) 2026-01-25 14:03:48 -08:00
minh hoangandGitHub 2b3cc8574a tidy: prometheus_client dependency is always available via vLLM (#1656)
* remove metrics optional dep group

* uv sync

* update metrics server and tests to remove usage of PROMETHEUS_AVAILABLE
2026-01-25 13:58:07 -08:00
42e09073f6 Add missing [ckpt] section to reverse_text rl.toml (#1653)
* Add missing [ckpt] section to reverse_text rl.toml

The README.md documents that `outputs/weights/step_20` will be created
after RL training, but the rl.toml was missing the [ckpt] section.
Without this section, no weight checkpoints are saved because
`setup_ckpt_managers()` returns (None, None) when ckpt_config is None.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add missing [ckpt] section to other example configs

Also adds [ckpt] section to:
- examples/wiki_search/rl.toml
- examples/reverse_text/sft/train.toml
- examples/reverse_text/rl/train.toml

These training configs were missing checkpoint configuration,
which would result in no weights being saved after training.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 12:14:28 -08:00
WindandGitHub 31cdc0bce5 Update train.py (#1647)
Signed-off-by: Wind <116412564+windlgrass@users.noreply.github.com>
2026-01-23 21:14:16 -08:00
bd78508566 Pin Ruff in pre-commit + add Ruff format to CI (#1633)
* bump ruff version & move to ruff-check

* add ruff format to CI

* run ruff format

* fix ruff

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-23 20:59:43 -08:00
halleriteandGitHub e67022bb3b fix kl mismatch by resetting prefix cache (#1650) 2026-01-24 03:49:43 +01:00
rasdaniandGitHub a588963740 add option to skip has model check (#1543)
* add option to skip has model check

* changelog

* pre-commit

* resolve to non-breaking kwarg `skip_model_check`
2026-01-23 15:10:14 -08:00
Matej SirovatkaandGitHub e3146ba9f2 3-stage logic for chunked lm head loss (#1649)
* 3-stage logic for chunked lm head loss

* Better description

* Fixes

* idk

* Final I hope

* switch to auto/disable

* changelog
2026-01-23 22:22:39 +01:00
halleriteandGitHub 40d8103c38 add mismatch-KL stability checks for nightly math runs (#1640) 2026-01-23 12:03:53 -08:00
82a8241f0c fix cpu offloading (#1636)
* fix cpu offloading

* fix offlaod for moe

Fix buffer init in random init path

Co-authored-by: sami <sami@primeintellect.ai>

Fix buffer device move when meta load unavailable

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-23 11:18:54 -08:00
Jackmin801andGitHub 53a5ab868b [fix] use discovery in eval (#1642)
* use discovery in eval

* make eval use lora name unless none of the servers have it

* address comments to encapsulate and not be too defensive

* type hinting

* pass model name directly instead of doing model config

* better logging

* we dont need complicated discovery because only ckpt 0 is base in lora

* wait indefinitely similar to the env workers

* move the wait into discovery
2026-01-23 08:10:49 +01:00
halleriteandGitHub 526af9c367 fix wording in warning (#1643) 2026-01-22 23:34:02 +01:00
halleriteandGitHub 258e0dfc79 align token chat preprocessing with vllm 0.14 (#1637) 2026-01-22 02:48:00 -08:00
d0f2eb43dc Weights reload configuration (#1635)
* Make reload weights optional on start

Co-authored-by: sami <sami@primeintellect.ai>

* Default reload weights to true

Co-authored-by: sami <sami@primeintellect.ai>

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-21 20:28:57 -08:00
JannikStandGitHub beb8ef3c66 Add INFO log when orchestrator resumes after checkpoint wait (#1638) 2026-01-22 04:22:43 +01:00
JannikStandGitHub e1663ba065 Add elastic inference pool with DNS-based service discovery (#1617)
* Add elastic inference pool with DNS-based service discovery

- Add ElasticInferencePool for tracking pod readiness and adapter sync
- Main process discovers pods via K8s headless service DNS
- Only exposes pods with correct LoRA adapter as "ready" to workers
- Workers receive ready URLs via callback to prevent model-not-found errors
- Fully backwards compatible with static base_url configuration

* Fix tests: use asyncio.run() pattern instead of pytest-asyncio

* Fix: pass ready URLs to workers in elastic mode

* Generalize elastic inference pool to support any DNS-based discovery

- Rename headless_service to hostname (works with any DNS with multiple A records)
- Rename pod terminology to server throughout (not K8s-specific)
- Update docstrings to mention Kubernetes as one option among many

* Add changelog entry for elastic inference pool

* Fix min_pods -> min_servers parameter name

* Validate elastic inference requires LoRA training

* Add health and base model check before marking server as discovered

* Remove servers that fail health checks during sync

* Change elastic pool logs from info to debug

* fix: queue rollout requests when no inference servers available

- Clear clients when URLs become empty (instead of keeping stale clients)
- Queue incoming requests while waiting for servers to become ready
- Process queued requests once servers are available again
- Add NoServersAvailableError safety check in process_request

* fix: avoid false adapter match on default step=0

Only match by step when step > 0 to prevent false matches when
both loaded and desired adapters have default step=0 but different paths.

* test: fix elastic tests for health check changes

- Mock _check_server_health in _add_server and sync tests
- Add test for step=0 not causing false adapter matches
- Add test for health check failure in _add_server
- Add tests for _check_server_health method

* feat: support elastic inference for non-LoRA training

Elastic pool now works for base model inference too. Servers are
ready once they pass health check and have the base model loaded.

* fix: address cursor bot concerns

- Compare URLs as sets to avoid spurious callbacks from order changes
- Close old inference clients before creating new ones to prevent connection leaks

* refactor: use Literal type for server status

* docs: simplify elastic pool descriptions

* test: convert to pytest function style

* fix: address copilot review feedback

- Move time import to module level
- Use empty list instead of fallback to base_url in elastic mode
- Add comments to except:pass blocks

* docs: clarify sync_interval unit is seconds

* refactor: rename sync_interval to sync_interval_s for clarity

* rename update_weights to sync_adapter in elastic pool

* rename sync_adapter back to update_weights, remove test_elastic.py

* refactor: workers do own DNS discovery, remove callback pattern

- Workers discover servers via DNS and check /v1/models directly
- Majority vote: use all healthy servers if no adapter, only adapter servers otherwise
- Remove callback/URL push machinery from scheduler and elastic pool
- Simplify elastic.py to only handle admin operations (adapter sync)

* fix: pass model_name per-request for LoRA compatibility

* Simplify orchestrator: remove worker_client_config branching

* Restore comments in extract_result

* Encapsulate elastic mode behind InferencePool abstraction

* Move discovery functions to elastic.py to reduce duplication

* Restore comments in env_worker.py

* Fix type annotations - remove unnecessary string quotes

* Fix code review issues: rename sync_weights to public, add debug logging

* Add unit tests for elastic inference pool

* refactor: consolidate elastic config handling in WorkerServerDiscovery

- Remove redundant elastic params from env_worker (hostname, port, sync_interval)
- Extract elastic config from ClientConfig inside workers
- Add WorkerServerDiscovery class to encapsulate worker-side discovery
- Simplify worker loop logic, remove duplicate get_clients calls
- Convert tests to function-based format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* refactor: move client discovery logic to WorkerServerDiscovery class

* restore inline comment

* remove redundant update_model_name - model name is fixed at init

* restore update_model_name method

* move update_model_name to original location

* fix test: patch setup_clients function instead of non-existent method

* fix: dedupe servers, guard elastic requires LoRA, don't close clients mid-request

* fix: workers start with base model name, switch to LoRA after loading

* add logging for model switch and tests for update_model_name

* fix test: mock queue put to avoid multiprocessing timing issues

* make inference_pool required parameter in Scheduler

* cache inference clients in ElasticInferencePool to avoid recreating on each access

* update worker discovery model name when request model changes (LoRA switch)

* fix: multi-adapter detection, refactor InferencePool to Protocol

- fix _get_loaded_adapter to filter by adapter name when multiple adapters loaded
- unify LoadedAdapter and DesiredAdapterState into AdapterState
- refactor InferencePool to Protocol with StaticInferencePool and ElasticInferencePool implementations
- remove unused admin_clients param from Scheduler
- fix discover_ready_servers to only return servers with requested model (no fallback)
- add tests for multi-adapter case

* refactor: clean up elastic discovery with shared utility functions

- Add ServerDiscovery class for env workers (DNS discovery + client management)
- ElasticInferencePool uses same discovery functions
- Shared logic via utility functions: discover_server_ips, discover_ready_servers
- Remove mode flags and unnecessary abstractions

* remove early elastic+lora validation from orchestrator (handled in ElasticInferencePool.update_weights)

* add debug logging for adapter mismatch + parallelize sync_weights

* add more debug logging for adapter matching

* close inference clients on ElasticInferencePool shutdown
2026-01-22 02:26:01 +01:00
Jackmin801andGitHub 0ca5739f75 Allow trainer to evict runs that write bad batches (#1634)
* add run eviction logic

* add some tests

* add run eviction to docs

* update rename in index

* make packer evict runs it doesnt like

* add check for teacher logprobs

* dont error on idx not found in case we double evict

* remove stale test

* this log is quite spammy

* rename config folder to control
2026-01-21 16:10:10 -08:00
9613f61b9b Disable final checkpoint saving when max_concurrent_runs > 1 (#1632)
* Disable final checkpoint saving when max_concurrent_runs > 1

When max_concurrent_runs > 1, checkpoints are managed by the
MultiCheckpointManager at the whims of the orchestrator, making
the final checkpoint save in the trainer redundant and meaningless.

* Update src/prime_rl/trainer/rl/train.py

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

* Update src/prime_rl/trainer/rl/train.py

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-21 11:57:24 -08:00
manveerandGitHub 646e9928a4 Ensure eval results upload before existing subproc (#1631) 2026-01-20 21:32:41 -08:00
Jackmin801andGitHub 11c84c2853 [fix] make search for line more robust (#1630)
* make search for line more robust

* need the fix in above line as well
2026-01-20 19:47:58 -08:00
kalomazeandGitHub 63988a79ec Assert when only trainer or orchestrator wandb is configured (#1629)
* [Validate] Assert when only trainer or orchestrator wandb is configured

* Mention [wandb] as alternative in assert messages
2026-01-20 17:35:34 -08:00
d7742b9569 Add AGENTS.md and CLAUDE.md (#1627)
* Add AGENTS.md and CLAUDE.md for AI coding agents

- AGENTS.md as source of truth for all AI agents
- CLAUDE.md imports AGENTS.md for Claude Code compatibility

* Update AGENTS.md

---------

Signed-off-by: JannikSt <JannikSt@users.noreply.github.com>
Co-authored-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
2026-01-21 02:02:09 +01:00
Jackmin801andGitHub 66bfa0f473 up vllm version to 0.14 (#1625) 2026-01-20 16:37:03 -08:00
c3de771b0d [Refactor] rename Runs -> RunsManager and cleanup hooks (#1619)
* better runs docs

* some renamin

* missed tests

* missed comments

* meraid docs render in gh according to CC [skip ci]

* better diagram [skip ci]

* Update docs/runs.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

* docs update

* rename to MultiRunManager

* guard the discovery apis rom being used by non master ranks

* variable renaming

* sync runs to synchronize state

* dont register master only hooks on non master

* encapsulate lora hook registration into run manager setup

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-20 12:54:48 -08:00
50600eaa79 remove extra logging (#1621)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-20 10:21:52 -08:00
JannikStandGitHub c69c615cfb Add retry with exponential backoff for empty training batches (#1622)
* Add exponential backoff retry for empty training batches

When inference becomes temporarily unavailable, all rollouts may fail
resulting in an empty batch. Instead of crashing, retry the step with
exponential backoff (30s, 60s, 120s, 240s, 300s cap) up to 5 times.

* Cancel validation task before retry to avoid accumulation

* Fix off-by-one: use >= for retry count check
2026-01-20 18:55:32 +01:00
halleriteandGitHub 41d141934a bump wandb (#1623) 2026-01-20 09:44:42 -08:00
JannikStandGitHub a9b5aa5cdf Fix trainer crash when all rollouts in a batch fail (#1596)
* Fix trainer crash when all rollouts in a batch fail

When all rollouts fail (e.g., conversations exceed context limit), the tensor is empty and compute_stats() crashes on .min()/.max() calls. Skip stats computation for empty tensors.

* Emit NaN for empty tensor stats instead of skipping
2026-01-20 03:10:32 +01:00
JannikStandGitHub 571d48135c Auto-restart env workers on unexpected death (#1609)
* Auto-restart env workers on unexpected death

- Add restart() method to EnvWorker
- Modify collect_responses() to auto-restart with warning log
- Scheduler catches WorkerDiedError and continues instead of crashing
- Add unit tests for restart functionality

* Fix: join dead process to prevent zombies

* Add max restart limit (5) to prevent infinite restart loops

* Make max_worker_restarts configurable via orchestrator config

* Rename to max_env_worker_restarts for clarity

* Support -1 for unlimited restarts

* Fix AI review feedback on worker restart behavior

- Reset restart count after 10 successful responses (prevents
  isolated failures over time from accumulating)
- Store fatal error on worker so orchestrator can detect and crash
  when max restarts exceeded
- Fix misleading log message that claimed auto-restart unconditionally
- Add _check_for_fatal_worker_errors() to crash orchestrator properly

* Remove elastic utility file

* Remove k8s references from config and scheduler

* Make restart method private

* Fix test mock to use _restart
2026-01-20 02:58:09 +01:00
Jackmin801andGitHub 41a66e2b26 fix comma in benchmark json (#1618) 2026-01-19 16:45:48 -08:00
Jackmin801andGitHub 8718eb143d [CI] Add CP and EP to benchmarks (#1614)
* add ep

* add cp

* add ep and cp to the table

* rename json in benchmark ci

* add some cp and ep tests
2026-01-19 15:18:34 -08:00
Jackmin801andGitHub 2486860eba [feat] Multi run ckpt (#1593)
* support index in register post creation callback

register scheduler at index 0

plumbing

first draft

fixes

* just copy for now

* fix issue where only master tracks saved ckpt steps

* only master should do the broadcast copy

* add deletion hooks

* delete stale managers on deletion

* support the -1 convention

* make orchestrator broadcast support reading from ckpy dir

* only delete manager if it exists

* fix: add creation hook so we check existing ckpts before orchestrator
creates them

* missing arg [skip ci]

* dcp is not my friend

* add ckpt config to test

* more efficient trainer

* include some stop resume in the tests

* fix tests

* add some useful debug logs

* fix: type in orch check

* fix: dont load progress in create run hook

* broadcast progress so all ranks know when to ckpt

* better debug log for ckpting

* fix: we must wait for trainer checkpoint before we can delete run

* ci uses single gpu trainer

* Revert "ci uses single gpu trainer"

This reverts commit 7b0382b947aa0cb2af64645c17d849708adef467.

* refactor wait and kill for tests

* tests passing but kinda messy

* remove old log

* cleanup test

* cosmetic changes to multi run test

* fix: missed orch proc setting

* put start print in a better location

* exclude the resumes from reward go up check

* use stable file to mark trainer is done with checkpointing

* the barrier needs t be outside the try catch

* add timeout to wait for file

* mark stable after last barrier

* error in wait for log if timeout

* fix fixture signature

* append to tracked steps after barrier

* fix bad while else

* fix: move barrier and mark stable into the loop

* the orchestrator finish wait was apparently necessary for beta orch to exit correctly

* better error message for not finding weight dir

* cleaner manager creation in multi ckpt

* try catch the weight copy

* fix: manager access in clean

* move wait file print to less spammy place

* no max steps in trainer toml should make it infinite

* add comment about wide try except
2026-01-19 14:42:40 -08:00
Jackmin801andGitHub 08afcd20c1 [fix] use step change instead of batch size to demarcate when to update (#1613)
* use step change instead of batch size to demarcate when to update

* address copilot comments
2026-01-18 13:40:13 -08:00
Jackmin801andGitHub 213553403c Fix timeout overcounting (#1612)
* smaller timeout [skip ci]

* fix timeout overcounting into next step
2026-01-18 10:53:11 -08:00
Jackmin801andGitHub 147e443101 Revert "fix logging (#1605)" (#1611)
This reverts commit 0e53e7f19b.
2026-01-16 16:49:35 -08:00
manveerandGitHub 30873eb28b Improve log message on orchestrator for hosted rl (#1608) 2026-01-16 14:35:33 -08:00
0e53e7f19b fix logging (#1605)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-16 13:01:07 -08:00
Jackmin801andGitHub b214a4536c adjust multi run test args to be less flaky (#1606) 2026-01-16 12:31:42 -08:00
Jackmin801GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <github-actions[bot]@users.noreply.github.com>
d8f290ef03 [CI] nightly perf (#1566)
* support exporting json in bench mode

* script to run one benchmark

* auto set batch size

* aggregation script

* draft nightly

* add benchmarks folder to image

* support passing docker image

* use image and from micro batches

* some reordering and passing more args

* try this

* use runner name in step name

* bash the entrypoint and working dir

* rename artifact

* dont support sft lora for now

* remove concurrency gorup

* print last 100 lines in success so we can see the table in the ci run output

* add comment

* make containers use host HF home to speedup multiple tests on the same runner

* set max loras

* use hosts root cache

* add runner to artifact name

* make baselines dir

* dont use this random dudes step wth claude

* do /data

* don do labels

* try to just use a named volume

* try directly having root level dir

* try clearing lock and changing permissions

* just start container as root

* god i cant rmb the name of my own args

* better device name surfacing

* pin a digest because tag might drift

* should probably make it easier to test changes to agg result but yolo i trust the ai overlords

* get the image digest on a self hosted runner so we have image cache

* go out of our way to surface OOM

* allow setting diff display threshold

* baseline should be set after running not before

* put docker image in the markdown

* displaying per microbatch step time probably makes more sense

* set better name for benchmark json files

* dont use batch size in config key

* move constants to the top

* rename and cleanup

* wishlist matrix

* missing commas lol

* fix typo

* use the 1xa6000 as the digest runner

* rename workflow

* set longer timeout for 235b

* try shell arithmetic

* we need to multiply the num tokens by dp size

* add time taken

* better sorting key

* change hardware col order

* just print every line in the success case, we arent poor

* lines

* wishlist benchmarks

* prune some more errors

* remove some dead ones

* rl bench validator

* add timeou to run single benchmark

* only copy the scripts

* sort matrix a bit better

* more pruning and tuning

* Update benchmark results 2026-01-16 (#13)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

* make regression flag more unique

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-01-16 11:44:18 -08:00
Matej SirovatkaandGitHub 43cacaa289 Ep (#1595)
* Feat: some ep

* Fix: some minor

* Fixes

* Feat: final?

* Fix: remove debugpy-run

* Fix: reshard_after_forward=False

* Fix: optimizer

* Fix: pass parallel_dims instead of device_mesh

* Fix: multi-opimzer

* changelog

* Fix: reference comments
2026-01-16 11:43:04 -08:00
DominikandGitHub a1271501b8 Fix: Add k8s doc to docs folders and update mint config (#1597)
* Add k8s docs to docs content and update mint config.

* Revert change.

* Revert deployment.
2026-01-16 10:57:54 +01:00
JannikStandGitHub bdfbfae982 Add health endpoint for worker nodes in multi-node training (#1601)
* Add health endpoint for worker nodes in multi-node training

- Add HealthServer base class with /health endpoint only
- MetricsServer now extends HealthServer
- Worker nodes start HealthServer, master gets full MetricsServer
- Add tests for HealthServer

* Fix port conflict: only start server on local_rank 0 per node

* Fix ruff formatting

* Format test file

* Fix ruff lint errors

* remove transient error testfile
2026-01-16 06:56:40 +01:00
Jackmin801andGitHub 7a50d2680e check for current step based on progress to know what is valid for this step (#1604) 2026-01-15 20:47:43 -08:00
32adbba802 Sami/fix logging env (#1602)
Release / Push CUDA image to Docker (push) Canceled after 0s
* make per worker env false by defaulot

* udpate changelogkl

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-15 16:01:04 -08:00
JannikStandGitHub c330a6d4eb Add InfiniBand libraries for NCCL multi-node support (#1600)
* Add InfiniBand libraries for NCCL multi-node support

* Fix: remove comment breaking Dockerfile line continuation
2026-01-15 14:28:05 -08:00
11d87ee888 Incomplete evaluation results (#1589)
* Eval: record no-response rollouts instead of cancelling

Co-authored-by: sami <sami@primeintellect.ai>

* Eval: report no_response percentage metric

Co-authored-by: sami <sami@primeintellect.ai>

* Fix eval: don't clobber successful rollouts on save failure

Co-authored-by: sami <sami@primeintellect.ai>

* Annotate save failures without discarding state

Co-authored-by: sami <sami@primeintellect.ai>

* Revert "Annotate save failures without discarding state"

This reverts commit 85a0e3c441eb0b053964b0feb0eaab2863699e3b.

* Update src/prime_rl/eval/utils.py

Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>

* Eval: ignore failed rollouts in avg reward; simplify saving

Co-authored-by: sami <sami@primeintellect.ai>

* Simplify rollout_status parsing (assume dict)

Co-authored-by: sami <sami@primeintellect.ai>

* Update src/prime_rl/eval/utils.py

Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
Co-authored-by: rasdani <73563550+rasdani@users.noreply.github.com>
2026-01-15 13:05:27 -08:00
0e5940f82b refactor logging on environment in orch (#1594)
* remove logging

* add per env logging

* log to one file when having multiple worker

* intercept verifier log

* intercept verifier log

* intercept verifier log

* Add worker tag to env worker logger for identification

Co-authored-by: sami <sami@primeintellect.ai>

* Update changelog for logging config changes

Co-authored-by: sami <sami@primeintellect.ai>

* Rename env worker log config flag

Co-authored-by: sami <sami@primeintellect.ai>

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-15 13:04:27 -08:00
969df59e54 fix eval order (#1598)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-15 11:22:54 -08:00
ff620131e4 remove logging (#1592)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-15 10:11:27 -08:00
Jackmin801andGitHub c95bd79d43 Make packer pack smaller granularity and round-robin (#1542)
* generated packer tests

* simplify packer tests

* packer doc

* support buffers and smaller orchestrator granularity

* fix duplicates in filesystem reader

* make small batch granularity toggleable to not break single run behavior

* add comment about temperature

* fix reset staleness

* fix: cc is way too defensive and didnt understand what we meant with needing full batches in small_batch_granularity=False case

* missing samples increment

* guard infinite loop in select samples

* remove the tests because the previous logic didnt make sense so theyre probably super stale and confusing

* fix: check every run in full batch case

* do popleft

* add create run data hook

* just prealloc state cuz life is easier

* set small granularity packing on the multi run test

* remove debug prints

* have very descriptive name for pack flag

* the doc isnt particularly helpful

* cover overfull case

* split out single run packer

* remove packer arg

* missing step arg

* pop out the oversized batch

* take out tokens collected if skip

* transport config

* move packing reset hook to deletion
2026-01-14 19:43:36 -08:00
baf62617aa Step check runtime context (#1587)
* refactor(eval): move checkpoint step validation to runtime

Keep the same stable-checkpoint step validation logic, but run it at eval startup instead of during config parsing.

Co-authored-by: sami <sami@primeintellect.ai>

* chore(eval): remove runtime step validation comment

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-14 19:02:42 -08:00
bceb0ccebf Logging tmux script panes (#1590)
* docs: simplify tmux logging section

Co-authored-by: sami <sami@primeintellect.ai>

* docs: trim tmux logging usage snippet

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-14 18:24:09 -08:00
rasdaniandGitHub 6d3af788ac fix skipped eval env log (#1591)
* fix: return values

* changelog
2026-01-15 01:06:47 +01:00
manveerandGitHub a03d81f14f Fix bug causing evals to not get uploaded for hosted RL (#1582)
* Fix bug causing evals to not get uploaded for hosted RL

* Simplify approach

* Add detailed comment
2026-01-14 15:46:39 -08:00
4ff009d2ec update docs for logging (#1588)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-14 14:07:12 -08:00
0403f1271a bump verifier main (#1572)
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-14 13:54:23 -08:00
rasdaniandGitHub 33101f260c skip failed eval envs with warning (#1586) 2026-01-14 13:54:01 -08:00
eb8a154f11 Eval script checkpoint failures (#1585)
* fix: keep eval running on checkpoint failures

Adds `continue_on_ckpt_error` so a single bad checkpoint won't abort multi-checkpoint evals. In watcher mode, existing stable checkpoints are skipped (per docs) and failed new checkpoints remain pending for retry.

Co-authored-by: sami <sami@primeintellect.ai>

* chore: sort imports in eval checkpoint test

Co-authored-by: sami <sami@primeintellect.ai>

* chore: satisfy ruff import ordering in eval test

Co-authored-by: sami <sami@primeintellect.ai>

* chore: apply ruff import ordering fix

Co-authored-by: sami <sami@primeintellect.ai>

* fix: avoid global sys.modules stubs in eval test

Use anyio marker and local monkeypatching so this test doesn't break collection for other unit tests.

Co-authored-by: sami <sami@primeintellect.ai>

* refactor: always continue on checkpoint eval failures

Remove the config/test and make checkpoint eval best-effort by default: per-checkpoint exceptions are logged and evaluation continues. Watcher mode keeps failed checkpoints pending for retry.

Co-authored-by: sami <sami@primeintellect.ai>

* fix: keep watcher evaluating existing checkpoints

Restore prior watcher behavior: evaluate all stable checkpoints first, then watch for new ones. Checkpoint failures are logged and skipped without aborting the whole eval process.

Co-authored-by: sami <sami@primeintellect.ai>

* refactor: inline checkpoint try/except in eval

Co-authored-by: sami <sami@primeintellect.ai>

* Revert "refactor: inline checkpoint try/except in eval"

This reverts commit 4b6483786bd39889676c2226693229ae59a4e63a.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-14 13:09:14 -08:00
rasdaniandGitHub 518fa49811 fix: wait for checkpoint completion in eval watcher (#1584) 2026-01-14 15:58:03 +01:00
85a9dc0e71 add watcher (#1581)
* wip add watcher

* docs: add changelog entry for eval.watcher

Document the new eval.watcher config flag per config-change review rules.

Co-authored-by: sami <sami@primeintellect.ai>

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-13 18:20:49 -08:00
Jackmin801andGitHub dddc0ddfb7 add fa3 to deps (#1580)
* add fa3 to deps

* pin prebuilt wheel instead
2026-01-13 15:52:23 -08:00
faresobeidandGitHub 05456490a4 fix opd (#1577)
* fix opd

* oops
2026-01-13 20:02:29 +00:00
3436f42a4a add env worker logging (#1561)
* add env worker logging

* reset logger before env logger

* redirect verifiers logger to file

* Add CHANGELOG entry for orchestrator.env.log configuration

Documents the new EnvLogConfig class and log field added to EnvConfig,
which provides logging configuration for environment workers.

* Fix worker crash when logging disabled

When logging is disabled (default), reset_logger() sets _LOGGER to None
but setup_logger() was not called. This caused EventLoopLagMonitor to
crash with RuntimeError when calling get_logger().

Fix: Always set up a logger in worker processes. When logging is disabled,
use CRITICAL level which produces no output (critical logging is disabled
in setup_logger).

* fix

* Add formatter to verifiers logger FileHandler

The FileHandler added for the verifiers logger was missing a Formatter,
causing log messages to be written as raw text without timestamps, log
levels, or logger names. This makes the verifiers logs difficult to
correlate or debug effectively.

Added a Formatter with timestamp (HH:MM:SS) and log level formatting,
matching the format used by the prime-rl logger for consistency.

* Add missing reset_logger() in else branch

On Linux with fork start method, worker subprocesses inherit _LOGGER
from parent. Both branches need reset_logger() before setup_logger()
to avoid RuntimeError("Logger already set").

* Revert "Fix worker crash when logging disabled"

This reverts commit f37ab4be3ce4fe85e15391ecdc3164bfe5b59ee5.

* refactor

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-13 11:29:44 -08:00
aab07534ea Trainer nccl broadcast log (#1575)
* Clarify NCCL weight broadcast logging for non-layer weights

Co-authored-by: sami <sami@primeintellect.ai>

* Refine debug logging for NCCL weight broadcast.

Co-authored-by: sami <sami@primeintellect.ai>

* Remove per-layer NCCL broadcast logging.

Keep only the aggregate broadcast count message to reduce trainer log noise.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2026-01-12 17:29:33 -08:00
samsjaandGitHub 5197c4027e Update README.md (#1573)
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
2026-01-12 14:55:15 -08:00
rasdaniandGitHub 7fbf4a02cb Re-raise vf.SandboxError in eval to trigger rollout rescheduling (#1553)
* Re-raise `vf.SandboxError` in eval to trigger rollout rescheduling

* catch `vf.InfraError` instead
2026-01-12 23:18:43 +01:00
ddb9571ef4 Update LoRA layer default alpha from 16.0 to 32.0 (#1571)
Ensures consistency with the config default changed in #1567. The
MultiLoRALinear and MultiLoRAGroupedExperts classes had stale defaults
that should match the orchestrator and trainer configs.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 09:21:21 -08:00
c2f90c8a28 change LoRA alpha default to 32 (#1567)
* change LoRA alpha default to 32

* bugbot fixes

* LR fix

* use alpha=64 in alphabet_sort config

* adjust LR for CI configs

* Apply suggestion from @Jackmin801

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

* lr moved to optim

* check step 9 now that lr is lower

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Jackmin801 <ongjackm@gmail.com>
2026-01-12 09:12:37 -08:00
Sebastian MüllerandGitHub 1455a8afbc Unique rollout request ids to avoid collisions (#1568)
* Fix rollout request matching by using unique request IDs

* Fix worker pending task tracking after request_id change

* simplify request_id access

* Revert "simplify request_id access"

This reverts commit eb456b87275120b2ba1ad5e000cee74f386d288f.

* Fix pending task typing
2026-01-12 05:51:52 -08:00
88da7cb296 fix: detect dead worker process in collect_responses (#1546)
* fix: detect dead worker process in collect_responses

Previously if a worker subprocess crashed, collect_responses() would loop forever waiting for responses. Now it checks process.is_alive() and raises RuntimeError with exit code.

* fix: remove unused import

* fix: rewrite tests as sync to avoid pytest-asyncio dependency

* Add _stopping flag to skip dead worker error during shutdown

* Reset _stopping flag in start() to fix restart detection

* Remove unused tests for EnvWorker subprocess management

Co-authored-by: jannik <jannik@primeintellect.ai>

* Fix race condition and pending futures on worker death

* Prevent scheduler from routing to dead workers

* Drain response queue before checking dead worker

* Add WorkerDiedError to propagate through scheduler for K8s restart

* Fix exit code race condition in rl.py main loop

* Check subprocess return codes directly after loop
2026-01-12 12:58:52 +01:00
Jackmin801andGitHub d70a00f6e8 [fix] orchestrator shouldnt have null batch (#1563)
* orchestrator shouldnt have null batch

* change to zero check so partial is stil allowed
2026-01-09 19:01:39 -08:00
1fa70e83dd feat: set default fused_lm_head_chunk_size to 2048 for RL training (#1544)
* feat: set default fused_lm_head_chunk_size to 2048 for RL training

Auto-configures model.fused_lm_head_chunk_size to 2048 for RL training
when not explicitly set. SFT training continues to use None (no chunking)
as it doesn't support chunked loss yet.

* docs: update fused_lm_head_chunk_size description and changelog

Update the field description to mention RL training auto-sets to 2048.
Add changelog entry for the default behavior change.

* Fix: RL training auto-sets fused_lm_head_chunk_size except for liger_kernel

Co-authored-by: ongjackm <ongjackm@gmail.com>

* Refactor check_number_in_range to improve step searching

Co-authored-by: ongjackm <ongjackm@gmail.com>

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-09 12:55:43 -08:00
JannikStandGitHub 355e742a69 Add optional Prometheus metrics server for trainer (#1547)
* Add optional Prometheus metrics server for trainer observability

- Exposes /metrics endpoint with training metrics (step, loss, throughput, grad_norm, etc.)
- Disabled by default, enable via `metrics_server.port` config
- Uses isolated CollectorRegistry per instance
- prometheus_client is optional dependency (uv sync --extra metrics)

* Update lockfile for prometheus_client optional dep

* Add changelog entry for metrics_server

* Convert tests to function style

* Clean up Prometheus metrics naming and add mismatch_kl

- Remove rft_ prefix from all metrics (trainer_* instead of rft_trainer_*)
- Add trainer_mismatch_kl metric for tracking KL divergence

* Add per-run/LoRA metrics to Prometheus server

Aggregate metrics:
- trainer_runs_discovered: run folders found
- trainer_runs_active: runs with assigned slots
- trainer_runs_ready: runs ready for gradient updates
- trainer_runs_max: maximum run capacity

Per-run metrics (with labels):
- trainer_run_step{run="run_001"}: training step
- trainer_run_tokens{run="run_001"}: total tokens processed
- trainer_run_learning_rate{run="run_001"}: current LR
- trainer_run_ready{run="run_001"}: ready status (1/0)

* Add /health endpoint for K8s liveness probes

- Add HealthCheckConfig with max_step_age_seconds and startup_grace_seconds
- Add /health endpoint to MetricsServer for trainer liveness checks
- Fix socket leak in stop() by calling server_close() and joining thread

* Use heartbeat instead of step-age for health checks

- Rename max_step_age_seconds to timeout_seconds
- Add heartbeat() method called every loop iteration
- Detects hung main thread even when waiting for runs

* Add optional on_wait callback to sync_wait_for_path

* Revert unused on_wait callback

* Simplify /health to always return 200
2026-01-09 19:59:29 +01:00
Jackmin801andGitHub 16e747c25e set multinear linear cumsum dtype to int32 (#1557) 2026-01-07 21:34:24 -08:00
Jackmin801andGitHub e75677fcbd [Feat] multi run optim args (#1555)
* orchestrator config is ok and component integrations look satisfactory

* rename lora_name to lora.name in orchestrator

* fix in rl.py

* multilora independent scaling factors

* train.py changes

* changes to runs

* update tomls for lora.name

* set the default lora rank to trainers

* set lora scaling dtype to bf16

* missed lora_name -> lora.name

* allow run to reset the lora globals

* damn these configs got hands

* i feel like i might have made my life hard for no reason. ah well, im lazy to think of somethin better rn

* set higher default lr on orch side

* fix configs for non-master ranks
2026-01-07 18:50:40 -08:00
a24ec986b3 Remove PR template (#1550)
With agents now drafting PRs and auto-generating descriptions, the
template with placeholder text is no longer needed.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-07 01:39:50 -08:00
kalomazeandGitHub ede6b62e69 feat: Add reward field to TrainingSample (#1551)
Store raw reward alongside advantage in rollouts for inspection.
Backward compatible with existing rollout files.
2026-01-06 21:07:12 -08:00
d564195cac [feat] Enable loss chunking for non-custom HuggingFace models (#1545)
* [feat] Enable loss chunking for non-custom HuggingFace models

Add support for chunked loss computation (via FusedOutputLinear) for any
HuggingFace CausalLM model, not just custom PrimeRL implementations.

Changes:
- Add wrap_lm_head_for_hf_model() function in model.py that:
  - Wraps the lm_head with FusedOutputLinear or VanillaOutputLinear
  - Overrides the model's forward method to accept labels and temperature
  - Returns PrimeLmOutput with logprobs/entropy for chunked mode
- Update setup_model() to call wrap_lm_head_for_hf_model for non-PrimeRL models
- Remove config validator restriction that limited fused_lm_head_chunk_size
  to custom/auto implementations
- Add tests for HF model wrapping with both vanilla and fused modes

* change PrimeLmOutput to TypedDict so that it is pytree node by default

Co-authored-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com>

* change all references to output for dict

* guard against unconventional model being used

* dont be so defensive in tests with model output

* guard against lm heads with bias

* move lm head injection logic into lm_head.py and unify injection path for custom and hf impl

* update inject in tests

* fix forward signature for custom impls

* cover input embeds case

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com>
2026-01-06 18:56:06 -08:00
rasdaniandGitHub be0e3d1313 fix: resolve all checkpoints for proper cleanup on resume and cancelled rollout metric (#1537)
* fix: resolve all checkpoints for proper cleanup on resume

* delete dead code

* fix `resume_step`

* log cancelled rollouts to wandb
2026-01-06 02:21:55 +01:00
f870bc91df [feat] moe lora (#1526)
* plumbing to get it to be loaded

* first draft without tenant splitting

* correct fqns

* cleanup multilora moe impl

* fix: param counting

* fix excessive vram usage due to views

* fix perf lora adapter param counting

* make packer only pack global mbs rows with similar run_idx

* add comment because this packing is kinda weird

* fix: set offset correctly for multiloramoe

* idk if th vibe coding has more typos or me

* support lora dropout

* add experts to default lora targets

* remove outdated tests

* feat: Add LoRA dropout to MultiLoRAGroupedExperts

Co-authored-by: ongjackm <ongjackm@gmail.com>

* cursor nits

* forgot the changelog lol

* Update CHANGELOG with recent changes and fixes

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>

---------

Signed-off-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Johannes Hagemann <johannes@primeintellect.ai>
2026-01-05 13:21:43 -08:00
Matej SirovatkaandGitHub 5ad6f62fc2 Fused LM Head implementation (#1525)
* Something

* poc

* Fix: proper logits in sft

* Feat: clean up the surface

* Fix: remove unused arg

* Fix: CP-safe label shift + unify custom forwards

* feat: cleanup

* Feat: more cleanup

* Feat: even more cleanup

* fix

* Feat: final

* cursor unscrew

* fix tests

* more fixes

* Shift labels instead of inputs

* Feat: fix logit shifting

* Fix: sft crash

* Tiny fix

* Shift entropy as well

* Some minor cleanup

* Add to afmoe

* Fix afmoe tests

* Final hopefully

* FINAL

---------

Signed-off-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com>
2026-01-05 12:31:50 -08:00
2cc5c550b7 fix: enable grouped_mm on Blackwell cards (#1536)
* fix: enable grouped_mm on blackwell

* fix: disable grouped_mm in unit tests for MoE models other than AFMoE

* use_grouped_mm should default to True

---------

Co-authored-by: Jackmin801 <56836461+Jackmin801@users.noreply.github.com>
2026-01-04 18:45:22 -08:00
Johannes HagemannandGitHub 840cd87495 fix: add step param to Monitor.log() interface (#1538) 2026-01-03 07:47:39 +01:00
fba2185ed0 refactor online eval (#1518)
* refactor online eval

* fix eval

* fix eval

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-02 12:17:10 +01:00
samsjaandGitHub 3fea505e9d Update README.md (#1533)
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
2026-01-02 12:06:15 +01:00
4706ea0c27 Sami/fix nccl handshake (#1531)
* Revert "Revert "Inference readiness handshake (#1506)" (#1528)"

This reverts commit d85027f7f1.

* fix nccl ready

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-02 11:16:13 +01:00
AutumnAureliumandGitHub f731eb9d07 feat: Add AFMoE support (#1515)
* basic slow afmoe setup

* add flex attention

* avoid compilation error on flex-attn

* super rough fix for swa and sequence packing

* massively simplify impl

* remove a bunch of dead/unused code and clean up

* un-correct unrelated bug for later fix

* remove debug config file accidentally left in

* remove redundant extra imports

* simplify attention impl

* revert comment

* remove flex_attn for now

* fix ruff lints

* do not put attn in separate file

* satisfy ruff
2026-01-02 10:21:55 +01:00
8b2ef0daa6 fix wandb (#1529)
Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-02 10:11:25 +01:00
b750db03c8 Revert "take out step in wandb monitor (#1516)" (#1530)
This reverts commit 895e7d6901.

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-01 10:19:21 +01:00
d621e8889d Add retry logic to load_lora_adapter for NFS delays (#1520)
* Add retry logic to load_lora_adapter for NFS delays

Uses tenacity with exponential backoff (1-30s) for up to 10 attempts.
Retries on 404 (adapter not found) and 500 (server error) which can
occur due to NFS propagation delays between trainer broadcast and
inference server load.

* Add unit tests for load_lora_adapter retry logic

* Fix tests: use asyncio.run instead of pytest.mark.asyncio

* Refactor tests to pytest function style (no classes)

* Fix: Adjust reward check thresholds and step in lora integration test

Co-authored-by: ongjackm <ongjackm@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ongjackm <ongjackm@gmail.com>
2026-01-01 01:09:32 -08:00
d85027f7f1 Revert "Inference readiness handshake (#1506)" (#1528)
This reverts commit 76cc87ec59.

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
2026-01-01 09:10:32 +01:00
e3dbf2ad86 feat: Add keep_interval to checkpointing config (#1521)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2025-12-31 16:00:46 +01:00
0bfb317c02 docs: add changelog entry for ckpt.keep_last and ckpt.keep_interval (#1522)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-12-31 15:51:17 +01:00
faresobeidandGitHub 1a5841b060 On policy distillation (#1458)
* on-policy-distill

* some more fixes

* some more fixes

* simplify loss

* fixes

* fix tests

* fix tests again

* fix changelog

* refactor

* use score rollouts

* fix ruff pls

* fix ruff and simplify temp

* fix ruff plssss

* Revert "fix ruff plssss"

This reverts commit ebe4fb1cfa33ab28643741cd4f904bf577728e9c.

* pls

* fixes

* fix kl loss

* fix tests

* fix

* fix

* remove reference model

* fix tests

* add logging and comments

* change logic

* setup teacher inference automatically

* fix

* cleanups and fixes

* fix

* fix changelog

* make so we can use an existing teacher inference server

* make teacher logprobs None when no teacher

* fixes

* fix

* fix

* fix

* add docs

---------

Signed-off-by: faresobeid <111092724+faresobeid@users.noreply.github.com>
2025-12-31 16:23:14 +02:00
Jackmin801andGitHub 895e7d6901 take out step in wandb monitor (#1516) 2025-12-31 10:22:18 +01:00
76cc87ec59 Inference readiness handshake (#1506)
* feat: Add NCCL broadcast support for weight updates

This commit introduces NCCL broadcast as a new method for updating weights. It includes modifications to the orchestrator, scheduler, and NCCL broadcast implementation to handle the synchronization required for NCCL communication. The `update_weights` utility function is updated to create a `NCCL_READY` marker file when NCCL broadcast is enabled, signaling to the trainer that inference workers are ready to receive weights.

Co-authored-by: sami <sami@primeintellect.ai>

* Refactor: Remove unused is_nccl_broadcast flag

Co-authored-by: sami <sami@primeintellect.ai>

* Remove NCCL ready marker cleanup from broadcast

Co-authored-by: sami <sami@primeintellect.ai>

* feat: Add timeout to sync_wait_for_path and wait_for_path

Co-authored-by: sami <sami@primeintellect.ai>

* Checkpoint before follow-up message

Co-authored-by: sami <sami@primeintellect.ai>

* remove to

* remove upus ty

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sami <sami@primeintellect.ai>
2025-12-31 09:46:27 +01:00
213 changed files with 17177 additions and 2188 deletions
-10
View File
@@ -1,10 +0,0 @@
<!-- Provide a brief description of the changes in this PR -->
I was too lazy to explain my changes, decreasing my chances of this ever getting merged.
---
<!-- Link the GitHub and Linear issue (if external, delete the Linear issue link) -->
**GitHub Issue**: [Issue ID]
**Linear Issue**: Resolves [Issue ID]
+252
View File
@@ -0,0 +1,252 @@
name: Trainer Benchmarks
on:
workflow_dispatch:
inputs:
set_baselines:
description: "Save results as new baselines"
required: false
default: false
type: boolean
image:
description: "Docker image to use for benchmarks"
required: true
type: string
jobs:
build-matrix:
name: Build benchmark matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- name: Build matrix
id: build
run: |
matrix='{"include":[
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xa6000","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":8192,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":8192,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-0.6B","runner":"1xh100","num_gpus":1,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xa6000","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"1xh100","num_gpus":1,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-4B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":null,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh100","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":2,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":4,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":8,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xh200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"Qwen/Qwen3-30B-A3B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"sft","lora_rank":null,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":30},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_3","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xh200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_3","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":60},
{"model":"PrimeIntellect/INTELLECT-3","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":65536,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":60},
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":1,"timeout_minutes":120},
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Offload","cp":1,"ep":1,"timeout_minutes":120},
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":2,"ep":1,"timeout_minutes":120},
{"model":"Qwen/Qwen3-235B-A22B-Instruct-2507","runner":"8xb200","num_gpus":8,"type":"rl","lora_rank":16,"seq_len":16384,"attention":"flash_attention_2","ac":"Recompute","cp":1,"ep":2,"timeout_minutes":120}
]}'
echo "matrix=$(echo "$matrix" | jq -c .)" >> "$GITHUB_OUTPUT"
get-image-digest:
name: Get image digest
runs-on: 1xa6000
outputs:
image_with_digest: ${{ steps.digest.outputs.image_with_digest }}
steps:
- name: Get image digest
id: digest
run: |
docker pull "${{ inputs.image }}"
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "${{ inputs.image }}")
echo "image_with_digest=${DIGEST}" >> "$GITHUB_OUTPUT"
run-benchmark:
name: "${{ matrix.model }} (${{ matrix.type }}${{ matrix.lora_rank && format(' r={0}', matrix.lora_rank) || '' }}) on ${{ matrix.runner }}"
needs: [build-matrix, get-image-digest]
runs-on: ${{ matrix.runner }}
container:
image: ${{ needs.get-image-digest.outputs.image_with_digest }}
options: --gpus all --shm-size=16g --user root --entrypoint bash -v huggingface_cache:/huggingface_cache
env:
HF_HOME: /huggingface_cache
PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
PRIME_DIST__TIMEOUT__SECONDS: 3600
defaults:
run:
working-directory: /app
timeout-minutes: ${{ matrix.timeout_minutes }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }}
steps:
- name: Clean HF cache locks and fix permissions
run: |
# Remove stale lock files from interrupted downloads
find /huggingface_cache -name "*.lock" -type f -delete 2>/dev/null || true
# Ensure cache directory exists and is writable
mkdir -p /huggingface_cache/hub
chmod -R u+rw /huggingface_cache 2>/dev/null || true
- name: Run benchmark
run: |
python benchmarks/scripts/run_single_benchmark.py \
--type "${{ matrix.type }}" \
--num-gpus "${{ matrix.num_gpus }}" \
--model-name "${{ matrix.model }}" \
${{ matrix.lora_rank && format('--lora-rank {0}', matrix.lora_rank) || '' }} \
--seq-len "${{ matrix.seq_len }}" \
--ac "${{ matrix.ac }}" \
--attention "${{ matrix.attention }}" \
--cp "${{ matrix.cp }}" \
--ep "${{ matrix.ep }}" \
--output "/tmp/benchmark_result.json" \
--docker-image "${{ needs.get-image-digest.outputs.image_with_digest }}" \
--timeout $(( (${{ matrix.timeout_minutes }} - 5) * 60 ))
- name: Set artifact name
id: artifact
run: echo "name=benchmark-${{ matrix.runner }}-$(echo '${{ matrix.model }}' | sed 's/\//--/')-${{ matrix.type }}-${{ matrix.lora_rank || 'full' }}-${{ matrix.num_gpus }}gpu-${{ matrix.ac }}-${{ matrix.attention }}-${{ matrix.seq_len }}-cp${{ matrix.cp }}-ep${{ matrix.ep }}" >> "$GITHUB_OUTPUT"
- name: Upload benchmark result
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ steps.artifact.outputs.name }}
path: /tmp/benchmark_result.json
retention-days: 30
aggregate-and-report:
name: Aggregate results and create PR
needs: run-benchmark
runs-on: ubuntu-latest
if: always()
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository # We can't use the image because then no git
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync
- name: Download all benchmark artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/benchmark_artifacts
pattern: benchmark-*
- name: Aggregate results
id: aggregate
run: |
mkdir -p benchmarks/baselines
uv run python benchmarks/scripts/aggregate_results.py \
--artifacts-dir "/tmp/benchmark_artifacts" \
--baselines-dir "benchmarks/baselines" \
--output-markdown "benchmarks/results/BENCHMARKS.md" \
--regression-threshold 0.05
if [ -f /tmp/prime-rl-benchmark-aggregate-has-regressions ]; then
echo "has_regressions=true" >> "$GITHUB_OUTPUT"
else
echo "has_regressions=false" >> "$GITHUB_OUTPUT"
fi
- name: Set baselines from artifacts
if: ${{ github.event.inputs.set_baselines == 'true' }}
run: |
rm -f benchmarks/baselines/*.json
for dir in /tmp/benchmark_artifacts/*/; do
name=$(basename "$dir")
cp "$dir/benchmark_result.json" "benchmarks/baselines/${name}.json"
done
- name: Set benchmark metadata (date + unique branch)
run: |
BENCHMARK_DATE="$(date +%Y-%m-%d)"
echo "BENCHMARK_DATE=${BENCHMARK_DATE}" >> "$GITHUB_ENV"
echo "BENCHMARK_BRANCH=benchmark-results-${BENCHMARK_DATE}-${{ github.run_id }}" >> "$GITHUB_ENV"
- name: Create PR branch and commit
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BENCHMARK_BRANCH"
git add benchmarks/results/BENCHMARKS.md
${{ github.event.inputs.set_baselines == 'true' && 'git add benchmarks/baselines/' || 'true' }}
git commit -m "Update benchmark results $(date +%Y-%m-%d)" || echo "No changes to commit"
git push origin "$BENCHMARK_BRANCH" --force
- name: Create Pull Request
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ steps.aggregate.outputs.has_regressions }}" = "true" ]; then
WARNING="> :warning: **Performance regressions detected!** Please review the results carefully."
else
WARNING="> :white_check_mark: No regressions detected."
fi
PR_BODY_FILE="/tmp/benchmark_pr_body.md"
cat > "${PR_BODY_FILE}" <<EOF
## Nightly Benchmark Results
**Run ID:** ${{ github.run_id }}
**Date:** ${BENCHMARK_DATE}
**Regression Detected:** ${{ steps.aggregate.outputs.has_regressions }}
${WARNING}
---
## Results (\`benchmarks/results/BENCHMARKS.md\`)
EOF
cat benchmarks/results/BENCHMARKS.md >> "${PR_BODY_FILE}"
cat >> "${PR_BODY_FILE}" <<'EOF'
---
*This PR was automatically generated by the nightly benchmark workflow.*
EOF
gh pr create \
--base main \
--head "$BENCHMARK_BRANCH" \
--title "[Benchmarks] Nightly performance results - ${BENCHMARK_DATE}" \
--body-file "${PR_BODY_FILE}" \
|| echo "PR already exists"
+8 -2
View File
@@ -53,7 +53,7 @@ jobs:
integration-tests:
name: Integration tests (${{ matrix.test }})
runs-on: vm
runs-on: ${{ matrix.runner }}
container:
image: pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
options: --gpus all
@@ -64,11 +64,17 @@ jobs:
matrix:
include:
- test: base
pytest_args: "tests/integration -m gpu --ignore=tests/integration/test_rl_lora.py --ignore=tests/integration/test_rl_multi_run_lora.py"
runner: vm
pytest_args: "tests/integration -m gpu --ignore=tests/integration/test_rl_lora.py --ignore=tests/integration/test_rl_multi_run_lora.py --ignore=tests/integration/test_benchmark_regression.py"
- test: rl_lora
runner: vm
pytest_args: "tests/integration/test_rl_lora.py -m gpu"
- test: rl_multi_run
runner: 4xa6000
pytest_args: "tests/integration/test_rl_multi_run_lora.py -m gpu"
- test: benchmark_regression
runner: 4xa6000
pytest_args: "tests/integration/test_benchmark_regression.py -m gpu"
steps:
- name: Install Git
run: |
+8
View File
@@ -20,3 +20,11 @@ jobs:
submodules: true
- name: Run ruff
uses: astral-sh/ruff-action@v3
with:
version: "0.13.0"
args: "check --config=pyproject.toml"
- name: Run ruff format (check)
uses: astral-sh/ruff-action@v3
with:
version: "0.13.0"
args: "format --check --config=pyproject.toml"
+2 -2
View File
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.3
rev: v0.13.0
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
args: [ --fix, --config=pyproject.toml ]
# Run the formatter.
- id: ruff-format
+53
View File
@@ -0,0 +1,53 @@
# AGENTS.md
## Code Guidelines
- Avoid try/except blocks unless it's really necessary. It's fine that a program fails if something goes wrong as this helps us to catch non-obvious bugs and unforeseen side-effects earlier. You can add try catch on code that explicitly aims to be fault tolerant like adding retry mechanisms or explicit and intentional robustness.
- Do not add unnecessary comments. Especially do not try to explain code change that reflect your work process, do not refer to old code. "The code used to do that but now we are doing this" is not a pattern we want. Instead prefer to use targeted comments sparingly to explain ambiguous code.
## Zen of Python
remember the zen of python when writing code.
```
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
```
## Running code
- All code should be runnable with `uv run` or `uv run <command>`.
- All dependencies should already be installed and pin in the lock file. If not, add it to pyproject.toml and run `uv sync --all-extras` to install it.
## CLI Usage
- Config files use `@` syntax: `uv run sft @ path/to/config.toml`
- For multi-GPU with torchrun: `uv run torchrun --nproc-per-node 2 src/prime_rl/trainer/sft/train.py @ path/to/config.toml`
- Boolean flags don't need `true`: use `--model.optim_cpu_offload` not `--model.optim_cpu_offload true`, use `--no-model.optim_cpu_offload` to pass False.
- Override config values with CLI flags: `--model.name Qwen/Qwen3-0.6B --training.max_steps 100`
## Testing
Write tests as plain functions with pytest fixtures. Don't use class-based tests.
## Git
Branch prefixes: `feature/`, `fix/`, `chore/`
+29
View File
@@ -8,14 +8,43 @@ Documenting changes which affect configuration usage patterns (added/moved/remov
- **`orchestrator.env_mix`**: Deprecated in favor of `orchestrator.buffer.env_ratios` (#1450, 2025-12-18)
- **`orchestrator.buffer.hash_keys`**: Added hash keys configuration for buffer checkpointing (#1450, 2025-12-18)
- **`orchestrator.buffer.env_ratios`**: Added environment ratio configuration for buffer sampling (#1450, 2025-12-18)
- **`orchestrator.buffer.skip_verification`**: Added configuration to skip verification of rollouts using the environment's rubric. If True, rewards are always set to 0. Cannot be used with `online_difficulty_filtering=True` or when `easy_threshold`/`hard_threshold` are set (default: False)
- **`orchestrator.ckpt.buffer_path`**: Deprecated (#1450, 2025-12-18)
- **`orchestrator.buffer.easy_fraction`** and **`orchestrator.buffer.hard_fraction`**: Easy and hard fraction now defines the fraction of easy and hard problems to convert to normal when resuming, whereas previously it was the ratio of easy/ hard samples to sample per step (#1450, 2025-12-18)
- **`orchestrator.teacher_model`**: Added teacher model configuration for computing teacher logprobs (e.g. for distillation). Supports `TeacherModelConfig` (custom model) or `None` (disabled). Renamed from `reference_model` (2025-12-20)
- **`seq_len`**: Added root-level `seq_len` config that sets both `trainer.model.seq_len` and `orchestrator.seq_len`. Added validation that `trainer.model.seq_len >= orchestrator.seq_len` (2025-12-18)
- **`trainer.loss.sequence_mask_ratio_low`** and **`trainer.loss.sequence_mask_ratio_high`**: Renamed to `trainer.loss.sequence_mask_low` and `trainer.loss.sequence_mask_high` (2025-12-19)
- **`trainer.loss.token_mask_high`** and **`trainer.loss.token_mask_low`**: Added token-level importance ratio masking thresholds (2025-12-19)
- **`trainer.loss.sequence_clip_high`**: Added sequence-level importance ratio clipping threshold (2025-12-19)
- **`trainer.loss.geo_mask_high`** and **`trainer.loss.geo_mask_low`**: Added geometric importance ratio masking thresholds (2025-12-19)
- **`trainer.loss.adv_tau`**: Added tau parameter for advantages (default: 1.0)
- **`trainer.loss.teacher_tau`**: Added tau parameter for teacher logprobs (default: 0.0). Renamed from `ref_tau`
- **`teacher_gpu_ids`**: Added GPU IDs for teacher inference server. When set, automatically starts a teacher inference server and configures `orchestrator.teacher_model`
- **`teacher_inference`**: Added optional teacher inference config. Defaults to copying from `inference` config with port 8001
- **`{orchestrator,trainer}.transport.zmq`**: Added ZMQ transport for training batches and micro batches (#1446, 2025-12-22)
- **`model.impl`**: Changed default from `hf` to `auto`. With `auto`, the implementation automatically selects `custom` if supported for the model, otherwise falls back to `hf` (#1488, 2025-12-27)
- **`orchestrator.eval.skip_eval_on_resume`**: Added flag (default `True`) to skip the first potentially redundant online eval immediately after resuming from a checkpoint (#1491, 2025-12-27)
- **`trainer.weight_broadcast.adapter_only`**: Removed. Adapter-only behavior is now automatically derived from the presence of LoRA configuration (2025-12-27)
- **`ckpt.keep`**: Renamed to `ckpt.keep_last`. Added `ckpt.keep_interval` to keep checkpoints at every N steps permanently (2025-12-31)
- **`MultiLoRAMoE`**: QwenMoE now supports training expert loras and this is enabled by default in the `target_modules`. (2026-01-01)
- **`model.fused_lm_head_chunk_size`**: Added chunk size configuration for fused LM head to enable memory-efficient chunked logprob computation. When set, splits vocabulary into chunks to avoid materializing full [N, V] logit tensor (default: None) (#1525, 2026-01-03)
- **`model.fused_lm_head_chunk_size`**: RL training now auto-sets this to 2048 if not specified (except when `impl='liger_kernel'`). SFT training continues to use None (2026-01-05)
- **`trainer.metrics_server`**: Added optional Prometheus metrics server for trainer observability. Exposes `/metrics` endpoint with step, loss, throughput, grad_norm, etc. Disabled by default (default: None) (#1547, 2026-01-06)
- **`model.lora.alpha`**: Changed default from 16.0 to 32.0 (2026-01-10)
- **`orchestrator.env.log`**: Added logging configuration for environment workers. If set, enables logging with `level` (str, default: "warn") and `vf_level` (str, default: "warn") fields. If None (default), logging is disabled (#1561, 2026-01-13)
- **`eval.watcher`**: Added flag (default `False`) to watch `weights_dir` for newly-created stable checkpoints and evaluate them as they appear (2026-01-14)
- **`orchestrator.log.env_worker_logs`**: Added flag (default `False`) to write env worker logs to `logs/env_workers/{env_name}.log` (2026-01-15)
- **`orchestrator.env.log`**: Removed. Use `orchestrator.log` for env worker logging instead (2026-01-15)
- **`orchestrator.eval.retry.reraise`**: Changed default from `True` to `False`. When `False`, raises `tenacity.RetryError` after retries are exhausted instead of the original exception, allowing failed eval environments to be skipped with a warning (#1586, 2026-01-14)
- **`model.ep`**: Expert parallelism now supported (with auto/custom impl only), changed from the old behaviour when `ep>1` was a no-op to a proper parallelization of the MoE layers. (#1595, 2026-01-15)
- **`orchestrator.reload_weights_on_start`**: Added flag to control resetting inference weights to the base model when starting from scratch (default: True) (2026-01-21)
- **`orchestrator.client.elastic`**: Added elastic inference pool with DNS-based service discovery. Supports dynamic server scaling via any DNS hostname with multiple A records (Kubernetes headless services, Consul, Route53, etc.). Automatically syncs LoRA adapters on new servers and only exposes ready servers to workers (#1617, 2026-01-19)
- **`model.fused_lm_head_chunk_size`**: Replaced chunk size `int | None` setting with `int | Literal["auto", "disabled"]` setting. `auto` auto-sets to 2048 if possible. `disabled` explicitly disables chunked loss (use vanilla LM head). Default behaviour is to use `auto` for RL training and `disabled` for SFT training. (not changed from previous version) (#1649, 2026-01-23)
- **`client.skip_model_check`**: Added configuration to skip checking if the model is available in the inference pool. Useful for external APIs or API keys that don't support the /models endpoint (default: False) (#1543, 2026-01-06)
- **`orchestrator.sampling.temp_scheduler`**: Added optional temperature schedule configuration with linear and cosine schedules. Set either `sampling.temperature` (constant) or `sampling.temp_scheduler` (schedule), not both. Default remains 1.0 if neither is set. (2026-01-27)
- **`model.impl`**: Removed `liger_kernel` model implementation from supported options. The Liger kernel dependency remains for SFT loss. (2026-01-30)
- **`log.json_logging`**: Added JSON structured logging option for log aggregation systems (Loki, Grafana, etc.). Outputs flat newline-delimited JSON with `timestamp`, `level`, `message`, `module`, `function`, `line` fields. Available on root `log`, `trainer.log`, and `orchestrator.log` (default: False) (2026-01-28)
- **`model.optim_cpu_offload`**: Added flag to offload optimizer states to CPU without moving parameters (default: False) (2026-01-31)
- **`orchestrator.tasks_per_minute`**: Added optional rate limiting for sandbox tasks per environment worker. Uses token bucket algorithm. If None (default), no rate limiting is applied (2026-02-02)
- **`model.cp`**: When `cp>1` with `attn="flash_attention_3"`, require `model.impl="custom"` (FA3 ring-attention kernel only in custom path) (2026-02-06)
- **`model.attn`**: Added `fa4` as an attention implementation option. Flash attention 4 is only supported with the custom implementation (#1726, 2026-02-06)
+1
View File
@@ -0,0 +1 @@
@AGENTS.md
+7
View File
@@ -40,6 +40,7 @@ COPY README.md /app/README.md
COPY src/ /app/src/
COPY configs /app/configs
COPY examples /app/examples
COPY benchmarks/scripts /app/benchmarks/scripts
RUN --mount=type=cache,target=/app/.cache/uv \
uv sync --all-extras --locked --no-dev
@@ -62,6 +63,8 @@ RUN apt-get update && apt-get install -y \
net-tools \
curl \
vim \
libibverbs1 \
ibverbs-providers \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -94,6 +97,10 @@ RUN rm /app/.venv/bin/python3.12 && ln -s /usr/local/bin/python /app/.venv/bin/p
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"
# HuggingFace Hub timeouts (defaults are 10s which causes issues on slow networks)
ENV HF_HUB_ETAG_TIMEOUT=500
ENV HF_HUB_DOWNLOAD_TIMEOUT=300
# Use entrypoint for setup (ulimit, etc) but default to sleep infinity for K8s
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["sleep", "infinity"]
+1 -1
View File
@@ -34,7 +34,7 @@ PRIME-RL is a framework for large-scale asynchronous reinforcement learning. It
1. Integrates natively with [`verifiers`](https://github.com/PrimeIntellect-ai/verifiers) environments via the [Environments Hub](https://app.primeintellect.ai/dashboard/environments?ex_sort=most_stars)
2. Supports end-to-end post-training, including SFT and RL training and evals
3. Multi-node deployment with [FSDP2](https://docs.pytorch.org/tutorials/intermediate/FSDP_tutorial.html) training and [vLLM](https://github.com/vllm-project/vllm) inference backend
4. Designed for asynchronous training in decentralized settings
4. Designed for asynchronous agentic RL training at scale
5. Hackable, modular and extensible by nature
## Setup
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:07:14.032743+00:00",
"success": true,
"error_reason": null,
"time_taken": 110.89856401001452
},
"metrics": {
"mfu": {
"mean": 6.25326518008405,
"std": 1.1088767048821218,
"min": 5.042813758258495,
"max": 7.220033506991957
},
"throughput": {
"mean": 2414.13793444897,
"std": 428.09336255378895,
"min": 1946.8305980283696,
"max": 2787.3688825375607
},
"step_time": {
"mean": 9.231287551335603,
"std": 0.08240427237252125,
"min": 9.138645098020788,
"max": 9.296410266979365
},
"peak_memory": {
"gib": 5.087890625,
"pct": 10.733540123945605
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:09:42.402759+00:00",
"success": true,
"error_reason": null,
"time_taken": 323.0761482360249
},
"metrics": {
"mfu": {
"mean": 15.980779848317193,
"std": 0.016794587683451167,
"min": 15.96452617710017,
"max": 15.9980675684045
},
"throughput": {
"mean": 1994.95423828766,
"std": 2.096545612755065,
"min": 1992.9252177648882,
"max": 1997.1123438861257
},
"step_time": {
"mean": 65.7679032223338,
"std": 0.13193422188415097,
"min": 65.63013747497462,
"max": 65.89310738901258
},
"peak_memory": {
"gib": 11.453125,
"pct": 24.161796271330914
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:20:58.816045+00:00",
"success": true,
"error_reason": null,
"time_taken": 69.12897840799997
},
"metrics": {
"mfu": {
"mean": 10.888337274160449,
"std": 0.1146035522747722,
"min": 10.756101312551046,
"max": 10.958838408729708
},
"throughput": {
"mean": 3687.3357954776216,
"std": 38.810496952046634,
"min": 3642.5540824929494,
"max": 3711.211007144323
},
"step_time": {
"mean": 7.457733287660328,
"std": 0.06480044847570422,
"min": 7.398152031993959,
"max": 7.526724088995252
},
"peak_memory": {
"gib": 12.469401041666666,
"pct": 26.30575738885863
}
}
}
@@ -0,0 +1,48 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"ep": 1,
"cp": 1,
"docker_image": null,
"device_name": "NVIDIA RTX A6000",
"commit_sha": "1c813485",
"timestamp": "2026-02-01T00:37:17.504432+00:00",
"success": true,
"error_reason": null,
"time_taken": 276.12556480802596
},
"metrics": {
"mfu": {
"mean": 17.08174826544651,
"std": 0.00860887294908562,
"min": 17.07595532741123,
"max": 17.091640740120457
},
"throughput": {
"mean": 2040.0423352992304,
"std": 1.0281421434405753,
"min": 2039.3504951752516,
"max": 2041.2237756777045
},
"step_time": {
"mean": 63.29752009687945,
"std": 0.1304965028229097,
"min": 63.170207182411104,
"max": 63.430982740130275
},
"peak_memory": {
"gib": 19.50390625,
"pct": 41.029855115635286
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 8192,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:15:16.344492+00:00",
"success": true,
"error_reason": null,
"time_taken": 37.26451032201294
},
"metrics": {
"mfu": {
"mean": 13.534357307187642,
"std": 0.11591312542586621,
"min": 13.432546913664385,
"max": 13.660507673056479
},
"throughput": {
"mean": 6603.696328150197,
"std": 56.55644101790505,
"min": 6554.020905326831,
"max": 6665.2477331393675
},
"step_time": {
"mean": 2.458166876322745,
"std": 0.01111478049147262,
"min": 2.4491563979827333,
"max": 2.4705870889883954
},
"peak_memory": {
"gib": 31.21484375,
"pct": 65.85160777769623
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:03:16.754400+00:00",
"success": true,
"error_reason": null,
"time_taken": 189.08276393299457
},
"metrics": {
"mfu": {
"mean": 13.593108190460633,
"std": 0.6113375543806666,
"min": 12.9129464707711,
"max": 14.096800271491071
},
"throughput": {
"mean": 1232.6245823189486,
"std": 55.4361583139007,
"min": 1170.947440940054,
"max": 1278.299436980461
},
"step_time": {
"mean": 24.43446325266268,
"std": 0.05958367621622373,
"min": 24.387022126989905,
"max": 24.501337252993835
},
"peak_memory": {
"gib": 23.302734375,
"pct": 49.160025803760085
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:45:06.153019+00:00",
"success": true,
"error_reason": null,
"time_taken": 101.25457232699955
},
"metrics": {
"mfu": {
"mean": 24.720617400371953,
"std": 0.0059618599726984295,
"min": 24.716927952372927,
"max": 24.727495488498064
},
"throughput": {
"mean": 9782.187433962441,
"std": 2.359165661739719,
"min": 9780.727483700286,
"max": 9784.909159967388
},
"step_time": {
"mean": 13.400609701333451,
"std": 0.011325855757257303,
"min": 13.389435630000662,
"max": 13.412081471999954
},
"peak_memory": {
"gib": 7.91796875,
"pct": 10.000107919270219
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:47:00.758560+00:00",
"success": true,
"error_reason": null,
"time_taken": 54.114448966000054
},
"metrics": {
"mfu": {
"mean": 10.902290160145071,
"std": 0.011717783508844587,
"min": 10.889823370330753,
"max": 10.91307776345264
},
"throughput": {
"mean": 13341.807441650146,
"std": 14.33977714053646,
"min": 13326.551059121803,
"max": 13355.008899689909
},
"step_time": {
"mean": 2.4532590479999876,
"std": 0.004686582604909462,
"min": 2.449214012000084,
"max": 2.4583948149993375
},
"peak_memory": {
"gib": 5.146484375,
"pct": 6.499823474907999
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:29:24.218730+00:00",
"success": true,
"error_reason": null,
"time_taken": 97.12500511000053
},
"metrics": {
"mfu": {
"mean": 25.186637106124792,
"std": 0.01564156074320041,
"min": 25.176655080716063,
"max": 25.20466375456501
},
"throughput": {
"mean": 9966.595939452507,
"std": 6.189516890762853,
"min": 9962.645955439677,
"max": 9973.729258616522
},
"step_time": {
"mean": 13.155961893666548,
"std": 0.013725280074692658,
"min": 13.141330864999873,
"max": 13.168553112999689
},
"peak_memory": {
"gib": 11.453125,
"pct": 14.464882298618786
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:35:09.475885+00:00",
"success": true,
"error_reason": null,
"time_taken": 72.44658932200036
},
"metrics": {
"mfu": {
"mean": 26.354162261984143,
"std": 0.2016890980989746,
"min": 26.126549197344954,
"max": 26.510662024401086
},
"throughput": {
"mean": 9976.949543004863,
"std": 76.35385769823057,
"min": 9890.78159584497,
"max": 10036.195980725191
},
"step_time": {
"mean": 12.462525163000464,
"std": 0.012756092294355367,
"min": 12.452715442000226,
"max": 12.476945533000617
},
"peak_memory": {
"gib": 16.083984375,
"pct": 20.31349006294777
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:31:15.062827+00:00",
"success": true,
"error_reason": null,
"time_taken": 28.47874303699973
},
"metrics": {
"mfu": {
"mean": 11.081739629278019,
"std": 0.19889239779611573,
"min": 10.855698631694322,
"max": 11.229935211006715
},
"throughput": {
"mean": 11895.994753646642,
"std": 213.50645294640813,
"min": 11653.344897999395,
"max": 12055.079330773913
},
"step_time": {
"mean": 1.9923289040001084,
"std": 0.00613332391088384,
"min": 1.9878587729999708,
"max": 1.9993211860000883
},
"peak_memory": {
"gib": 12.527994791666666,
"pct": 15.822403937717219
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:27:13.470591+00:00",
"success": true,
"error_reason": null,
"time_taken": 85.34243606500058
},
"metrics": {
"mfu": {
"mean": 26.804595710779356,
"std": 0.06729310221031364,
"min": 26.729508818984065,
"max": 26.85945477435236
},
"throughput": {
"mean": 10147.471062392868,
"std": 25.47528844477991,
"min": 10119.045262956117,
"max": 10168.239171194939
},
"step_time": {
"mean": 12.175553453000248,
"std": 0.01538792877423435,
"min": 12.158267948000685,
"max": 12.187759467999967
},
"peak_memory": {
"gib": 19.560546875,
"pct": 24.704262657003266
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:32:30.606234+00:00",
"success": true,
"error_reason": null,
"time_taken": 23.356497423999826
},
"metrics": {
"mfu": {
"mean": 23.741677026845252,
"std": 0.04651049464446475,
"min": 23.70207542828724,
"max": 23.792894559815245
},
"throughput": {
"mean": 25486.148818001486,
"std": 49.92795524795279,
"min": 25443.637405132922,
"max": 25541.12967153968
},
"step_time": {
"mean": 1.2819336799996865,
"std": 0.0006079202348362681,
"min": 1.2813300379993962,
"max": 1.2825457899998582
},
"peak_memory": {
"gib": 52.83984375,
"pct": 66.7348099772907
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:28:52.686902+00:00",
"success": false,
"error_reason": "[rank0]: torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 37.09 GiB. GPU 0 has a total capacity of 79.18 GiB of which 34.48 GiB is free. Including non-PyTorch memory, this process has 44.69 GiB memory in use. Of the allocated memory 43.38 GiB is allocated by PyTorch, and 103.94 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)",
"time_taken": 17.978304365999975
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 8192,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:31:56.529860+00:00",
"success": true,
"error_reason": null,
"time_taken": 20.62643332300013
},
"metrics": {
"mfu": {
"mean": 16.81390538290134,
"std": 0.05651510665525934,
"min": 16.751081970567313,
"max": 16.860609944501103
},
"throughput": {
"mean": 26005.173345163068,
"std": 87.40891016818526,
"min": 25908.007714057374,
"max": 26077.408806987827
},
"step_time": {
"mean": 0.6225078416667505,
"std": 0.007687299084230651,
"min": 0.617841731000226,
"max": 0.6313804020001044
},
"peak_memory": {
"gib": 31.7421875,
"pct": 40.089233819432565
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:33:07.297136+00:00",
"success": true,
"error_reason": null,
"time_taken": 108.76686536699981
},
"metrics": {
"mfu": {
"mean": 20.708341728583434,
"std": 0.004926960367148572,
"min": 20.702702202532606,
"max": 20.711810912813448
},
"throughput": {
"mean": 5952.495445170788,
"std": 1.4162268291871345,
"min": 5950.874395374987,
"max": 5953.492642512722
},
"step_time": {
"mean": 5.503622571999888,
"std": 0.0020800783397258095,
"min": 5.501920187999531,
"max": 5.505941123000412
},
"peak_memory": {
"gib": 20.568359375,
"pct": 25.977093364044073
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:41:29.404702+00:00",
"success": true,
"error_reason": null,
"time_taken": 203.20685914300066
},
"metrics": {
"mfu": {
"mean": 36.28241994221462,
"std": 0.022193678051459942,
"min": 36.26066970131873,
"max": 36.3050319536981
},
"throughput": {
"mean": 4042.514189268571,
"std": 2.4727749300619926,
"min": 4040.0908212136933,
"max": 4045.0335740674755
},
"step_time": {
"mean": 32.442406444666936,
"std": 0.03856478525322434,
"min": 32.40275257099984,
"max": 32.47978104200047
},
"peak_memory": {
"gib": 31.056640625,
"pct": 39.22341293150364
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:36:35.591532+00:00",
"success": true,
"error_reason": null,
"time_taken": 80.70320002000062
},
"metrics": {
"mfu": {
"mean": 21.67106712168685,
"std": 0.0011546935789889254,
"min": 21.66976201051341,
"max": 21.671955962863645
},
"throughput": {
"mean": 6229.22540223386,
"std": 0.3319101239291823,
"min": 6228.850255425044,
"max": 6229.480894591757
},
"step_time": {
"mean": 5.260317135999685,
"std": 0.0009800976196505141,
"min": 5.25973307699951,
"max": 5.261448657999608
},
"peak_memory": {
"gib": 23.302734375,
"pct": 29.430510011054018
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 1,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:38:09.656407+00:00",
"success": true,
"error_reason": null,
"time_taken": 186.07668963200013
},
"metrics": {
"mfu": {
"mean": 37.373497733547545,
"std": 0.030793764694046207,
"min": 37.350622380323436,
"max": 37.40851070666222
},
"throughput": {
"mean": 4164.079880313542,
"std": 3.430979270813021,
"min": 4161.531154508035,
"max": 4167.980955292829
},
"step_time": {
"mean": 31.492112124332987,
"std": 0.048781656532353834,
"min": 31.43624878099945,
"max": 31.526298007999685
},
"peak_memory": {
"gib": 41.994140625,
"pct": 53.037079519543404
}
}
}
@@ -0,0 +1,48 @@
{
"config": {
"type": "rl",
"num_gpus": 4,
"model_name": "Qwen/Qwen3-0.6B",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"ep": 1,
"cp": 1,
"docker_image": "primeintellect/prime-rl@sha256:d3e9636af265f5ba2e56cd2555534489f5ff64e04a3f645059ca7989508de419",
"device_name": "NVIDIA RTX A6000",
"commit_sha": "5c3c5123",
"timestamp": "2026-01-31T01:13:40.536972+00:00",
"success": true,
"error_reason": null,
"time_taken": 291.91085167229176
},
"metrics": {
"mfu": {
"mean": 16.165875888064594,
"std": 0.010063094728313886,
"min": 16.154265967508614,
"max": 16.172097002189034
},
"throughput": {
"mean": 7722.645407567771,
"std": 4.80726889329249,
"min": 7717.099200218126,
"max": 7725.61731325081
},
"step_time": {
"mean": 66.21160964062437,
"std": 0.11667723461510121,
"min": 66.1170196281746,
"max": 66.34198968904093
},
"peak_memory": {
"gib": 12.35546875,
"pct": 25.99187497111044
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:26:32.539787+00:00",
"success": true,
"error_reason": null,
"time_taken": 1020.7996206080006
},
"metrics": {
"mfu": {
"mean": 5.687602748221284,
"std": 0.018745865227927518,
"min": 5.676304894379825,
"max": 5.709241557476678
},
"throughput": {
"mean": 5036.226163028962,
"std": 16.598982223051312,
"min": 5026.222203606826,
"max": 5055.386772890979
},
"step_time": {
"mean": 207.41716993466676,
"std": 2.02401520618876,
"min": 205.080392803,
"max": 208.62080098299975
},
"peak_memory": {
"gib": 131.494140625,
"pct": 73.72330763876674
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:12:47.559188+00:00",
"success": true,
"error_reason": null,
"time_taken": 809.163406182
},
"metrics": {
"mfu": {
"mean": 2.490786315088448,
"std": 0.033110540270011306,
"min": 2.4542463835991133,
"max": 2.5187996340566254
},
"throughput": {
"mean": 4775.430825821454,
"std": 63.48079468206003,
"min": 4705.375071078247,
"max": 4829.139032793618
},
"step_time": {
"mean": 54.28342847499971,
"std": 1.2435951181078917,
"min": 53.43692385699978,
"max": 55.71122110999977
},
"peak_memory": {
"gib": 90.44466145833333,
"pct": 50.70856822428712
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:15:30.364274+00:00",
"success": true,
"error_reason": null,
"time_taken": 984.287366173
},
"metrics": {
"mfu": {
"mean": 5.827906818358083,
"std": 0.022833943391300654,
"min": 5.807295619326128,
"max": 5.8524522502693515
},
"throughput": {
"mean": 5160.461813808787,
"std": 20.21887044561124,
"min": 5142.211126408267,
"max": 5182.196163383928
},
"step_time": {
"mean": 202.34163654333315,
"std": 1.810525756526242,
"min": 200.36271737700008,
"max": 203.91497343799983
},
"peak_memory": {
"gib": 153.607421875,
"pct": 86.12130673399314
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Offload",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 6900,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:59:19.508644+00:00",
"success": true,
"error_reason": null,
"time_taken": 549.3317680299988
},
"metrics": {
"mfu": {
"mean": 4.168587169086432,
"std": 0.01943333057040498,
"min": 4.148011530875203,
"max": 4.186629771954931
},
"throughput": {
"mean": 4127.532530653436,
"std": 19.241939979838868,
"min": 4107.159533133892,
"max": 4145.397439615796
},
"step_time": {
"mean": 63.236984533667055,
"std": 0.5393767880164467,
"min": 62.76671389400144,
"max": 63.82576015599989
},
"peak_memory": {
"gib": 150.33528645833334,
"pct": 84.28675619955848
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 6900,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:55:26.218741+00:00",
"success": false,
"error_reason": "[rank4]: torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 8.00 GiB. GPU 4 has a total capacity of 178.36 GiB of which 7.20 GiB is free. Including non-PyTorch memory, this process has 171.05 GiB memory in use. Of the allocated memory 168.36 GiB is allocated by PyTorch, and 418.92 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)",
"time_taken": 1187.6552004240002
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 6900,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:37:50.660932+00:00",
"success": true,
"error_reason": null,
"time_taken": 537.6964168579998
},
"metrics": {
"mfu": {
"mean": 4.1765827538888205,
"std": 0.051049197538156864,
"min": 4.120994785084703,
"max": 4.221362139742245
},
"throughput": {
"mean": 4135.449370348717,
"std": 50.54643574807943,
"min": 4080.408863758512,
"max": 4179.787743115238
},
"step_time": {
"mean": 62.716718792332664,
"std": 1.346972230949721,
"min": 61.699117662999925,
"max": 64.24419503999889
},
"peak_memory": {
"gib": 161.52018229166666,
"pct": 90.55766311989025
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-235B-A22B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 6900,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-16T00:08:44.717309+00:00",
"success": false,
"error_reason": "Non-zero exit code: 1",
"time_taken": 3980.190812207
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:32:10.654918+00:00",
"success": true,
"error_reason": null,
"time_taken": 244.50675971500004
},
"metrics": {
"mfu": {
"mean": 1.8819492849425725,
"std": 0.018657004256960857,
"min": 1.8647429725679725,
"max": 1.9017792358057817
},
"throughput": {
"mean": 9266.367565195435,
"std": 91.86361210349598,
"min": 9181.646889574527,
"max": 9364.006547801635
},
"step_time": {
"mean": 28.328965114333794,
"std": 0.6755728629253066,
"min": 27.88586488400142,
"max": 29.106523622000168
},
"peak_memory": {
"gib": 32.041666666666664,
"pct": 17.96443277014256
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:51:34.679404+00:00",
"success": true,
"error_reason": null,
"time_taken": 449.1452536000015
},
"metrics": {
"mfu": {
"mean": 6.946321930899347,
"std": 0.04943793567535021,
"min": 6.907147510672552,
"max": 7.001869300686485
},
"throughput": {
"mean": 13225.618902255133,
"std": 94.1285622896153,
"min": 13151.031810296197,
"max": 13331.379670491255
},
"step_time": {
"mean": 79.47065850533363,
"std": 1.170419801192356,
"min": 78.65436104000037,
"max": 80.81161287000032
},
"peak_memory": {
"gib": 64.82161458333333,
"pct": 36.34278919847233
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:36:31.593391+00:00",
"success": false,
"error_reason": "Non-zero exit code: 1",
"time_taken": 63.58203920199958
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:43:48.864376+00:00",
"success": false,
"error_reason": "Non-zero exit code: 1",
"time_taken": 210.35651835000044
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:54:09.465200+00:00",
"success": false,
"error_reason": "Non-zero exit code: 1",
"time_taken": 60.86861479300023
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:10:45.595226+00:00",
"success": true,
"error_reason": null,
"time_taken": 106.1217524460003
},
"metrics": {
"mfu": {
"mean": 8.808826116109998,
"std": 0.004229053216833396,
"min": 8.80401218210114,
"max": 8.811943308874014
},
"throughput": {
"mean": 46083.769889207404,
"std": 22.1244820507199,
"min": 46058.58557699578,
"max": 46100.0776233077
},
"step_time": {
"mean": 5.686930948999968,
"std": 0.005284924202613482,
"min": 5.680966203000025,
"max": 5.691029913999955
},
"peak_memory": {
"gib": 10.216796875,
"pct": 5.728134010521928
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:47:04.725977+00:00",
"success": true,
"error_reason": null,
"time_taken": 254.2014976369992
},
"metrics": {
"mfu": {
"mean": 12.348302496931252,
"std": 0.006805052347726637,
"min": 12.34074166489301,
"max": 12.353936045871244
},
"throughput": {
"mean": 25040.256927943043,
"std": 13.799488572419822,
"min": 25024.924846721864,
"max": 25051.680806885804
},
"step_time": {
"mean": 41.85612941899914,
"std": 0.03884213222620387,
"min": 41.831036413999755,
"max": 41.90087012999902
},
"peak_memory": {
"gib": 28.810546875,
"pct": 16.152877994496077
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:52:34.912968+00:00",
"success": true,
"error_reason": null,
"time_taken": 77.61734246100059
},
"metrics": {
"mfu": {
"mean": 6.465139069561914,
"std": 0.04130725425852038,
"min": 6.418776595758626,
"max": 6.498024945638078
},
"throughput": {
"mean": 27541.81564064197,
"std": 175.970968167648,
"min": 27344.3091844938,
"max": 27681.911116752446
},
"step_time": {
"mean": 4.634802302666685,
"std": 0.08513574433508829,
"min": 4.565404164000029,
"max": 4.72980078099954
},
"peak_memory": {
"gib": 17.037109375,
"pct": 9.552000186156143
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:09:40.928786+00:00",
"success": false,
"error_reason": "Non-zero exit code: 1",
"time_taken": 45.902424454000084
},
"metrics": {
"mfu": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"throughput": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"step_time": {
"mean": 0,
"std": 0,
"min": 0,
"max": 0
},
"peak_memory": {
"gib": 0,
"pct": 0
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:51:22.159961+00:00",
"success": true,
"error_reason": null,
"time_taken": 55.56085521700061
},
"metrics": {
"mfu": {
"mean": 16.045704463732047,
"std": 0.3669414038018912,
"min": 15.635441903073977,
"max": 16.34253889185774
},
"throughput": {
"mean": 68355.50317006244,
"std": 1563.188724278261,
"min": 66607.76415187177,
"max": 69620.03267318218
},
"step_time": {
"mean": 3.743108587333154,
"std": 0.11113779012396933,
"min": 3.6789139749998867,
"max": 3.8714394489998085
},
"peak_memory": {
"gib": 54.59375,
"pct": 30.60844998319804
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA B200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:47:34.969809+00:00",
"success": true,
"error_reason": null,
"time_taken": 210.73784957300086
},
"metrics": {
"mfu": {
"mean": 14.166913779062327,
"std": 0.03189668324825658,
"min": 14.133844861170086,
"max": 14.19749221907924
},
"throughput": {
"mean": 26394.914306925668,
"std": 59.42792016262459,
"min": 26333.30235194374,
"max": 26451.886158132867
},
"step_time": {
"mean": 39.612902531999985,
"std": 0.12892289776828222,
"min": 39.48159200600003,
"max": 39.739297179999994
},
"peak_memory": {
"gib": 171.52994791666666,
"pct": 96.16972330033852
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:29:07.316579+00:00",
"success": true,
"error_reason": null,
"time_taken": 140.79688516900023
},
"metrics": {
"mfu": {
"mean": 15.293682809246896,
"std": 0.0014841779556249671,
"min": 15.292477098886133,
"max": 15.29534040662252
},
"throughput": {
"mean": 33099.95928339881,
"std": 3.2121909754006244,
"min": 33097.34977695445,
"max": 33103.54680422854
},
"step_time": {
"mean": 7.918505162999888,
"std": 0.0025994999660927214,
"min": 7.915530807999858,
"max": 7.920342067999627
},
"peak_memory": {
"gib": 31.6484375,
"pct": 39.970830962963646
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:17:11.459622+00:00",
"success": true,
"error_reason": null,
"time_taken": 624.2448271570001
},
"metrics": {
"mfu": {
"mean": 27.942932963415544,
"std": 0.014498147027639258,
"min": 27.930455687231994,
"max": 27.958837751284484
},
"throughput": {
"mean": 23385.51075359203,
"std": 12.133535648026946,
"min": 23375.068489827237,
"max": 23398.821510491805
},
"step_time": {
"mean": 44.85819833366653,
"std": 0.03992741859460502,
"min": 44.812667397999576,
"max": 44.887240678000126
},
"peak_memory": {
"gib": 63.6796875,
"pct": 80.42514025650868
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:31:45.516492+00:00",
"success": true,
"error_reason": null,
"time_taken": 253.7607040289995
},
"metrics": {
"mfu": {
"mean": 2.9033962435015255,
"std": 0.06185211772693289,
"min": 2.8333683904138596,
"max": 2.9505657988343432
},
"throughput": {
"mean": 6113.178662139965,
"std": 130.23129279813597,
"min": 5965.733139259937,
"max": 6212.4954260190325
},
"step_time": {
"mean": 8.173900715999784,
"std": 0.030643063802763774,
"min": 8.154543812000156,
"max": 8.20923029000005
},
"peak_memory": {
"gib": 74.587890625,
"pct": 94.20180595190192
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:07:58.431560+00:00",
"success": true,
"error_reason": null,
"time_taken": 118.56876047700007
},
"metrics": {
"mfu": {
"mean": 21.186359822422222,
"std": 0.0008420584654773224,
"min": 21.185637325200606,
"max": 21.187284596349986
},
"throughput": {
"mean": 48719.19229289033,
"std": 1.9363594617136561,
"min": 48717.53087104316,
"max": 48721.31886107815
},
"step_time": {
"mean": 5.380075431333201,
"std": 0.0007378815620199924,
"min": 5.379241290999744,
"max": 5.3806429229998685
},
"peak_memory": {
"gib": 10.255859375,
"pct": 12.95277915246372
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:13:31.235946+00:00",
"success": true,
"error_reason": null,
"time_taken": 202.00237810199997
},
"metrics": {
"mfu": {
"mean": 36.80129006524934,
"std": 0.038682209837297775,
"min": 36.760663305779815,
"max": 36.83767867963716
},
"throughput": {
"mean": 32802.60523065393,
"std": 34.479151586600146,
"min": 32766.39281662397,
"max": 32835.03999993886
},
"step_time": {
"mean": 32.001040753666835,
"std": 0.07306682405527636,
"min": 31.934163717000047,
"max": 32.07902539700035
},
"peak_memory": {
"gib": 28.849609375,
"pct": 36.43601235213133
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:36:16.464322+00:00",
"success": true,
"error_reason": null,
"time_taken": 73.39023454399921
},
"metrics": {
"mfu": {
"mean": 13.898604576898995,
"std": 0.09860944703652262,
"min": 13.786370142108543,
"max": 13.971346979414989
},
"throughput": {
"mean": 26025.535138303083,
"std": 184.64901383576387,
"min": 25815.37294466665,
"max": 26161.747370419624
},
"step_time": {
"mean": 4.687673982000281,
"std": 0.09089959338883277,
"min": 4.6215637490004156,
"max": 4.7913323130005665
},
"peak_memory": {
"gib": 17.095703125,
"pct": 21.591254222341448
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:10:14.248139+00:00",
"success": true,
"error_reason": null,
"time_taken": 179.18628272199976
},
"metrics": {
"mfu": {
"mean": 35.369152588637945,
"std": 0.05330515137907955,
"min": 35.316299078746994,
"max": 35.422898183835194
},
"throughput": {
"mean": 28965.660342784828,
"std": 43.65439362726316,
"min": 28922.37582213965,
"max": 29009.675439032973
},
"step_time": {
"mean": 30.286332981666572,
"std": 0.06468944241064038,
"min": 30.22071294999978,
"max": 30.350049833999947
},
"peak_memory": {
"gib": 36.104817708333336,
"pct": 45.59907785553104
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H100 80GB HBM3",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:27:53.996296+00:00",
"success": true,
"error_reason": null,
"time_taken": 56.04371451099996
},
"metrics": {
"mfu": {
"mean": 26.55059850068127,
"std": 0.9214643188212911,
"min": 25.52123970895786,
"max": 27.298541372653315
},
"throughput": {
"mean": 49716.756124637475,
"std": 1725.46832852818,
"min": 47789.25230540903,
"max": 51117.300574136076
},
"step_time": {
"mean": 5.014559059999859,
"std": 0.12068159290123663,
"min": 4.944470342999921,
"max": 5.153909341999679
},
"peak_memory": {
"gib": 54.6328125,
"pct": 68.99926460725865
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:40:32.097857+00:00",
"success": true,
"error_reason": null,
"time_taken": 850.1089639260008
},
"metrics": {
"mfu": {
"mean": 16.183996593923855,
"std": 0.0037561429610161526,
"min": 16.181544055966448,
"max": 16.18832083048134
},
"throughput": {
"mean": 6299.056753540347,
"std": 1.4619477672614645,
"min": 6298.102188597488,
"max": 6300.73981194519
},
"step_time": {
"mean": 166.49029159400015,
"std": 0.06453865622834476,
"min": 166.42061012799968,
"max": 166.54801481200047
},
"peak_memory": {
"gib": 130.34765625,
"pct": 93.23810509247556
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:27:51.581711+00:00",
"success": true,
"error_reason": null,
"time_taken": 218.2948968770006
},
"metrics": {
"mfu": {
"mean": 19.1682663627078,
"std": 0.005302549001711897,
"min": 19.16325925051159,
"max": 19.173821745555
},
"throughput": {
"mean": 16153.725429668006,
"std": 4.46863159297824,
"min": 16149.50577234049,
"max": 16158.407132617673
},
"step_time": {
"mean": 16.231846535000233,
"std": 0.008343797303602548,
"min": 16.22289656399971,
"max": 16.239410609000515
},
"peak_memory": {
"gib": 84.234375,
"pct": 60.253124103633404
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Offload",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:56:15.445296+00:00",
"success": true,
"error_reason": null,
"time_taken": 610.8198953759993
},
"metrics": {
"mfu": {
"mean": 25.072133344311208,
"std": 0.006226456419567391,
"min": 25.0676110733694,
"max": 25.079234992016517
},
"throughput": {
"mean": 9758.45428238915,
"std": 2.4234312045658766,
"min": 9756.694146000587,
"max": 9761.21835130623
},
"step_time": {
"mean": 107.47203745833303,
"std": 0.043855674302782005,
"min": 107.42230272799952,
"max": 107.50516088899985
},
"peak_memory": {
"gib": 128.84375,
"pct": 92.16235603015416
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "PrimeIntellect/INTELLECT-3",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 3300,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:20:31.633435+00:00",
"success": true,
"error_reason": null,
"time_taken": 1182.043570376
},
"metrics": {
"mfu": {
"mean": 19.80122443240109,
"std": 0.009098784296829253,
"min": 19.79363619148072,
"max": 19.811311550992613
},
"throughput": {
"mean": 16687.13991133496,
"std": 7.667843324668441,
"min": 16680.745052352813,
"max": 16695.64065631736
},
"step_time": {
"mean": 15.714851607333307,
"std": 0.012174909467773673,
"min": 15.700846749000448,
"max": 15.722915346000264
},
"peak_memory": {
"gib": 89.72265625,
"pct": 64.17890964275439
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:21:23.241794+00:00",
"success": true,
"error_reason": null,
"time_taken": 140.92812991700066
},
"metrics": {
"mfu": {
"mean": 16.987738215725667,
"std": 0.003842547228315253,
"min": 16.9834062123014,
"max": 16.990735168068667
},
"throughput": {
"mean": 36766.385851652594,
"std": 8.316385162955287,
"min": 36757.01014151481,
"max": 36772.87212456442
},
"step_time": {
"mean": 7.128945582333472,
"std": 0.00330733605842928,
"min": 7.1251666289999775,
"max": 7.131312663000244
},
"peak_memory": {
"gib": 31.6484375,
"pct": 22.638230916696244
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:07:39.365493+00:00",
"success": true,
"error_reason": null,
"time_taken": 537.1643096139996
},
"metrics": {
"mfu": {
"mean": 29.16920060446058,
"std": 0.022125997715458492,
"min": 29.15022260355039,
"max": 29.19350299028142
},
"throughput": {
"mean": 24411.777221181026,
"std": 18.517303039959025,
"min": 24395.894484571094,
"max": 24432.115948890652
},
"step_time": {
"mean": 42.98113733000006,
"std": 0.05581546205591432,
"min": 42.91741776500021,
"max": 43.021377362000294
},
"peak_memory": {
"gib": 63.6796875,
"pct": 45.550288867437935
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:06:44.350139+00:00",
"success": true,
"error_reason": null,
"time_taken": 249.35987513700002
},
"metrics": {
"mfu": {
"mean": 2.8224020757175636,
"std": 0.003054514902315025,
"min": 2.819748382689604,
"max": 2.8257410097727513
},
"throughput": {
"mean": 5942.643269541411,
"std": 6.431363051397209,
"min": 5937.055847696838,
"max": 5949.6734847475345
},
"step_time": {
"mean": 7.401247934666874,
"std": 0.02254675077815527,
"min": 7.380187235000449,
"max": 7.425033139000334
},
"peak_memory": {
"gib": 74.587890625,
"pct": 53.352962261028935
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:14:27.917821+00:00",
"success": true,
"error_reason": null,
"time_taken": 397.24606492099974
},
"metrics": {
"mfu": {
"mean": 15.397168832361032,
"std": 0.06657191378906012,
"min": 15.321655222551161,
"max": 15.447379181165193
},
"throughput": {
"mean": 12748.349255622132,
"std": 55.11935452798206,
"min": 12685.82647095371,
"max": 12789.921772606987
},
"step_time": {
"mean": 42.89128534700012,
"std": 0.5558737978726181,
"min": 42.567282986000464,
"max": 43.533143310000014
},
"peak_memory": {
"gib": 105.353515625,
"pct": 75.35971450737547
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:25:54.085658+00:00",
"success": true,
"error_reason": null,
"time_taken": 98.99489516799986
},
"metrics": {
"mfu": {
"mean": 16.63549253820368,
"std": 0.819573259617385,
"min": 15.705104680132697,
"max": 17.25063363475304
},
"throughput": {
"mean": 35026.47571662118,
"std": 1725.63347974548,
"min": 33067.51912769404,
"max": 36321.671793990135
},
"step_time": {
"mean": 7.173170910666461,
"std": 0.6337301307519424,
"min": 6.712108918000013,
"max": 7.895820040999752
},
"peak_memory": {
"gib": 106.423828125,
"pct": 76.12531254133928
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:24:02.574320+00:00",
"success": true,
"error_reason": null,
"time_taken": 93.59855710200009
},
"metrics": {
"mfu": {
"mean": 22.77780543062047,
"std": 0.0042322790783645555,
"min": 22.774391607679817,
"max": 22.782540798115665
},
"throughput": {
"mean": 52378.80844495008,
"std": 9.732357044068635,
"min": 52370.95817252511,
"max": 52389.69768130354
},
"step_time": {
"mean": 5.005079579333445,
"std": 0.0016031840898894046,
"min": 5.003228462999687,
"max": 5.006020153000463
},
"peak_memory": {
"gib": 10.255859375,
"pct": 7.336049774350283
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": 16,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:16:54.365807+00:00",
"success": true,
"error_reason": null,
"time_taken": 199.22786494399998
},
"metrics": {
"mfu": {
"mean": 37.50498548642796,
"std": 0.08614247168198098,
"min": 37.43500175224926,
"max": 37.601192001603245
},
"throughput": {
"mean": 33429.839848315816,
"std": 76.78256624065938,
"min": 33367.46027410088,
"max": 33515.59293828403
},
"step_time": {
"mean": 31.42467853866674,
"std": 0.12039063430338016,
"min": 31.285738278999816,
"max": 31.498099366000133
},
"peak_memory": {
"gib": 28.849609375,
"pct": 20.636219999414973
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:05:47.581338+00:00",
"success": true,
"error_reason": null,
"time_taken": 94.38669985200022
},
"metrics": {
"mfu": {
"mean": 14.6522948792678,
"std": 0.09331446034479328,
"min": 14.548699267346166,
"max": 14.72975492212209
},
"throughput": {
"mean": 27436.841815830994,
"std": 174.73399960250234,
"min": 27242.856065439788,
"max": 27581.887964598303
},
"step_time": {
"mean": 4.415443519999826,
"std": 0.08516777230844812,
"min": 4.348332472000038,
"max": 4.51125360099968
},
"peak_memory": {
"gib": 17.095703125,
"pct": 12.228612392856222
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "rl",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 65536,
"ac": "Recompute",
"attention": "flash_attention_3",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T23:11:11.497803+00:00",
"success": true,
"error_reason": null,
"time_taken": 178.26785598200058
},
"metrics": {
"mfu": {
"mean": 36.07478778767836,
"std": 0.045382177103142095,
"min": 36.02410276426409,
"max": 36.11165476465475
},
"throughput": {
"mean": 29543.54214105793,
"std": 37.16585304924738,
"min": 29502.033508104272,
"max": 29573.734448614276
},
"step_time": {
"mean": 29.889196768666807,
"std": 0.03833519915834691,
"min": 29.858544257000176,
"max": 29.932179942999937
},
"peak_memory": {
"gib": 36.104817708333336,
"pct": 25.825894263704924
}
}
}
@@ -0,0 +1,46 @@
{
"config": {
"type": "sft",
"num_gpus": 8,
"model_name": "Qwen/Qwen3-4B-Instruct-2507",
"lora_rank": null,
"seq_len": 16384,
"ac": "Recompute",
"attention": "flash_attention_2",
"output": "/tmp/benchmark_result.json",
"dry_run": false,
"timeout": 1500,
"micro_batches": 2,
"docker_image": "primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6",
"device_name": "NVIDIA H200",
"commit_sha": "unknown",
"timestamp": "2026-01-15T22:55:02.193975+00:00",
"success": true,
"error_reason": null,
"time_taken": 55.37509840599978
},
"metrics": {
"mfu": {
"mean": 28.37954151134585,
"std": 0.9404399349147221,
"min": 27.327257024240104,
"max": 29.13795577178809
},
"throughput": {
"mean": 53141.50429461707,
"std": 1761.000713141191,
"min": 51171.07145417345,
"max": 54561.65671893574
},
"step_time": {
"mean": 4.706847163666983,
"std": 0.10895631514583606,
"min": 4.640467990000616,
"max": 4.832593936000194
},
"peak_memory": {
"gib": 54.6328125,
"pct": 39.079029573057724
}
}
}
+89
View File
@@ -0,0 +1,89 @@
# Performance Benchmarks
Automated benchmark results for prime-rl using `--bench` flag.
**Last Updated:** 2026-02-01 00:43 UTC
**Commit:** `unknown`
**Docker Image:** `primeintellect/prime-rl-jackmin@sha256:5a146f7dfdcdf6b0e90fd3f1ed0874d22a3a0641378dc8dad46ce213d02fa2e6`
> :warning: indicates regression > 5% from baseline
> diffs shown when abs(change) >= 1.0% (except regressions, which always show diffs)
> :clock10: The Step Time shown is the time taken per micro batch. This differs from what gets displayed in the bench table which is the total step time.
## INTELLECT-3
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 19.8% | 16.69k | 7.85s | 89.7 GiB |
| RL LoRA(r=16) | 16384 | Offload | FA3 | 1 | 1 | 8xH200 | 19.2% | 16.15k | 8.11s | 84.2 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 2.5% | 4.78k | 27.45s | 90.4 GiB |
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 8xH200 | 25.1% | 9.76k | 53.73s | 128.8 GiB |
| RL LoRA(r=16) | 65536 | Offload | FA2 | 1 | 1 | 8xH200 | 16.2% | 6.30k | 83.23s | 130.3 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 5.8% | 5.16k | 101.60s | 153.6 GiB |
| RL LoRA(r=16) | 65536 | Offload | FA2 | 1 | 1 | 8xB200 | 5.7% | 5.04k | 104.10s | 131.5 GiB |
## Qwen3-0.6B
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 11.1% | 11.90k | 1.38s | 12.5 GiB |
| RL Full | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 10.9% | 3.69k | 4.44s | 12.5 GiB |
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 26.8% | 10.15k | 6.46s | 19.6 GiB |
| RL Full | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 26.4% | 9.98k | 6.57s | 16.1 GiB |
| RL Full | 65536 | Recompute | FA2 | 1 | 1 | 4xA6000 | 16.2% | 7.72k | 33.94s | 12.4 GiB |
| RL Full | 65536 | Recompute | FA2 | 1 | 1 | 1xA6000 | 17.1% | 2.04k | 32.12s | 19.5 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 10.9% | 13.34k | 1.23s | 5.1 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 6.3% | 2.41k | 6.79s | 5.1 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 25.2% | 9.97k | 6.58s | 11.5 GiB |
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 24.7% | 9.78k | 6.70s | 7.9 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 1xA6000 | 16.0% | 1.99k | 32.85s | 11.5 GiB |
| SFT Full | 8192 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 16.8% | 26.01k | 0.32s | 31.7 GiB |
| SFT Full | 8192 | Recompute | FA2 | 1 | 1 | 1xA6000 | 13.5% | 6.60k | 1.24s | 31.2 GiB |
| SFT Full | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 23.7% | 25.49k | 0.64s | 52.8 GiB |
## Qwen3-235B-A22B-Instruct-2507
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 4.2% | 4.14k | 31.69s | 161.5 GiB |
| RL LoRA(r=16) | 16384 | Offload | FA2 | 1 | 1 | 8xB200 | 4.2% | 4.13k | 31.76s | 150.3 GiB |
## Qwen3-30B-A3B-Instruct-2507
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 2.9% | 6.11k | 21.44s | 74.6 GiB |
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 2.8% | 5.94k | 22.06s | 74.6 GiB |
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 15.4% | 12.75k | 41.13s | 105.4 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 17.0% | 36.77k | 3.56s | 31.6 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 15.3% | 33.10k | 3.96s | 31.6 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 1.9% | 9.27k | 14.14s | 32.0 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 29.2% | 24.41k | 21.48s | 63.7 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 27.9% | 23.39k | 22.42s | 63.7 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 6.9% | 13.23k | 39.64s | 64.8 GiB |
| SFT Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 16.6% | 35.03k | 3.74s | 106.4 GiB |
## Qwen3-4B-Instruct-2507
| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |
|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|
| RL Full | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 6.5% | 27.54k | 4.76s | 17.0 GiB |
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 14.7% | 27.44k | 4.78s | 17.1 GiB |
| RL Full | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 13.9% | 26.03k | 5.04s | 17.1 GiB |
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 36.1% | 29.54k | 17.75s | 36.1 GiB |
| RL Full | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 35.4% | 28.97k | 18.10s | 36.1 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH200 | 22.8% | 52.38k | 2.50s | 10.3 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 21.2% | 48.72k | 2.69s | 10.3 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 8.8% | 46.08k | 2.84s | 10.2 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 21.7% | 6.23k | 2.63s | 23.3 GiB |
| RL LoRA(r=16) | 16384 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 20.7% | 5.95k | 2.75s | 20.6 GiB |
| RL LoRA(r=16) | 16384 | Recompute | FA2 | 1 | 1 | 1xA6000 | 13.6% | 1.23k | 13.29s | 23.3 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH200 | 37.5% | 33.43k | 15.68s | 28.8 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 8xH100 HBM3 | 36.8% | 32.80k | 15.98s | 28.8 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 12.3% | 25.04k | 20.94s | 28.8 GiB |
| RL LoRA(r=16) | 65536 | Recompute | FA3 | 1 | 1 | 1xH100 HBM3 | 37.4% | 4.16k | 15.74s | 42.0 GiB |
| RL LoRA(r=16) | 65536 | Offload | FA3 | 1 | 1 | 1xH100 HBM3 | 36.3% | 4.04k | 16.21s | 31.1 GiB |
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xB200 | 16.0% | 68.36k | 1.92s | 54.6 GiB |
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xH200 | 28.4% | 53.14k | 2.47s | 54.6 GiB |
| SFT Full | 16384 | Recompute | FA2 | 1 | 1 | 8xH100 HBM3 | 26.6% | 49.72k | 2.64s | 54.6 GiB |
| SFT Full | 65536 | Recompute | FA2 | 1 | 1 | 8xB200 | 14.2% | 26.39k | 19.86s | 171.5 GiB |
+233
View File
@@ -0,0 +1,233 @@
#!/usr/bin/env python3
"""Aggregate benchmark results from multiple JSON files into markdown report."""
from __future__ import annotations
import json
import sys
from datetime import datetime, timezone
from pathlib import Path
from typing import Annotated
from pydantic import Field
from prime_rl.utils.pydantic_config import BaseSettings, parse_argv
SHORTENED_ATTN_MAPPING = {
"flash_attention_2": "FA2",
"flash_attention_3": "FA3",
"flash_attention_4": "FA4",
}
# These words are stripped from the device name to get the short name
DEVICE_NAME_STRIP_WORDS = ["NVIDIA", "RTX", "80GB", "40GB"]
class AggregateConfig(BaseSettings):
"""Configuration for aggregating benchmark results."""
artifacts_dir: Annotated[Path, Field(description="Directory containing benchmark JSON artifacts")]
baselines_dir: Annotated[Path, Field(description="Directory containing baseline JSON artifacts")]
output_markdown: Annotated[Path, Field(description="Output markdown file path")]
regression_threshold: Annotated[float, Field(description="Regression threshold (default: 0.05 = 5%)")] = 0.05
diff_display_threshold: Annotated[float, Field(description="Diff display threshold (default: 0.01 = 1%)")] = 0.01
def get_hardware(config: dict) -> str:
num_gpus = config.get("num_gpus", 1)
device_name = config.get("device_name", "Unknown")
short_name = " ".join(word for word in device_name.split() if word not in DEVICE_NAME_STRIP_WORDS)
return f"{num_gpus}x{short_name}"
def get_training_type(config: dict) -> str:
train_type = config.get("type", "unknown").upper()
lora_rank = config.get("lora_rank")
if lora_rank is not None:
return f"{train_type} LoRA(r={lora_rank})"
return f"{train_type} Full"
def get_config_key(config: dict) -> str:
"""Get a unique key for a benchmark configuration."""
return "|".join(
[
config.get("model_name", "unknown"),
get_hardware(config),
config.get("type", "rl"),
str(config.get("lora_rank") or "none"),
str(config.get("seq_len", 0)),
config.get("ac", "None"),
config.get("attention", "unknown"),
str(config.get("ep", 1)),
str(config.get("cp", 1)),
]
)
def load_json_dir(directory: Path) -> list[dict]:
"""Load all JSON files from a directory."""
results = []
if not directory.exists():
return results
for f in directory.rglob("*.json"):
try:
results.append(json.loads(f.read_text()))
except Exception as e:
print(f"Warning: Failed to load {f}: {e}", file=sys.stderr)
return results
def format_metric(
value: float,
baseline: float | None,
threshold: float,
diff_display_threshold: float,
fmt: str,
higher_is_better: bool = True,
) -> tuple[str, bool]:
formatted = fmt.format(value)
if baseline is None or baseline == 0:
return formatted, False
pct_change = (value - baseline) / baseline * 100
is_regression = (value < baseline * (1 - threshold)) if higher_is_better else (value > baseline * (1 + threshold))
if is_regression:
return f"**{formatted}** :warning: ({pct_change:+.1f}%)", True
elif abs(pct_change) >= diff_display_threshold * 100:
return f"{formatted} ({pct_change:+.1f}%)", False
return formatted, False
def sorting_key(x: dict) -> tuple:
return (
get_training_type(x["config"]),
x["config"]["seq_len"],
-x["metrics"]["throughput"]["mean"],
get_hardware(x["config"]),
x["config"]["ac"],
x["config"]["attention"],
)
def generate_markdown(
results: list[dict],
baselines: dict[str, dict],
threshold: float,
diff_display_threshold: float,
) -> tuple[str, bool]:
has_regressions = False
by_model: dict[str, list[dict]] = {}
for r in results:
if r["config"]["success"]:
model = r["config"]["model_name"]
by_model.setdefault(model, []).append(r)
commit = results[0]["config"].get("commit_sha", "unknown") if results else "unknown"
docker_image = results[0]["config"].get("docker_image", "unknown") if results else "unknown"
lines = [
"# Performance Benchmarks",
"",
"Automated benchmark results for prime-rl using `--bench` flag.",
"",
f"**Last Updated:** {datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M UTC')} ",
f"**Commit:** `{commit}` ",
f"**Docker Image:** `{docker_image}`",
"",
f"> :warning: indicates regression > {threshold * 100:.0f}% from baseline",
f"> diffs shown when abs(change) >= {diff_display_threshold * 100:.1f}% (except regressions, which always show diffs)",
"",
"> :clock10: The Step Time shown is the time taken per micro batch. This differs from what gets displayed in the bench table which is the total step time."
"",
]
for model, model_results in sorted(by_model.items()):
lines.append(f"## {model.split('/')[-1]}")
lines.append("")
lines.append("| Type | SeqLen | AC | Attn | EP | CP | Hardware | MFU | TPS | Step Time | Peak Mem |")
lines.append("|------|--------|----|----|----|----|----------|-----|-----|-----------|----------|")
for r in sorted(model_results, key=sorting_key):
cfg, m = r["config"], r["metrics"]
bl = baselines.get(get_config_key(cfg), {})
mfu_str, mfu_reg = format_metric(
m["mfu"]["mean"], bl.get("mfu"), threshold, diff_display_threshold, "{:.1f}%", True
)
tps_str, tps_reg = format_metric(
m["throughput"]["mean"] / 1000,
bl.get("throughput", 0) / 1000 if bl.get("throughput") else None,
threshold,
diff_display_threshold,
"{:.2f}k",
True,
)
step_str, step_reg = format_metric(
cfg["seq_len"] * cfg["num_gpus"] / m["throughput"]["mean"],
None,
threshold,
diff_display_threshold,
"{:.2f}s",
False,
)
has_regressions = has_regressions or mfu_reg or tps_reg or step_reg
attn = SHORTENED_ATTN_MAPPING.get(cfg["attention"], cfg["attention"])
lines.append(
f"| {get_training_type(cfg)} | {cfg['seq_len']} | {cfg.get('ac', 'None')} | {attn} | {cfg.get('ep', 1)} | {cfg.get('cp', 1)} | {get_hardware(cfg)} | "
f"{mfu_str} | {tps_str} | {step_str} | {m['peak_memory']['gib']:.1f} GiB |"
)
lines.append("")
failed = [r for r in results if not r["config"]["success"]]
if failed:
lines.append("## Failed Benchmarks")
lines.append("")
for r in failed:
cfg = r["config"]
error = (cfg.get("error_reason") or "Unknown error")[:200]
lines.append(f"- **{cfg['model_name']}** ({get_training_type(cfg)}) on {get_hardware(cfg)}: {error}")
lines.append("")
return "\n".join(lines), has_regressions
def main():
config = parse_argv(AggregateConfig)
results = load_json_dir(config.artifacts_dir)
print(f"Loaded {len(results)} benchmark results", file=sys.stderr)
baseline_results = load_json_dir(config.baselines_dir)
baselines = {}
for r in baseline_results:
if r["config"]["success"]:
m = r["metrics"]
baselines[get_config_key(r["config"])] = {
"mfu": m["mfu"]["mean"],
"throughput": m["throughput"]["mean"],
"step_time": m["step_time"]["mean"],
}
print(f"Loaded {len(baselines)} baseline entries", file=sys.stderr)
markdown, has_regressions = generate_markdown(
results, baselines, config.regression_threshold, config.diff_display_threshold
)
config.output_markdown.parent.mkdir(parents=True, exist_ok=True)
config.output_markdown.write_text(markdown)
print(f"Wrote markdown report to {config.output_markdown}", file=sys.stderr)
successful = sum(1 for r in results if r["config"]["success"])
print(f"\nSummary: {successful} successful, {len(results) - successful} failed benchmarks", file=sys.stderr)
if has_regressions:
Path("/tmp/prime-rl-benchmark-aggregate-has-regressions").touch()
print("WARNING: Performance regressions detected!", file=sys.stderr)
if __name__ == "__main__":
main()
+247
View File
@@ -0,0 +1,247 @@
#!/usr/bin/env python3
"""
Run a single benchmark configuration and output JSON results.
This script wraps the prime-rl training with --bench.output-json to get
metrics directly without parsing console output.
"""
from __future__ import annotations
import json
import subprocess
import sys
import time
from datetime import datetime, timezone
from pathlib import Path
from typing import Annotated, Literal
import torch
from pydantic import Field
from prime_rl.utils.pydantic_config import BaseSettings, parse_argv
MAX_LORAS = 4
def get_commit_sha() -> str:
"""Get current git commit SHA."""
try:
result = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, check=True)
return result.stdout.strip()[:8]
except Exception:
return "unknown"
def extract_oom_error_reason(output: str) -> str | None:
"""
Extract a human-readable error reason from process output.
Currently we only special-case CUDA OOM to make failures easier to triage in CI.
"""
needle = "torch.OutOfMemoryError: CUDA out of memory."
for line in output.splitlines():
if needle in line:
return line.strip()
return None
class BenchmarkConfig(BaseSettings):
"""Configuration for running a single benchmark."""
type: Annotated[
Literal["sft", "rl"],
Field(description="Training type"),
] = "rl"
num_gpus: Annotated[int, Field(ge=1, description="Number of GPUs")] = 2
model_name: Annotated[str, Field(description="Model name (e.g., Qwen/Qwen3-0.6B)")] = "Qwen/Qwen3-0.6B"
lora_rank: Annotated[int | None, Field(description="LoRA rank (None for full fine-tuning)")] = None
seq_len: Annotated[int, Field(ge=1, description="Sequence length")] = 512
ac: Annotated[Literal["Recompute", "Offload", "None"], Field(description="Activation checkpointing type")] = (
"Recompute"
)
attention: Annotated[
Literal["sdpa", "flash_attention_2", "flash_attention_3", "flash_attention_4"],
Field(description="Attention implementation"),
] = "flash_attention_2"
output: Annotated[Path, Field(description="Output JSON file path")] = Path("benchmark_result.json")
dry_run: Annotated[bool, Field(description="Print command without executing")] = False
timeout: Annotated[int, Field(description="Timeout in seconds")] = 3600
micro_batches: Annotated[int, Field(ge=1, description="Number of micro batches")] = 2
ep: Annotated[int, Field(ge=1, description="Expert parallelism size (1 = no EP)")] = 1
cp: Annotated[int, Field(ge=1, description="Context parallelism size (1 = no CP)")] = 1
docker_image: Annotated[str | None, Field(description="Docker image used for the benchmark")] = None
# Metadata set by the script
device_name: Annotated[str, Field(description="Device name. This is set automatically by the script.")] = (
torch.cuda.get_device_name()
)
commit_sha: Annotated[str, Field(description="Commit SHA. This is set automatically by the script.")] = (
get_commit_sha()
)
timestamp: Annotated[str, Field(description="Timestamp. This is set automatically by the script.")] = datetime.now(
timezone.utc
).isoformat()
success: Annotated[bool, Field(description="Success. This is set automatically by the script.")] = True
error_reason: Annotated[str | None, Field(description="Error reason. This is set automatically by the script.")] = (
None
)
time_taken: Annotated[
float | None, Field(description="Time taken in seconds. This is set automatically by the script.")
] = None
def build_command(config: BenchmarkConfig) -> list[str]:
"""Build the benchmark command from config."""
# Determine training script
if config.type == "rl":
script = "src/prime_rl/trainer/rl/train.py"
elif config.type == "sft":
script = "src/prime_rl/trainer/sft/train.py"
else:
raise ValueError(f"Invalid training type: {config.type}")
cmd = [
"uv",
"run",
"torchrun",
f"--nproc-per-node={config.num_gpus}",
script,
"--model.name",
config.model_name,
"--model.seq-len",
str(config.seq_len),
"--model.attn",
config.attention,
"--bench.output-json",
str(config.output),
"--model.compile",
"--dist-timeout-seconds",
str(config.timeout),
]
# Add activation checkpointing if enabled
if config.ac == "Recompute":
cmd.append("--model.ac")
elif config.ac == "Offload":
cmd.append("--model.ac-offloading")
# Add LoRA configuration if applicable
if config.lora_rank is not None:
cmd.extend(["--model.lora.rank", str(config.lora_rank)])
cmd.extend(["--max-concurrent-runs", str(MAX_LORAS)])
# Add expert parallelism if enabled
if config.ep > 1:
cmd.extend(["--model.ep", str(config.ep)])
# Add context parallelism if enabled
if config.cp > 1:
cmd.extend(["--model.cp", str(config.cp)])
# Data configuration differs between RL and SFT
if config.type.startswith("rl"):
cmd.extend(["--data.fake.batch-size", str(config.micro_batches * config.num_gpus)])
else:
cmd.extend(
[
"--data.type",
"fake",
"--data.batch-size",
str(config.micro_batches * config.num_gpus),
"--data.seq-len",
str(config.seq_len),
]
)
return cmd
def dummy_metrics() -> dict:
return {
"mfu": {"mean": 0, "std": 0, "min": 0, "max": 0},
"throughput": {"mean": 0, "std": 0, "min": 0, "max": 0},
"step_time": {"mean": 0, "std": 0, "min": 0, "max": 0},
"peak_memory": {"gib": 0, "pct": 0},
}
def run_benchmark(config: BenchmarkConfig) -> None:
"""Run a single benchmark and write results to output path."""
cmd = build_command(config)
print(f"Running: {' '.join(cmd)}")
if config.dry_run:
return
start_time = time.perf_counter()
try:
config.output.parent.mkdir(parents=True, exist_ok=True)
result = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=config.timeout,
)
output = result.stdout + result.stderr
if result.returncode != 0:
config.success = False
config.error_reason = extract_oom_error_reason(output) or f"Non-zero exit code: {result.returncode}"
print(f"Process exited with code {result.returncode}: {output}")
if not config.output.exists():
config.success = False
config.error_reason = config.error_reason or extract_oom_error_reason(output) or "No JSON output written"
print(f"Process exited with code {result.returncode}: {output}")
print("Benchmark completed but no JSON output was written")
else:
with open(config.output) as f:
metrics = json.load(f)
lines = output.splitlines()
print("\n".join(lines))
except subprocess.TimeoutExpired:
config.success = False
config.error_reason = "Timeout"
print(f"Benchmark timed out after {config.timeout} seconds")
except Exception as e:
config.success = False
config.error_reason = str(e)
print(f"Error: {e}")
finally:
config.time_taken = time.perf_counter() - start_time
if not config.success:
metrics = dummy_metrics()
# Write final result with config and metadata
final_result = {
"config": config.model_dump(mode="json"),
"metrics": metrics,
}
with open(config.output, "w") as f:
json.dump(final_result, f, indent=2)
print(f"Results written to {config.output}", file=sys.stderr)
def main():
config = parse_argv(BenchmarkConfig)
run_benchmark(config)
if __name__ == "__main__":
main()
+6 -3
View File
@@ -11,7 +11,7 @@ resume_step = 20
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
[trainer.optim]
lr = 1e-4
lr = 5e-5
[trainer.model.lora]
rank = 8
@@ -22,7 +22,9 @@ save_adapter_separately = true
[orchestrator]
batch_size = 128
rollouts_per_example = 16
lora_name = "r8-1e-4"
[orchestrator.model.lora]
name = "r8-1e-4"
[orchestrator.sampling]
max_tokens = 128
@@ -31,4 +33,5 @@ max_tokens = 128
id = "reverse-text"
[inference]
enable_lora = true
enable_lora = true
gpu_memory_utilization = 0.7
+6 -3
View File
@@ -10,7 +10,7 @@ seq_len = 2048
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
[trainer.optim]
lr = 1e-4
lr = 5e-5
[trainer.model.lora]
rank = 8
@@ -21,7 +21,9 @@ save_adapter_separately = true
[orchestrator]
batch_size = 128
rollouts_per_example = 16
lora_name = "r8-1e-4"
[orchestrator.model.lora]
name = "r8-1e-4"
[orchestrator.sampling]
max_tokens = 128
@@ -30,4 +32,5 @@ max_tokens = 128
id = "reverse-text"
[inference]
enable_lora = true
enable_lora = true
gpu_memory_utilization = 0.7
@@ -1,5 +1,5 @@
# Orchestrator config for multi-run RL integration test
# lora_name and output_dir are set via CLI
# model.lora.name and output_dir are set via CLI
batch_size = 128
rollouts_per_example = 16
seq_len = 2048
@@ -8,9 +8,15 @@ max_steps = 20
[model]
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
[optim]
lr = 3e-5
[sampling]
max_tokens = 128
[[env]]
id = "reverse-text"
[ckpt]
interval = 10
resume_step = -1
@@ -1,17 +1,16 @@
# Trainer config for multi-run RL integration test
max_steps = 1000
max_concurrent_runs = 2
max_async_level = 5
[model]
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
seq_len = 65536
[model.lora]
rank = 8
[optim]
lr = 1e-4
[weight_broadcast]
adapter_only = true
[model.ac]
freq = 1
[model.compile]
fullgraph = false
+38
View File
@@ -0,0 +1,38 @@
inference_gpu_ids = [0]
trainer_gpu_ids = [1]
max_steps = 15
seq_len = 4096
[model]
name = "Qwen/Qwen3-VL-4B-Instruct"
[orchestrator]
batch_size = 256
rollouts_per_example = 16
trajectory_strategy = "branching" # Required for multi-turn VLM
[orchestrator.sampling]
max_tokens = 64
[[orchestrator.env]]
id = "primeintellect/color-codeword"
args = { images_per_turn = 1, max_turns = 3, num_examples = 1000, seed = 42 }
[orchestrator.val]
interval = 1
num_examples = 100
[trainer]
[trainer.model]
optimization_dtype = "bfloat16"
reduce_dtype = "bfloat16"
[trainer.optim]
lr = 3e-6
[inference]
[inference.parallel]
dp = 1
-1
View File
@@ -17,7 +17,6 @@ weight_decay = 0.0
[trainer.model.lora]
rank = 8
alpha = 32
dropout = 0.0
target_modules = [
"q_proj",
+140
View File
@@ -0,0 +1,140 @@
# Bring Your Own Algorithms
Prime-RL supports custom implementations for key algorithmic components, allowing you to experiment with different RL objectives and techniques.
## 1. Custom Loss Functions
The loss is computed **per-sequence** (per-sample). You provide a function that computes the loss for a single sequence, and the framework handles iteration and aggregation.
### Interface
```python
from prime_rl.trainer.rl.loss import LossInputs, LossOutputs
def my_custom_loss(inputs: LossInputs, **kwargs) -> LossOutputs:
...
```
#### LossInputs
```python
@dataclass
class LossInputs:
trainer_logprobs: Float[Tensor, "seq"] # Log probs from current policy
inference_logprobs: Float[Tensor, "seq"] # Log probs from reference policy
teacher_logprobs: Float[Tensor, "seq"] | None # Optional teacher log probs
advantages: Float[Tensor, "seq"] # Per-token advantages
loss_mask: Bool[Tensor, "seq"] # Mask for valid tokens
```
#### LossOutputs
```python
@dataclass
class LossOutputs:
loss: Float[Tensor, ""] # Scalar loss for this sequence
metrics: dict[str, Tensor] # Metrics to log
```
### Example: PPO Clipped Loss
```python
import torch
from prime_rl.trainer.rl.loss import LossInputs, LossOutputs
def ppo_clip_loss(inputs: LossInputs, clip_eps: float = 0.2) -> LossOutputs:
ratio = torch.exp(inputs.trainer_logprobs - inputs.inference_logprobs)
clipped_ratio = torch.clamp(ratio, 1 - clip_eps, 1 + clip_eps)
surr1 = ratio * inputs.advantages
surr2 = clipped_ratio * inputs.advantages
loss = -torch.min(surr1, surr2)[inputs.loss_mask].sum()
return LossOutputs(
loss=loss,
metrics={"clip_frac": (ratio != clipped_ratio)[inputs.loss_mask].float().mean()},
)
```
### Configuration
```toml
[loss]
type = "custom"
import_path = "my_module.ppo_clip_loss"
kwargs = { clip_eps = 0.2 }
```
---
## 2. Custom Advantage Functions
Advantages are computed **per-example** (grouped by `rollouts_per_example`). You provide a function that computes advantages for a batch of examples.
### Interface
```python
from prime_rl.orchestrator.advantage import AdvantageInputs, AdvantageOutputs
def my_custom_advantage(inputs: AdvantageInputs, **kwargs) -> AdvantageOutputs:
...
```
#### AdvantageInputs
```python
@dataclass
class AdvantageInputs:
rewards: Float[Tensor, "num_examples rollouts_per_example"]
completion_lengths: Int[Tensor, "num_examples rollouts_per_example"]
```
#### AdvantageOutputs
```python
@dataclass
class AdvantageOutputs:
advantages: Float[Tensor, "num_examples rollouts_per_example"]
```
### Example: Normalized Advantage
```python
import torch
from prime_rl.orchestrator.advantage import AdvantageInputs, AdvantageOutputs
def normalized_advantage(inputs: AdvantageInputs, eps: float = 1e-8) -> AdvantageOutputs:
"""Normalize advantages to zero mean and unit variance per example."""
mean = inputs.rewards.mean(dim=1, keepdim=True)
std = inputs.rewards.std(dim=1, keepdim=True)
advantages = (inputs.rewards - mean) / (std + eps)
return AdvantageOutputs(advantages=advantages)
```
### Configuration
```toml
[advantage]
type = "custom"
import_path = "my_module.normalized_advantage"
kwargs = { eps = 1e-8 }
```
---
## Default Implementations
If no custom function is specified:
- **Loss**: Uses `default_loss_fn` (masked importance sampling with KL against the inference policy, and optional masking strategies)
- **Advantage**: Uses `default_advantage_fn` (reward minus per-example baseline, a.k.a. DR-GRPO without std normalization)
See `LossConfig` and `AdvantageConfig` for available parameters.
## Tips
- Your functions receive structured inputs via dataclasses with jaxtyping annotations
- Return metrics as scalars or 1D tensors - they'll be aggregated automatically
- Use the `loss_mask` / tensor shapes to handle variable-length sequences
- Test your custom functions with the provided test patterns before training
+1 -1
View File
@@ -8,7 +8,7 @@ Checkpointing is non-standard due to trainer/orchestrator separation and natural
The default checkpoint directory is `checkpoints` and each checkpoint step will live in a step subdirectory, i.e. `checkpoints/step_{step}`.
Checkpointing is configured with the config key `--ckpt`. One can specify the interval (`--ckpt.interval`), whether to save checkpoints asynchronoously (`--ckpt.save-async`), and how many recent step checkpoints to keep on disk (`--ckpt.keep`). By default, we do not checkpoint to save disk space.
Checkpointing is configured with the config key `--ckpt`. One can specify the interval (`--ckpt.interval`), whether to save checkpoints asynchronoously (`--ckpt.save-async`), how many recent step checkpoints to keep on disk (`--ckpt.keep-last`), and keep checkpoints at every N steps permanently (`--ckpt.keep-interval`). By default, we do not checkpoint to save disk space.
## SFT
+3 -2
View File
@@ -31,7 +31,7 @@ uv run torchrun \
src/prime_rl/trainer/sft/train.py ...
```
*The `--local-rank-filter` flag is used to only log the logs from the master rank, as detailed in [logs](logs.md).*
*The `--local-rank-filter` flag is used to only log the logs from the master rank, as detailed in [logging](logging.md).*
### Multi-Node
@@ -287,7 +287,8 @@ TBD.
For deployments on Kubernetes clusters, PRIME-RL provides a Helm chart that manages the entire training infrastructure including orchestrator, trainer, and inference components with automatic pod scheduling, GPU allocation, and shared storage.
See the [Kubernetes deployment guide](../k8s/README.md) for complete documentation including:
See the dedicated [Kubernetes guide](kubernetes.md) for complete documentation including:
- Prerequisites and setup
- Quick start examples
- Component architecture
+2 -1
View File
@@ -7,8 +7,9 @@ This directory maintains the documentation for PRIME-RL. It is organized into th
- [**Environments**](environments.md) - Installing and using verifiers environments from the Environments Hub
- [**Async Training**](async.md) - Understanding asynchronous off-policy training and step semantics
- [**Logging**](logging.md) - Logging with loguru, torchrun, and Weights & Biases
- [**Runs**](runs.md) - Multi-run training with the Runs object for concurrent LoRA adapters
- [**MultiRunManager**](multi_run_manager.md) - Multi-run training with the MultiRunManager object for concurrent LoRA adapters
- [**Checkpointing**](checkpointing.md) - Saving and resuming training from checkpoints
- [**Benchmarking**](benchmarking.md) - Performance benchmarking and throughput measurement
- [**Deployment**](deployment.md) - Training deployment on single-GPU, multi-GPU, and multi-node clusters
- [**Kubernetes**](kubernetes.md) - Deploying PRIME-RL on Kubernetes with Helm
- [**Troubleshooting**](troubleshooting.md) - Common issues and their solutions
+308
View File
@@ -0,0 +1,308 @@
# Kubernetes
This guide covers deploying PRIME-RL training infrastructure on Kubernetes clusters using the provided Helm chart.
## Prerequisites
- Kubernetes cluster with GPU nodes
- [NVIDIA GPU Operator](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/getting-started.html) installed
- [Helm 3.x](https://helm.sh/docs/intro/install/) installed
- Storage class that supports `ReadWriteMany` (e.g., NFS, CephFS, or cloud provider storage)
### Verify Prerequisites
```bash
# Check Helm installation
helm version
# Check GPU operator
kubectl get pods -n gpu-operator
# Check available storage classes
kubectl get storageclass
```
## Quick Start
### 1. Deploy
```bash
# Deploy with a release name
helm install my-exp ./k8s/prime-rl -f ./k8s/prime-rl/examples/reverse-text.yaml
# Or with defaults (no example-specific config)
helm install my-exp ./k8s/prime-rl --set trainer.replicas=3 --set inference.replicas=2
```
### 2. Verify deployment
```bash
# Check pod status
kubectl get pods -l app.kubernetes.io/instance=my-exp
# Should show 3 pods:
# my-exp-orchestrator-0
# my-exp-inference-0
# my-exp-trainer-0
```
### 3. Run training
```bash
# Exec into trainer
kubectl exec -it my-exp-trainer-0 -- bash
# Inside the pod, run training
cd /data
uv run trainer @ /app/examples/reverse_text/configs/train.toml
```
### 4. Monitor progress
```bash
# Get logs
kubectl logs my-exp-trainer-0
# Follow logs in real-time
kubectl logs -f my-exp-trainer-0
```
## Available Examples
The chart includes pre-configured values for each example:
### reverse-text (Small - 1 GPU)
```bash
helm install my-exp ./k8s/prime-rl -f ./k8s/prime-rl/examples/reverse-text.yaml
```
- Model: Qwen3-0.6B
- GPUs: 1 per component
- Runs on consumer GPUs (RTX 3090/4090)
- **Note:** You can use any release name - the chart automatically configures service URLs
## Configuration
### Storage Configuration
By default, the chart creates a 1TB PVC with NFS storage. To customize:
```yaml
# custom-values.yaml
storage:
storageClassName: my-storage-class
size: 500Gi
```
Deploy with custom storage:
```bash
helm install my-release ./k8s/prime-rl -f custom-values.yaml
```
### GPU Configuration
Adjust GPU count per component:
```yaml
# custom-gpu.yaml
inference:
gpu:
count: 4 # Use 4 GPUs for inference
trainer:
gpu:
count: 2 # Use 2 GPUs for training
```
### Resource Limits
Customize memory and CPU:
```yaml
# custom-resources.yaml
trainer:
resources:
requests:
memory: "64Gi"
cpu: "16"
limits:
memory: "128Gi"
cpu: "32"
```
### Secrets (Optional)
For W&B and HuggingFace authentication:
```bash
# Create secret
kubectl create secret generic prime-rl-secrets \
--from-literal=wandb-api-key=YOUR_WANDB_KEY \
--from-literal=hf-token=YOUR_HF_TOKEN
# Enable in values
helm install my-release ./k8s/prime-rl \
--set config.secrets.enabled=true \
--set config.secrets.name=prime-rl-secrets
```
## Common Operations
### Deploy a new experiment
```bash
# With example config
helm install my-exp ./k8s/prime-rl -f ./k8s/prime-rl/examples/reverse-text.yaml
# With custom settings
helm install my-exp ./k8s/prime-rl --set trainer.replicas=10 --set inference.replicas=5
```
### Exec into pods
```bash
# Exec into trainer-0
kubectl exec -it my-exp-trainer-0 -- bash
# Exec into specific trainer pod
kubectl exec -it my-exp-trainer-3 -- bash
# Exec into inference
kubectl exec -it my-exp-inference-0 -- bash
```
### View logs
```bash
# Get logs from trainer-0
kubectl logs my-exp-trainer-0
# Follow logs in real-time
kubectl logs -f my-exp-trainer-2
# Get logs from all trainers
kubectl logs -l app.kubernetes.io/instance=my-exp,role=trainer
```
### List all pods
```bash
# List pods for specific experiment
kubectl get pods -l app.kubernetes.io/instance=my-exp
# List all prime-rl pods
kubectl get pods -l app=prime-rl
```
## Architecture
### Components
The chart deploys three main components (all using StatefulSets):
1. **Orchestrator** (StatefulSet) - Coordinates training workflow
- Always 1 replica: `prime-rl-orchestrator-0`
- No GPU required
- Communicates with trainer and inference
2. **Inference** (StatefulSet) - Runs vLLM inference server
- Scalable replicas with stable pod names: `prime-rl-inference-0`, `prime-rl-inference-1`, ...
- Each pod gets predictable DNS: `prime-rl-inference-0.prime-rl-inference-headless.default.svc.cluster.local`
- Requires GPU(s)
- Serves model predictions
3. **Trainer** (StatefulSet) - Runs SFT or RL training
- Scalable replicas with stable pod names: `prime-rl-trainer-0`, `prime-rl-trainer-1`, ...
- Each pod gets predictable DNS: `prime-rl-trainer-0.prime-rl-trainer-headless.default.svc.cluster.local`
- Requires GPU(s)
- Updates model weights on shared storage
**Why StatefulSets for all components?**
- **Consistent naming**: All pods have predictable names (`orchestrator-0`, `trainer-0`, `trainer-1`, ...)
- **Stable networking**: Each pod gets its own DNS hostname via headless service
- **Required for distributed training**: PyTorch/vLLM need to discover peers by stable hostname
- **Clean naming**: No random pod suffixes, easier to identify and debug
### Shared Storage
All components mount the same PVC at `/data` for:
- Model checkpoint sharing
- Training data
- Experiment outputs
This is **required** for coordinating weight updates between trainer and inference.
## Environment Variables
Each pod has these K8s environment variables set:
- `$POD_NAME` - Full pod name (e.g., `my-exp-trainer-3`)
- `$POD_IP` - Pod IP address
- `$STATEFUL_REPLICAS` - Total number of replicas for that component
- `$HEADLESS_SERVICE` - DNS name for peer discovery (e.g., `my-exp-trainer-headless.default.svc.cluster.local`)
- `$INFERENCE_URL` - Full URL to the first inference pod (available in orchestrator and trainer pods)
For distributed training, extract the rank from the pod name:
```bash
# Extract ordinal from pod name
RANK=$(echo $POD_NAME | grep -o '[0-9]*$') # e.g., "my-exp-trainer-3" -> "3"
# Use in torchrun
torchrun \
--nnodes=$STATEFUL_REPLICAS \
--node-rank=$RANK \
--nproc-per-node=8 \
--rdzv-endpoint=my-exp-trainer-0.$HEADLESS_SERVICE:29501 \
src/prime_rl/trainer/sft/train.py @ configs/train.toml
```
## Troubleshooting
### Can't access shared storage
Verify PVC is bound:
```bash
kubectl get pvc prime-rl-shared-data
# STATUS should be "Bound"
```
Check mount inside pod:
```bash
kubectl exec -it prime-rl-trainer-xxx -- df -h /data
```
### Pod stuck in Pending
Check if GPU resources are available:
```bash
kubectl describe pod my-exp-trainer-0
```
Look for events like `Insufficient nvidia.com/gpu`.
### Inference server not responding
Check if the inference pod is ready:
```bash
kubectl get pods -l role=inference
kubectl logs my-exp-inference-0
```
## Uninstalling
```bash
# Remove the Helm release
helm uninstall my-exp
# Delete PVC (data will be lost!)
kubectl delete pvc prime-rl-shared-data
```
+81 -59
View File
@@ -1,14 +1,88 @@
# Logging
## Loguru
prime-rl uses [loguru](https://loguru.readthedocs.io/en/stable/) for logging with a global logger pattern. Logs are written to both console and files under `{output_dir}/logs/`. For RL training, we recommend streaming file logs into tmux panes (as set up by `tmux.sh`).
We log to console and files using `loguru` using a global logger instance. Each entrypoint should call `setup_logger` *exactly once* at the beginning of execution. Afterwards, all components can log using the global logger instance. For more details on loguru, see the [documentation](https://loguru.readthedocs.io/en/stable/). All logs are written into `{output_dir}/logs` and for RL training we recommend viewing logs by streaming the file logs into tmux panes, as set up by the `tmux.sh` script.
## tmux helper (`scripts/tmux.sh`)
`scripts/tmux.sh` sets up a tmux session for RL runs with **three panes (one per subprocess)**:
- **Trainer**: run `uv run rl ...` here
- **Orchestrator**: follows `{output_dir}/logs/orchestrator.stdout`
- **Inference**: follows `{output_dir}/logs/inference.stdout`
## Logger Architecture
### `setup_logger` and `get_logger`
We use a **singleton pattern** with a module-level global logger instance (`_LOGGER`).
```python
from prime_rl.utils.logger import setup_logger, get_logger
# At entrypoint - call ONCE
logger = setup_logger("info", log_file=Path("output/logs/my.log"))
# Anywhere else in codebase
logger = get_logger()
logger.info("Hello world")
```
**How it works:**
1. **`setup_logger(log_level, log_file)`** - Initializes the global logger exactly once:
- Creates an isolated loguru `Logger` instance (not the default `loguru.logger`) to prevent third-party code from hijacking our logs
- Adds a stdout handler with colorized output
- Optionally adds a file handler (deletes existing file first)
- Raises `RuntimeError` if called twice
2. **`get_logger()`** - Returns the global logger instance:
- Raises `RuntimeError` if `setup_logger` hasn't been called yet
- Safe to call from any module after initialization
3. **`reset_logger()`** - Resets the global logger to `None`:
- Used in subprocesses that inherit parent state (e.g., env workers)
- Used in tests between test cases
## RL Log File Structure
For RL training, logs are organized by component:
| Component | Log Path | Description |
|-----------|----------|-------------|
| **RL (parent)** | `logs/rl.log` | Main process that spawns subprocesses |
| **Inference** | `logs/inference.stdout` | vLLM inference server stdout/stderr |
| **Orchestrator** | `logs/orchestrator.log` | Rollout generation, buffer, scheduling |
| **Trainer** | `logs/trainer/rank_{N}.log` | Training process (one file per GPU rank) |
| **Env Workers** | `logs/env_workers/{env_name}/worker_{N}.log` | Per-environment worker logs (optional) |
## Per-Environment Worker Logging
Environment workers run in **separate subprocesses** to isolate event loop lag. Worker logging is controlled at the orchestrator level via `orchestrator.log`:
```toml
[orchestrator.log]
level = "debug" # Log level for prime-rl logger
vf_level = "info" # Log level for verifiers library
env_worker_logs = true # Enable file logging for env workers
```
When `env_worker_logs = true`, logs are written to:
```
output_dir/
└── logs/
└── env_workers/
├── {env_name_1}.log
├── {env_name_2}.log
└── ...
```
All workers for an environment share the same log file.
Set `env_worker_logs = false` to disable worker file logging (workers inherit parent process logging).
## Torchrun
For multi-node training, we use `torchrun` to set up distributed training. Because `torchrun` is SPMD, all ranks are logging to console and file at the same time. To only view the logs from the master rank, you can use the `--local-ranks-filter` flag.
For example, to only view the logs from the master rank when training on a full node
For multi-node training with `torchrun`, all ranks log simultaneously. To filter to master rank only:
```bash
uv run torchrun \
@@ -17,7 +91,7 @@ uv run torchrun \
...
```
In addition to the loguru file logs you can also use the `--log-dir` and `--redirects` and `--tee` flags to redirect the console logs to files.
You can also use torchrun's native log redirection:
```bash
uv run torchrun \
@@ -29,57 +103,5 @@ uv run torchrun \
...
```
This will redirect the console logs to `outputs/torchrun/{rdzv_id}/attempt_0/{rank}/{stdout,stderr}.log`.
This writes to `outputs/torchrun/{rdzv_id}/attempt_0/{rank}/{stdout,stderr}.log`.
## W&B
For most runs we recommend logging to [W&B](https://wandb.ai). Before enabling W&B, make sure that you have an account and are logged in.
```bash
uv run wandb login
# Or set `export WANDB_API_KEY=...`
```
### SFT
Logging to W&B is disabled by default. Enable the default configuration with `--wandb`
```bash
uv run sft ... --wandb
```
This will log to the `prime-rl` project with a random run name. You can specify which project and name to log to
```bash
uv run sft ... --wandb.project my-project --wandb.name my-run
```
The same settings also work for multi-node training with `torchrun`. Note, that we only log global metrics from the master rank (e.g. the all-reduced loss)
```bash
uv run torchrun --nproc-per-node 8 ... --wandb
```
### RL
For RL training, both the trainer and orchestrator log to W&B as separate runs. Again, logging to W&B is disabled by default. Enable the default configuration with `--wandb`
```bash
uv run rl ... --wandb
```
This will log to the `prime-rl` project with a random run name. The trainer run is suffixed with `-trainer` and the orchestrator run is suffixed with `-orchestrator`. You can specify which project and name to log to using the same flags as for SFT.
```bash
uv run rl ... --wandb.project my-project --wandb.name my-run
```
For the RL trainer, we support logging samples (e.g. prompt, completion, reward, advantage for selected rollouts) and distributions (e.g. reward, advantage, entropy distributions) as W&B tables using the `wandb.log-extras` subconfig. If W&B is setup, this is enabled by default and will log for the RL trainer and orchestrator every 10 steps.
You can configure this on the trainer and orchestrator separately. For example, to only log samples on the orchestrator every 50 steps, but not distribution on either
```bash
uv run rl ... \
--no-trainer.wandb.log-extras.distributions \
--orchestrator.wandb.log-extras.interval 50
```
+55
View File
@@ -0,0 +1,55 @@
# Metrics
## W&B
For most runs we recommend logging metrics to [W&B](https://wandb.ai). Before enabling W&B, make sure that you have an account and are logged in.
```bash
uv run wandb login
# Or set `export WANDB_API_KEY=...`
```
### SFT
Logging to W&B is disabled by default. Enable the default configuration with `--wandb`
```bash
uv run sft ... --wandb
```
This will log to the `prime-rl` project with a random run name. You can specify which project and name to log to
```bash
uv run sft ... --wandb.project my-project --wandb.name my-run
```
The same settings also work for multi-node training with `torchrun`. Note, that we only log global metrics from the master rank (e.g. the all-reduced loss)
```bash
uv run torchrun --nproc-per-node 8 ... --wandb
```
### RL
For RL training, both the trainer and orchestrator log to W&B as separate runs. Again, logging to W&B is disabled by default. Enable the default configuration with `--wandb`
```bash
uv run rl ... --wandb
```
This will log to the `prime-rl` project with a random run name. The trainer run is suffixed with `-trainer` and the orchestrator run is suffixed with `-orchestrator`. You can specify which project and name to log to using the same flags as for SFT.
```bash
uv run rl ... --wandb.project my-project --wandb.name my-run
```
For the RL trainer, we support logging samples (e.g. prompt, completion, reward, advantage for selected rollouts) and distributions (e.g. reward, advantage, entropy distributions) as W&B tables using the `wandb.log-extras` subconfig. If W&B is setup, this is enabled by default and will log for the RL trainer and orchestrator every 10 steps.
You can configure this on the trainer and orchestrator separately. For example, to only log samples on the orchestrator every 50 steps, but not distribution on either
```bash
uv run rl ... \
--no-trainer.wandb.log-extras.distributions \
--orchestrator.wandb.log-extras.interval 50
```
+1
View File
@@ -14,6 +14,7 @@
"checkpointing",
"benchmarking",
"deployment",
"kubernetes",
"troubleshooting"
]
}
+243
View File
@@ -0,0 +1,243 @@
# MultiRunManager
The `MultiRunManager` object is a global singleton that manages the parameters and components for multiple concurrent training runs within a single trainer process.
This allows multiple orchestrator deployments to share the same trainer.
When `max_concurrent_runs > 1`, the trainer can train multiple runs in parallel. Each run:
- Has its own LoRA adapter parameters
- Has its own optimizer and scheduler
- Saves its own checkpoints
- Tracks its own training progress (step, tokens, samples)
- Loads its own orchestrator configuration
The `MultiRunManager` object provides:
- **Bidirectional mapping** between run IDs (e.g., `run_abc123`) and run indices (0, 1, 2, ...)
- **Progress tracking** per run (step count, total tokens, total samples)
- **Configuration management** for orchestrator configs
- **Distributed synchronization** across ranks via the PyTorch distributed store
- **LoRA module registration** for multi-adapter parameter management
- **Creation hooks** for initializing per-run resources (optimizers, schedulers)
- **Run eviction** for removing runs that are misbehaving
## **Initialization and run discovery**
The `MultiRunManager` singleton is set up at the start of training:
```python
from prime_rl.trainer.runs import setup_multi_run_manager, get_multi_run_manager
# Initialize with output directory and max concurrent runs
setup_multi_run_manager(output_dir=Path("outputs/my-experiment"), max_runs=4)
# Get the singleton instance anywhere in the codebase
multi_run_manager = get_multi_run_manager()
```
Each run's directory follows this structure:
```
{output_dir}/
├── run_abc123/
│ ├── control/
│ │ ├── orch.toml # Orchestrator configuration
│ │ ├── config_validation_error.txt # Config validation errors (if any)
│ │ └── evicted.txt # Eviction reason (if evicted)
│ ├── checkpoints/
│ │ └── step_100/ # Orchestrator checkpoints
│ ├── rollouts/
│ │ └── step_100/ # Rollouts
│ └── broadcast/
│ └── step_100/ # Broadcasted weights for inference
├── run_def456/
│ └── ...
└── ...
```
Runs are discovered by scanning the output directory for the pattern `run_*`. Each run must contain a valid orchestrator config at `{run_dir}/control/orch.toml` before they are added to the active runs otherwise they are ignored. When the maximum number of runs is reached, new `run_*` directories will not be picked up until old ones are deleted.
```python
# Master rank scans for new/deleted runs
multi_run_manager.discover_runs()
# All ranks synchronize state (must be called after discover_runs)
multi_run_manager.synchronize_state()
```
The `discover_runs()` method (master only):
1. Scans the output directory for `run_*` directories
2. Filters out evicted runs (those with `control/evicted.txt`)
3. Detects new runs and deleted runs
4. Calls `forgotten_hook` for deleted runs (master only)
5. Loads and validates the orchestrator config for each new run
6. Updates internal mappings and data structures
7. Calls `discovered_hook` for new runs (master only)
The `synchronize_state()` method (all ranks):
1. Master broadcasts run state to all ranks via the distributed store
2. Non-master ranks catch up by calling internal `_delete_run_data` / `_create_run_data`
3. All ranks execute `deletion_hook` for deleted runs
4. All ranks execute `creation_hook` for new runs (e.g., optimizer setup, LoRA parameter reset)
## Run Eviction
The master proc on the trainer can evict a run using the `evict_run(idx: int, reason: str)` method.
This is useful when the trainer detects an issue with a run that requires it to be stopped (e.g., invalid data, resource constraints, or policy violations).
```python
# Evict a run by its index (master only)
multi_run_manager.evict_run(idx=0, reason="Run exceeded memory limits")
```
The `evict_run()` method (master only):
1. Writes the eviction reason to `{run_dir}/control/evicted.txt`
2. Logs a warning with the eviction details
3. The run is **not** immediately removed from the manager's data structures
The eviction takes effect through two mechanisms:
**On the trainer side:**
- The next `discover_runs()` call will filter out the evicted run (it checks for `evicted.txt`)
- The run will then be treated as deleted, triggering forgotten/deletion hooks
- The run index is returned to the unused pool
**On the orchestrator side:**
- The orchestrator checks for `evicted.txt` at the start of each iteration in its main loop
- If found, it raises a `RuntimeError` with the eviction reason, causing the orchestrator to exit
- This surfaces the eviction reason to the user
## LoRA Module Registration
LoRA modules register themselves with `MultiRunManager` for parameter management:
```python
# In apply_lora_to_model()
lora_module = MultiLoRALinear(
base_layer=base_module,
rank=config.rank,
n_adapters=get_multi_run_manager().max_runs,
...
)
lora_module.register_with_runs(get_multi_run_manager(), module_name)
```
The `MultiRunManager` object then exposes:
```python
# Get parameters for a specific run (used by optimizer creation)
multi_run_manager.get_named_parameters_for_run(idx)
# Get state dict for a specific run (used by weight broadcast)
multi_run_manager.get_state_dict_for_run(idx)
# Reset parameters for a new run
multi_run_manager.reset_run_parameters(idx)
```
## Hooks
The `MultiRunManager` object supports several types of hooks for different lifecycle events.
Deletion hooks are always called before creation hooks.
```mermaid
flowchart TD
subgraph master["Rank 0 (Master)"]
discover["discover_runs()"]
forgotten["forgotten_hooks"]
validation["config_validation_hooks"]
discovered["discovered_hooks"]
discover --> forgotten
forgotten --> validation
validation --> discovered
discovered --> discover
end
subgraph rank1["Rank 1"]
wait1["waiting..."]
end
subgraph rankN["Rank N"]
waitN["waiting..."]
end
discovered --> barrier
wait1 --> barrier
waitN --> barrier
barrier[["synchronize_state()"]]
barrier --> deletion["deletion_hooks"]
deletion --> creation["creation_hooks"]
style barrier fill:#fff9c4
```
### Hook Registration
```python
# These hooks are only called on the master as only master uses `discover_runs()`
# These hooks are thus only relevant to master only components (packer)
multi_run_manager.register_discovered_hook(callback)
multi_run_manager.register_forgotten_hook(callback)
# These hooks are executed by all ranks in the order they were added during `synchronize_state()`
# This ensures DTensor creations and other distributed operations happen together
# Calling torch.dist.barrier() in a hook here should work
multi_run_manager.register_creation_hook(callback)
multi_run_manager.register_deletion_hook(callback)
# These hooks validate the orchestrator config when runs are discovered:
multi_run_manager.register_config_validation_hook(callback)
```
The callback signatures:
```python
def discovered_callback(idx: int, run_id: str, config: OrchestratorConfig) -> None:
"""Called when a new run is discovered (master only).
Args:
idx: The run's index (0 to max_runs-1)
run_id: The run's ID (e.g., "run_abc123")
config: The orchestrator config for the run
"""
# Example: Set the scaling factor for the run
multi_run_manager.scaling_factors[idx] = config.model.lora.alpha / config.model.lora.rank
def forgotten_callback(idx: int, run_id: str) -> None:
"""Called when a run is forgotten/removed (master only).
Args:
idx: The run's index (0 to max_runs-1)
run_id: The run's ID (e.g., "run_abc123")
"""
pass
def callback(idx: int, run_id: str) -> None:
"""Called when a run is created/deleted.
Args:
idx: The run's index (0 to max_runs-1)
run_id: The run's ID (e.g., "run_abc123")
"""
pass
def config_validation_callback(config: OrchestratorConfig) -> tuple[bool, str]:
"""Validate an orchestrator config.
Args:
config: The orchestrator config to validate
Returns:
(is_valid, error_message): If invalid, error_message is written to config dir
"""
return True, ""
```
+67
View File
@@ -0,0 +1,67 @@
# Multimodal (VLM) Support
Prime-RL has experimental support for training vision-language models (VLMs) like Qwen3-VL.
## Current Limitations
- **No SFT support**: Supervised fine-tuning is not yet supported for VLM models. Only RL training is available.
- **Vision encoder is frozen**: The vision encoder is automatically frozen during training. Only the language model is trained.
- **No multimodal-safe truncation**: Token sequences are truncated to `seq_len`, but `pixel_values` and `image_grid_thw` are passed through unchanged. If a multimodal sample exceeds `seq_len`, image tokens can be dropped while image tensors still describe the full set of images. Ensure `seq_len` covers your longest VLM samples or avoid overlong rollouts.
- **The images that the VLM sees are not logged**
- **Optimization dtype must be bfloat16**: VLM models must load in bfloat16 to match vLLM inference. If the trainer uses a different dtype, the vision encoder produces different `pixel_values`, causing a mismatch between inference and training. A workaround would be to propagate the `pixel_values` computed by vLLM to the trainer, but this is more involved. For now, set `optimization_dtype = "bfloat16"` and `reduce_dtype = "bfloat16"` in your trainer config.
- **Higher KL mismatch with multi-image inputs**: VLM training exhibits higher KL mismatch between inference and trainer logprobs compared to text-only models, especially with multiple images per sample. We are investigating the root cause. The existing importance ratio masking thresholds should handle reasonable mismatches.
- **VLM requires branching strategy**: Multimodal training must use `trajectory_strategy = "branching"` in your orchestrator config. The interleaved strategy doesn't work because vLLM tokenizes images differently at different conversation states, causing token prefix mismatches between trajectory steps. Branching treats each step independently, avoiding this issue.
## vLLM Configuration
When using vLLM for inference with VLM models, you must set these environment variables to avoid issues with multimodal models:
```bash
export VLLM_ENABLE_V1_MULTIPROCESSING=0
export VLLM_WORKER_MULTIPROC_METHOD=spawn
```
## Why Interleaved Strategy Doesn't Work for VLMs
The interleaved trajectory strategy fails for VLM conversations due to how vLLM's `/tokenize` endpoint handles images.
### The Problem
For multi-turn conversations, the interleaved strategy uses the Token-In Token-Out API:
1. **Turn 1**: Uses standard `/chat/completions` endpoint
- vLLM properly processes images and expands `<|image_pad|>` placeholders
- Example: 2 images → 128 tokens (64 per image based on grid dimensions)
2. **Turn 2+**: Uses `/chat/completions/tokens` with pre-tokenized prompt
- Tokens are computed by calling vLLM's `/tokenize` endpoint
- **`/tokenize` does NOT expand image tokens** - it returns raw `<|image_pad|>` tokens (1 per image)
- Example: 2 images in turn 2 → only 2 tokens instead of 128
3. **Mismatch**: The model validates that `count(image_tokens) == image_features` and fails:
```
ValueError: Image features and image tokens do not match: tokens: 130, features: 256
```
### Technical Details
- vLLM's `/tokenize` uses `apply_chat_template(tokenize=False)` followed by basic tokenization
- Image token expansion happens later in the model executor layer via `PromptReplacement`
- The HuggingFace processor can properly expand image tokens, but the tokenize endpoint doesn't use it
### Why Branching Works
The branching strategy creates separate `TrainingSample` objects per turn. Each sample goes through the standard `/chat/completions` endpoint which properly expands image tokens. Tokens and `pixel_values` are always matched per-turn.
### Configuration
```toml
[orchestrator]
trajectory_strategy = "branching" # Required for VLM
```
+73
View File
@@ -0,0 +1,73 @@
# On-Policy Distillation
On-policy distillation uses a teacher model to provide dense token-level feedback during RL training. The student generates rollouts, and the teacher's logprobs guide the student to stay close to stronger behavior while still learning from rewards.
For more details, see [On-Policy Distillation](https://thinkingmachines.ai/blog/on-policy-distillation/) by Thinking Machines.
## Quick Start
Add `teacher_gpu_ids` and set `teacher_tau > 0`:
```toml
teacher_gpu_ids = [2, 3]
[trainer.loss]
teacher_tau = 0.5
```
This automatically starts a teacher inference server using the same model as inference. To use a different teacher model:
```toml
teacher_gpu_ids = [2, 3]
[teacher_inference.model]
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
[trainer.loss]
teacher_tau = 0.5
```
## Using an External Teacher Server
If the teacher is already running elsewhere:
```toml
[trainer.loss]
teacher_tau = 0.5
[orchestrator.teacher_model.client]
base_url = ["http://teacher-server:8000/v1"]
[orchestrator.teacher_model.model]
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
```
## Pure Distillation (No Verification)
For agentic environments where verification is expensive (code execution, tool use, multi-turn interactions), you can skip verification entirely and use only the teacher signal:
```toml
teacher_gpu_ids = [2, 3]
[trainer.loss]
teacher_tau = 1.0
adv_tau = 0.0 # Disable reward-based learning
[orchestrator.buffer]
skip_verification = true # Skip expensive verification
```
This runs pure on-policy distillation: the student learns to match the teacher without needing any reward signal.
## Parameters
| Parameter | Default | Description |
|-----------|---------|-------------|
| `teacher_gpu_ids` | `None` | GPUs for teacher server. Auto-starts server when set. |
| `trainer.loss.teacher_tau` | `0.0` | Distillation strength. Set `> 0` to enable. |
| `trainer.loss.adv_tau` | `1.0` | Weight for RL advantage signal. Set `0` for pure distillation. |
| `orchestrator.buffer.skip_verification` | `false` | Skip verification. Use with `adv_tau = 0`. |
## Monitoring
The `teacher_kl` metric shows the KL divergence from teacher to student. Lower values mean the student is closer to the teacher.
-23
View File
@@ -1,23 +0,0 @@
# Runs
The `Runs` object is a singleton that manages multiple concurrent training runs within a single trainer process. It is the central coordination point for multi-run RL training, enabling a single trainer to serve multiple orchestrator experiments simultaneously with separate LoRA adapters, optimizers, and schedulers.
## Overview
When `max_concurrent_runs > 1`, the trainer can train multiple runs in parallel. Each run:
- Has its own LoRA adapter weights
- Has its own optimizer and scheduler
- Tracks its own training progress (step, tokens, samples)
- Loads its own orchestrator configuration
| Responsibility | Description |
|---------------|-------------|
| **Discovery** | Scans for `run_*` directories and loads configs |
| **Mapping** | Provides bidirectional run ID ↔ index mapping |
| **Progress** | Tracks per-run training step, tokens, samples |
| **Synchronization** | Keeps all ranks in sync via distributed store |
| **Hooks** | Enables lazy initialization of per-run resources |
| **LoRA Management** | Registers modules for multi-adapter parameter access |
| **State Access** | Provides per-run parameters and state dicts |
This design enables efficient multi-tenant training where a single trainer can serve multiple experiments with independent adapter weights, optimizers, and learning rate schedules.
+1 -1
View File
@@ -12,7 +12,7 @@ project = "alphabet-sort"
name = "alphabet-sort"
[trainer.model]
impl = "liger_kernel"
impl = "auto"
[trainer.model.ac]
freq = 1
+2
View File
@@ -21,4 +21,6 @@ id = "reverse-text"
[trainer.optim]
lr = 3e-6
[ckpt] # Checkpoint at the end of training
[inference]
+2
View File
@@ -11,3 +11,5 @@ max_tokens = 128
[[env]]
id = "reverse-text"
[ckpt]
+3 -1
View File
@@ -4,4 +4,6 @@ max_steps = 20
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
[optim]
lr = 3e-6
lr = 3e-6
[ckpt]
+3 -1
View File
@@ -9,4 +9,6 @@ seq_len = 4096
batch_size = 32
[optim]
lr = 2e-5
lr = 2e-5
[ckpt] # Checkpoint at the end of training
+5 -2
View File
@@ -17,7 +17,6 @@ weight_decay = 0.0
[trainer.model.lora]
rank = 8
alpha = 32
dropout = 0.0
target_modules = [
"q_proj",
@@ -33,7 +32,9 @@ target_modules = [
batch_size = 512
rollouts_per_example = 16
oversampling_factor = 2.0
lora_name = "qwen3-4b-wiki-search"
[orchestrator.model.lora]
name = "qwen3-4b-wiki-search"
[orchestrator.sampling]
max_tokens = 512
@@ -44,6 +45,8 @@ online_difficulty_filtering = true
[[orchestrator.env]]
id = "primeintellect/wiki-search"
[ckpt] # Checkpoint at the end of training
[inference.model]
enable_auto_tool_choice = true
tool_call_parser = "hermes"
+42 -258
View File
@@ -2,288 +2,72 @@
This directory contains a Helm chart for deploying PRIME-RL training infrastructure on Kubernetes clusters.
For complete documentation, see the [Kubernetes guide](https://docs.primeintellect.ai/prime-rl/kubernetes).
## Quick Start
```bash
# Deploy with the reverse-text example
helm install my-exp ./prime-rl -f ./prime-rl/examples/reverse-text.yaml
# Verify deployment
kubectl get pods -l app.kubernetes.io/instance=my-exp
# Exec into trainer and run training
kubectl exec -it my-exp-trainer-0 -- bash
cd /data && uv run trainer @ /app/examples/reverse_text/configs/train.toml
```
## Prerequisites
- Kubernetes cluster with GPU nodes
- [NVIDIA GPU Operator](https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/getting-started.html) installed
- [Helm 3.x](https://helm.sh/docs/intro/install/) installed
- Storage class that supports `ReadWriteMany` (e.g., NFS, CephFS, or cloud provider storage)
- Storage class that supports `ReadWriteMany` (e.g., NFS, CephFS)
### Verify Prerequisites
## Chart Structure
```bash
# Check Helm installation
helm version
# Check GPU operator
kubectl get pods -n gpu-operator
# Check available storage classes
kubectl get storageclass
```
## Quick Start
### 1. Deploy
```bash
# Deploy with a release name
helm install my-exp ./prime-rl -f ./prime-rl/examples/reverse-text.yaml
# Or with defaults (no example-specific config)
helm install my-exp ./prime-rl --set trainer.replicas=3 --set inference.replicas=2
prime-rl/
├── Chart.yaml
├── values.yaml # Default configuration
├── examples/
│ └── reverse-text.yaml # Example values for reverse-text
└── templates/
├── deployment.yaml # StatefulSets for orchestrator, inference, trainer
├── service.yaml # Headless services for pod discovery
└── pvc.yaml # Shared storage
```
### 2. Verify deployment
```bash
# Check pod status
kubectl get pods -l app.kubernetes.io/instance=my-exp
# Should show 3 pods:
# my-exp-orchestrator-0
# my-exp-inference-0
# my-exp-trainer-0
```
### 3. Run training
```bash
# Exec into trainer
kubectl exec -it my-exp-trainer-0 -- bash
# Inside the pod, run training
cd /data
uv run trainer @ /app/examples/reverse_text/configs/train.toml
```
### 4. Monitor progress
```bash
# Get logs
kubectl logs my-exp-trainer-0
# Follow logs in real-time
kubectl logs -f my-exp-trainer-0
```
## Available Examples
The chart includes pre-configured values for each example:
### reverse-text (Small - 1 GPU)
```bash
helm install my-exp ./prime-rl -f ./prime-rl/examples/reverse-text.yaml
```
- Model: Qwen3-0.6B
- GPUs: 1 per component
- Runs on consumer GPUs (RTX 3090/4090)
- **Note:** You can use any release name - the chart automatically configures service URLs
## Configuration
### Storage Configuration
By default, the chart creates a 1TB PVC with NFS storage. To customize:
```yaml
# custom-values.yaml
storage:
storageClassName: my-storage-class
size: 500Gi
```
Deploy with custom storage:
```bash
helm install my-release ./prime-rl -f custom-values.yaml
```
### GPU Configuration
Adjust GPU count per component:
```yaml
# custom-gpu.yaml
inference:
gpu:
count: 4 # Use 4 GPUs for inference
trainer:
gpu:
count: 2 # Use 2 GPUs for training
```
### Resource Limits
Customize memory and CPU:
```yaml
# custom-resources.yaml
trainer:
resources:
requests:
memory: "64Gi"
cpu: "16"
limits:
memory: "128Gi"
cpu: "32"
```
### Secrets (Optional)
For W&B and HuggingFace authentication:
See [values.yaml](./prime-rl/values.yaml) for all available options. Common overrides:
```bash
# Create secret
# Custom GPU allocation
helm install my-exp ./prime-rl \
--set inference.gpu.count=4 \
--set trainer.gpu.count=2
# With secrets for W&B/HF
kubectl create secret generic prime-rl-secrets \
--from-literal=wandb-api-key=YOUR_WANDB_KEY \
--from-literal=hf-token=YOUR_HF_TOKEN
--from-literal=wandb-api-key=YOUR_KEY \
--from-literal=hf-token=YOUR_TOKEN
# Enable in values
helm install my-release ./prime-rl \
helm install my-exp ./prime-rl \
--set config.secrets.enabled=true \
--set config.secrets.name=prime-rl-secrets
```
## Common Operations
### Deploy a new experiment
```bash
# With example config
helm install my-exp ./prime-rl -f ./prime-rl/examples/reverse-text.yaml
# With custom settings
helm install my-exp ./prime-rl --set trainer.replicas=10 --set inference.replicas=5
```
### Exec into pods
```bash
# Exec into trainer-0
kubectl exec -it my-exp-trainer-0 -- bash
# Exec into specific trainer pod
kubectl exec -it my-exp-trainer-3 -- bash
# Exec into inference
kubectl exec -it my-exp-inference-0 -- bash
```
### View logs
```bash
# Get logs from trainer-0
kubectl logs my-exp-trainer-0
# Follow logs in real-time
kubectl logs -f my-exp-trainer-2
# Get logs from all trainers
kubectl logs -l app.kubernetes.io/instance=my-exp,role=trainer
```
### List all pods
```bash
# List pods for specific experiment
kubectl get pods -l app.kubernetes.io/instance=my-exp
# List all prime-rl pods
kubectl get pods -l app=prime-rl
```
## Architecture
### Components
The chart deploys three main components (all using StatefulSets):
1. **Orchestrator** (StatefulSet) - Coordinates training workflow
- Always 1 replica: `prime-rl-orchestrator-0`
- No GPU required
- Communicates with trainer and inference
2. **Inference** (StatefulSet) - Runs vLLM inference server
- Scalable replicas with stable pod names: `prime-rl-inference-0`, `prime-rl-inference-1`, ...
- Each pod gets predictable DNS: `prime-rl-inference-0.prime-rl-inference-headless.default.svc.cluster.local`
- Requires GPU(s)
- Serves model predictions
3. **Trainer** (StatefulSet) - Runs SFT or RL training
- Scalable replicas with stable pod names: `prime-rl-trainer-0`, `prime-rl-trainer-1`, ...
- Each pod gets predictable DNS: `prime-rl-trainer-0.prime-rl-trainer-headless.default.svc.cluster.local`
- Requires GPU(s)
- Updates model weights on shared storage
**Why StatefulSets for all components?**
- **Consistent naming**: All pods have predictable names (`orchestrator-0`, `trainer-0`, `trainer-1`, ...)
- **Stable networking**: Each pod gets its own DNS hostname via headless service
- **Required for distributed training**: PyTorch/vLLM need to discover peers by stable hostname
- **Clean naming**: No random pod suffixes, easier to identify and debug
### Shared Storage
All components mount the same PVC at `/data` for:
- Model checkpoint sharing
- Training data
- Experiment outputs
This is **required** for coordinating weight updates between trainer and inference.
## Troubleshooting
### Can't access shared storage
Verify PVC is bound:
```bash
kubectl get pvc prime-rl-shared-data
# STATUS should be "Bound"
```
Check mount inside pod:
```bash
kubectl exec -it prime-rl-trainer-xxx -- df -h /data
```
## Uninstalling
```bash
# Remove the Helm release
helm uninstall my-exp
# Delete PVC (data will be lost!)
kubectl delete pvc prime-rl-shared-data
kubectl delete pvc prime-rl-shared-data # Warning: deletes data!
```
## Environment Variables
## Learn More
Each pod has these K8s environment variables set:
- `$POD_NAME` - Full pod name (e.g., `my-exp-trainer-3`)
- `$POD_IP` - Pod IP address
- `$STATEFUL_REPLICAS` - Total number of replicas for that component
- `$HEADLESS_SERVICE` - DNS name for peer discovery (e.g., `my-exp-trainer-headless.default.svc.cluster.local`)
- `$INFERENCE_URL` - Full URL to the first inference pod (available in orchestrator and trainer pods)
For distributed training, extract the rank from the pod name:
```bash
# Extract ordinal from pod name
RANK=$(echo $POD_NAME | grep -o '[0-9]*$') # e.g., "my-exp-trainer-3" -> "3"
# Use in torchrun
torchrun \
--nnodes=$STATEFUL_REPLICAS \
--node-rank=$RANK \
--nproc-per-node=8 \
--rdzv-endpoint=my-exp-trainer-0.$HEADLESS_SERVICE:29501 \
src/prime_rl/trainer/sft/train.py @ /app/examples/reverse_text/sft/train.toml
```
## Next Steps
- Read the [deployment guide](../docs/deployment.md) for production best practices
- Check the [reverse_text example](../examples/reverse_text/README.md) for a complete walkthrough
- See [troubleshooting guide](../docs/troubleshooting.md) for common issues
- [Full Kubernetes documentation](https://docs.primeintellect.ai/prime-rl/kubernetes) - Architecture, configuration, distributed training
- [Deployment guide](https://docs.primeintellect.ai/prime-rl/deployment) - Non-Kubernetes deployments
- [Troubleshooting](https://docs.primeintellect.ai/prime-rl/troubleshooting) - Common issues
+48
View File
@@ -117,6 +117,7 @@ metadata:
spec:
serviceName: {{ .Release.Name }}-inference-headless
replicas: {{ .Values.inference.replicas }}
podManagementPolicy: Parallel
selector:
matchLabels:
{{- include "prime-rl.componentLabels" . | nindent 6 }}
@@ -196,6 +197,29 @@ spec:
memory: {{ .Values.inference.resources.limits.memory }}
cpu: {{ .Values.inference.resources.limits.cpu }}
{{- end }}
{{- if and .Values.inference.probes .Values.inference.probes.enabled }}
startupProbe:
httpGet:
path: /health
port: {{ .Values.inference.service.port }}
periodSeconds: {{ .Values.inference.probes.startup.periodSeconds }}
failureThreshold: {{ .Values.inference.probes.startup.failureThreshold }}
timeoutSeconds: {{ .Values.inference.probes.startup.timeoutSeconds }}
livenessProbe:
httpGet:
path: /health
port: {{ .Values.inference.service.port }}
periodSeconds: {{ .Values.inference.probes.liveness.periodSeconds }}
failureThreshold: {{ .Values.inference.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.inference.probes.liveness.timeoutSeconds }}
readinessProbe:
httpGet:
path: /health
port: {{ .Values.inference.service.port }}
periodSeconds: {{ .Values.inference.probes.readiness.periodSeconds }}
failureThreshold: {{ .Values.inference.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.inference.probes.readiness.timeoutSeconds }}
{{- end }}
{{- if .Values.storage.enabled }}
volumeMounts:
- name: shared-data
@@ -222,6 +246,7 @@ metadata:
spec:
serviceName: {{ .Release.Name }}-trainer-headless
replicas: {{ .Values.trainer.replicas }}
podManagementPolicy: Parallel
selector:
matchLabels:
{{- include "prime-rl.componentLabels" . | nindent 6 }}
@@ -318,6 +343,29 @@ spec:
memory: {{ .Values.trainer.resources.limits.memory }}
cpu: {{ .Values.trainer.resources.limits.cpu }}
{{- end }}
{{- if and .Values.trainer.probes .Values.trainer.probes.enabled }}
startupProbe:
httpGet:
path: /health
port: {{ .Values.trainer.service.port }}
periodSeconds: {{ .Values.trainer.probes.startup.periodSeconds }}
failureThreshold: {{ .Values.trainer.probes.startup.failureThreshold }}
timeoutSeconds: {{ .Values.trainer.probes.startup.timeoutSeconds }}
livenessProbe:
httpGet:
path: /health
port: {{ .Values.trainer.service.port }}
periodSeconds: {{ .Values.trainer.probes.liveness.periodSeconds }}
failureThreshold: {{ .Values.trainer.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.trainer.probes.liveness.timeoutSeconds }}
readinessProbe:
httpGet:
path: /health
port: {{ .Values.trainer.service.port }}
periodSeconds: {{ .Values.trainer.probes.readiness.periodSeconds }}
failureThreshold: {{ .Values.trainer.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.trainer.probes.readiness.timeoutSeconds }}
{{- end }}
{{- if .Values.storage.enabled }}
volumeMounts:
- name: shared-data
+34
View File
@@ -75,6 +75,23 @@ inference:
runtimeClassName: nvidia
# Health probes for inference server (requires /health endpoint)
probes:
enabled: false
# Startup probe: allows long model loading time (up to 45 min by default)
startup:
periodSeconds: 10
failureThreshold: 270 # 270 * 10s = 45 min max startup time
timeoutSeconds: 5
liveness:
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 60
readiness:
periodSeconds: 5
failureThreshold: 2
timeoutSeconds: 5
# Trainer component
trainer:
enabled: true
@@ -106,6 +123,23 @@ trainer:
runtimeClassName: nvidia
# Health probes for trainer (requires metrics_server config)
probes:
enabled: false
# Startup probe: allows time for model loading
startup:
periodSeconds: 10
failureThreshold: 60 # 60 * 10s = 10 min max startup time
timeoutSeconds: 30
liveness:
periodSeconds: 30
failureThreshold: 6 # 6 * 30s = 3 min before restart
timeoutSeconds: 30
readiness:
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 30
# Additional configuration
config:
# Example name (used for labeling)

Some files were not shown because too many files have changed in this diff Show More