Compare commits

...
125 Commits
Author SHA1 Message Date
1a588975bf Devx version tag automation (#1783)
Release / Push CUDA image to Docker (push) Canceled after 0s
* ci: auto-create dev tags from latest release

Co-authored-by: samsja <samsja@users.noreply.github.com>

* ci: split dev tag workflow and handle missing releases

Co-authored-by: samsja <samsja@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: samsja <samsja@users.noreply.github.com>
2026-02-14 16:56:44 -08:00
Mika SenghaasandGitHub 82417b0158 vllm validation patches (#1782) 2026-02-14 15:35:56 -08:00
Mika SenghaasandGitHub c0657c5d43 fix custom token endpoint (#1781) 2026-02-14 15:35:46 -08:00
Mika SenghaasandGitHub 4ae67c32cc clean deps (#1750)
* bump vf bc9fcd5

* clean pyproject

* add back reverse-text

* remove accelerate

* bring back liger

* revert lock file

* copy lock

* update lock

* revert lock

* update all
2026-02-14 15:35:35 -08:00
8f2e6bbccc bump vllm to 0.16 and transformer to 5 (#1731)
* add glm flash

* update vllm to nighjlty

* fix moe

* fix glm

* fix ruff

* fix: resolve unit test failures

- Add return_dict=False to apply_chat_template calls in SFT data processing
  (transformers now returns BatchEncoding by default instead of list[int])
- Handle missing pad_token_id in MoE model config for test_perf_counter

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

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

* fix: update models for transformers 5.0.0 compatibility

- Remove deprecated rope_config_validation calls from configs
- Add pad_token_id attribute to MoE configs
- Add compute_default_rope_parameters to RotaryEmbedding classes
- Add attribute_map for num_local_experts in Glm4MoeConfig
- Override get_correct_experts_implementation in PreTrainedModelPrimeRL
- Update state dict conversion to handle new fused gate_up_proj format

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

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

* fix: address Cursor bot review comments

- Fix temperature parameter type in Glm4MoeLiteForCausalLM (High):
  Changed from Optional[float] = 1.0 to Optional[torch.Tensor] = None
  to match other models and avoid crash with FusedOutputLinear

- Fix SDPA/flex_attn support flags (Medium):
  Set _supports_sdpa and _supports_flex_attn to False since the model
  only implements flash attention

- Update GLM4MoeLite conversion for transformers 5.0 fused format (High):
  Added support for new gate_up_proj fused format in convert_hf_layer_to_tt
  and convert_tt_layer_to_hf to match glm4_moe and qwen3_moe

- Fix return_dict keyword argument order in sft/data.py (Low):
  Use dict merge pattern to avoid duplicate keyword argument crash
  when chat_template_kwargs contains return_dict

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

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

* fix: update is_hf_state_dict to detect transformers 5.0 fused format

The is_hf_state_dict methods now check for both:
- Old per-expert format: mlp.experts.1.up_proj
- New fused format (transformers 5.0+): mlp.experts.gate_up_proj

Updated in: glm4_moe, glm4_moe_lite, qwen3_moe

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

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

* fix smth

* fix glm

* remove glm flash

* fix: format serving_chat_with_tokens.py

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

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

* fix: update vllm 0.15 API compatibility

- Remove get_prompt_components import, use _extract_prompt_text instead
- Rename update_weights to update_weights_from_path to avoid conflict with vllm's built-in method

* feat: add revert_weight_conversion for transformers models

For non-PrimeRL transformers models (e.g., Glm4MoeLiteForCausalLM),
the internal fused format (experts.gate_up_proj) needs to be reverted
to the original HF hub format (experts.{j}.gate_proj.weight) for vLLM
compatibility.

Uses transformers' built-in revert_weight_conversion which:
- Unfuses MoE expert weights for models with conversion mappings
- No-ops for dense models (returns state_dict unchanged)

Applied to:
- ckpt.py: checkpoint saving
- nccl.py: NCCL weight broadcast
- filesystem.py: filesystem weight broadcast

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

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

* fix: CI vLLM CUDA bug and update baselines for transformers 5.0

- Add VLLM_WORKER_MULTIPROC_METHOD=spawn to fix CUDA driver init bug
- Update benchmark baselines for transformers 5.0 memory usage:
  - 1-GPU: 19.5 GiB -> 22.7 GiB
  - 4-GPU: 12.4 GiB -> 14.1 GiB

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

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

* docs: add clarifying comments for vLLM 0.15 API changes

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

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

* Revert "docs: add clarifying comments for vLLM 0.15 API changes"

This reverts commit 84c62da44dba60dc5c712a21bdf903908b83de0b.

* bump t5 and vllm

* bump fa

* chore: sync uv.lock after rebase

* feat: update transformers to support GLM-5

Update transformers to main branch (commit 609e3d5) which includes
GlmMoeDsa (GLM-5) support. Add override-dependency to work around
vllm's transformers<5 constraint.

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

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

* fix: restore weight tying after to_empty() for HF models

The to_empty() call breaks weight tying by allocating separate tensors
for lm_head.weight and embed_tokens.weight. This adds tie_weights() calls
after to_empty() to restore proper weight sharing.

Also reverts benchmark baselines to original values since the fix
eliminates the memory regression.

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

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

* chore: update baselines for transformers 5.0 memory usage

Transformers 5.0 uses ~16% more peak memory. The tie_weights() fix
doesn't help because FSDP already preserves weight tying through
to_empty(). Accept the new memory baseline.

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

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

* chore: upgrade to vLLM 0.16.0 official release

Use the official vLLM 0.16.0 release wheel from GitHub releases
instead of the nightly index. Key features:
- PyTorch 2.10 support
- Transformers v5 compatibility
- GLM-5 model support

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

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

* fix: add attribute_map for MoE configs transformers 5.0 compatibility

Add attribute_map = {"num_local_experts": "num_experts"} to Qwen3MoeConfig
and AfmoeConfig to match the pattern used in Glm4MoeConfig for
transformers 5.0 compatibility.

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

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

---------

Co-authored-by: sami jaghouar <sami@primeintellect.ai>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:00:38 -08:00
Mika SenghaasandGitHub a3251c9e52 set recompile limits (#1778) 2026-02-13 12:32:34 -08:00
samsjaandGitHub a81f9bcfa1 fix uv warning (#1772) 2026-02-12 17:23:55 -08:00
258638503c Add --dump-config flag to rl command (#1771)
* Add `--dump-config` flag to rl command

Adds a `dump_config: Path | None` parameter to `RLConfig`. When set,
resolved subconfigs are written to the given directory and the process
exits without starting any services.

Also refactors config serialization into a shared `write_subconfigs`
function used by both the dump path and the normal run path.

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

* Add dump_config entry to CHANGELOG

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

* Add warning messages to --dump-config mode

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

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:23:44 -08:00
Ido HakimiandGitHub 491d891825 Fix torch distributed warning messge by adding device_id handling (#1756) 2026-02-12 16:07:31 -08:00
b55dcaa356 set default api key var to vllm (#1767)
* use VLLM_API_KEY by default

* add CHANGELOG entry for api_key_var default change

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

---------

Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: samsja <55492238+samsja@users.noreply.github.com>
2026-02-12 13:47:41 -08:00
Mika SenghaasandGitHub e327ca2600 log env name not env id (#1768) 2026-02-12 12:21:57 -08:00
Varun SinghandGitHub 05682882da add flash attn for afmoe (#1766)
* add flash attn for afmoe

* run ruff format
2026-02-12 11:36:44 -08:00
Varun SinghandGitHub 0db8d49f48 fix muon hparam passthrough (#1754)
* fix muon hparam passthrough

* ruff format
2026-02-12 11:36:08 -08:00
faresobeidandGitHub b84a07a251 fix off policy tracker bug (#1764) 2026-02-12 03:08:14 -08:00
f274fa312a fix weight checkpoint saving for tied-embedding models (#1765)
Co-authored-by: kalomaze <kalomaze@users.noreply.github.com>
2026-02-11 23:28:18 -08:00
samsjaandGitHub 67ab5d1da6 add mini moe (#1759) 2026-02-11 17:21:14 -08:00
JannikStandGitHub 8117c00ad6 Fix checkpoint step ordering bug (#1762)
Use bisect.insort to maintain sorted order when adding new checkpoint steps.
Previously, appending to the list could break sort order when saving a checkpoint
with a step number lower than existing ones, causing AssertionError in maybe_clean().
2026-02-11 17:24:17 +01:00
Jackmin801andGitHub 08f8c643cf Fix checkpoint cleanup crashing trainer on OSError (#1763)
* Fix checkpoint cleanup crashing trainer on OSError

When external processes (e.g. checkpoint uploader) hold open file handles
on checkpoint directories, shutil.rmtree can fail with "Directory not
empty". Skip the deletion and log a warning instead of crashing — the
next maybe_clean call will retry.

* Retain failed-to-delete steps in ckpt_steps for retry

Steps where rmtree fails were being removed from ckpt_steps, making
them orphaned and never retried. Track which deletions succeed and
only remove those from the list.

* Restore debug logging before checkpoint deletion

* Revert ckpt_steps tracking, just skip failed deletions

The steps_deleted tracking caused state divergence across ranks since
only master populates it. Keep the original ckpt_steps pruning logic
and accept potential disk leak over complexity.
2026-02-11 00:37:56 -08:00
Jackmin801andGitHub 869717456f Fix model weight loading: crash fix and memory optimization (#1760)
* Fix IndexError in load_state_dict sort for non-standard safetensor filenames

The sort assumed filenames follow the `model-NNNNN-of-NNNNN.safetensors`
convention, crashing on files like `model.safetensors`. The sort is
unnecessary since the function merges all shards into a flat dict where
key order doesn't matter.

* Only load full snapshot on master rank for format conversion

Previously all ranks loaded the full model weights into CPU memory just
to check key names for format detection. Now all ranks read only the
safetensor key names (no tensor data), and only master loads the full
state dict when conversion is actually needed.
2026-02-11 00:22:56 -08:00
294cd9f541 chore: bump wandb to 0.24.2 (#1758)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: samsja <samsja@users.noreply.github.com>
2026-02-10 19:56:53 -08:00
manveerandGitHub b05c0392e4 ENG-2586: Use presigned URLs when uploading samples (#1620)
* Use presigned URLs when uploading samples

* bugbot

* bugbot

* ruff format

* bugbot

* Simplify

* Update lock
2026-02-10 08:53:39 +01:00
crStivandGitHub 6fd4f698c2 docs: fix typos (#1751)
* Fix typo in precedence explanation in configs.md

Signed-off-by: crStiv <cryptostiv7@gmail.com>

* Fix typos and improve clarity in deployment.md

Signed-off-by: crStiv <cryptostiv7@gmail.com>

---------

Signed-off-by: crStiv <cryptostiv7@gmail.com>
2026-02-09 20:42:36 -08:00
DominikandGitHub 1ebb7dd439 Fix eval metrics type not json serializable. (#1752) 2026-02-09 20:04:56 -08:00
Jackmin801andGitHub 050490e0f6 Fix broadcast alpha rank (#1729)
* save lora config with orchestrator alpha and rank

* move alpha definition to orchestrator

* making rank default to trainers rank makes more sense
2026-02-09 16:14:14 -08:00
Mika SenghaasandGitHub a35a721817 bump vf (bc9fcd5) (#1749)
* bump vf bc9fcd5

* update lock

* retrigger ci
2026-02-09 09:54:39 -08:00
halleriteandGitHub 5cdada6457 add directory for skills & skill for starting prime-rl's vllm server (#1747)
* add skills dir & first skill for vllm

* remove unimplemented stuff

* make symlink relative

* make separate config skill

* update AGENTS.md & skills

* make more explicit
2026-02-08 21:13:07 -08:00
31b48b8b10 env worker integration (#1714)
* start env servers for env group

* bump

* working reverse-text

* correctly set log levels

* use client configs everywhere + make val work

* cycle through clients via inference pool

* update model name

* deprecate env worker

* implement evals

* deprecate evals+synthesize

* deprecate serialization

* use all clients for evals

* simplify config

* fix types and use inference pool for opd

* bring back logging intercept

* setup env client/server in prime-rl

* externalize running env server

* style

* bring back rate limiter on scheduler

* revert vf branch

* back to custom branch

* do not double asyncio

* bring back eval

* fix cpu tests

* bump vf

* add math group config

* remove stop server call

* add logs

* remove last mentions of vf.State

* deprecate some configs

* more

* remove eval + cpu integration tests

* remove evals + synthesize configs

* bump vf

* fix branch with vlm cache

* do not reference rollout status

* use correct model name

* stop teacher infer pool if setup

* update changelog

* deprecate server discovery (unused)

* fix env id stripping

* use updated model name for evals

* strip env version on env server

* remove server discovery tests

* bump vf

* do not fail if env server not yet up

* add elastic sanity check

* update docs

* use extra env kwargs consistently across orch and env server

* update math group config

* update cfg

* use dynamic model name in final evals

* add extra_env_kwargs to changelog

* resolve vf merge conflicts

* assert lora name not None

* fix unit tests

* fix types

* add hendrycks math sanity check

* bump vf

* do not double repeat eval inputs

* do not duplicate eval inputs

* lower avg@

* Initialize logger in env-server before install_env (#1743)

install_env() calls get_logger() which requires the logger to be set up first.
This was missing in env-server but present in orchestrator.

* disable vf logging on orch

* Fix elastic autoscaling: use base model for health checks (#1745)

The health check was using `model_name` which gets updated to the LoRA
adapter name after training starts. New inference servers only have the
base model, so they would fail health checks and never get added to the
pool.

Store the original model name as `base_model_name` and use it for health
checks, allowing new servers to be discovered and have the LoRA adapter
loaded on them.

---------

Co-authored-by: JannikSt <JannikSt@users.noreply.github.com>
Co-authored-by: William Brown <williambrown97@gmail.com>
2026-02-08 19:59:35 -08:00
Sebastian MüllerandGitHub 125012f8d7 Update prime-rl to newest verifiers main (#1744)
* Replace save_to_disk with save_outputs

* point verifiers to a fixed version

* bump verifiers pin to newest main

* update uv.lock
2026-02-08 17:42:35 -08:00
b0cabb979e add enable prefix caching arg passthrough to vllm (#1733)
* add enable prefix caching arg passthrough to vllm

* add comment

---------

Co-authored-by: Mika Senghaas <mail@mikasenghaas.de>
2026-02-08 10:15:35 +01:00
halleriteandGitHub 1f355411b5 move side-effects out of config (#1741)
* move side-effects out of config

* add back justification
2026-02-07 17:38:53 -08:00
halleriteandGitHub 922582d04f set VLLM_WORKER_MULTIPROC_METHOD=spawn by default (#1740)
* auto set necessary vllm vars for vlms

* make spawn general

* remove unnecessary vllm env var & improve docs
2026-02-07 16:16:37 -08:00
halleriteandGitHub 663e9d264a fix bug introduced in prev pr (#1739) 2026-02-07 14:10:41 -08:00
kalomazeandGitHub 7b95af5874 [QoL] Multiple small sanity checks (#1684)
* validate client port matches inference server

* error on existing GPU processes before training

* respect resume_step config in trainer

* format rl.py

* fix defenseslop

* move port validation from config to runtime
2026-02-06 23:00:46 -08:00
halleriteandGitHub 8dbd955a06 best-effort interleaving (#1674) 2026-02-06 21:09:19 -08:00
a78bbfa856 docs: add release notes guidelines to AGENTS.md (#1734)
* docs: add release notes guidelines to AGENTS.md

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

* docs: add style reference step to release guidelines

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:27:10 -08:00
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
265 changed files with 15396 additions and 5842 deletions
+1
View File
@@ -0,0 +1 @@
../skills
+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"
-32
View File
@@ -38,35 +38,3 @@ jobs:
run: PYTEST_OUTPUT_DIR=/tmp/outputs uv run pytest tests/unit -m "not gpu"
- name: Cleanup output_dir
run: rm -rf /tmp/outputs
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --all-extras --locked
- name: Run tests
env:
USERNAME_CI: CI_RUNNER
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
# Set WANDB_MODE to online only if WANDB_API_KEY is available, otherwise set to offline
# This is to allow running tests on forks without WANDB_API_KEY
WANDB_MODE: ${{ secrets.WANDB_API_KEY && 'online' || 'offline' }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PRIME_API_KEY: ${{ secrets.PRIME_API_KEY }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
PYTEST_OUTPUT_DIR: /tmp/outputs
run: PYTEST_OUTPUT_DIR=/tmp/outputs uv run pytest tests/integration -m "not gpu"
- name: Cleanup output_dir
run: rm -rf /tmp/outputs
+82
View File
@@ -0,0 +1,82 @@
name: DevX Tag
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
create-dev-tag:
name: Create .dev tag
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Create next .dev tag from latest release
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const sha = context.sha;
let baseTag;
try {
const latestRelease = await github.rest.repos.getLatestRelease({ owner, repo });
baseTag = latestRelease.data.tag_name;
} catch (error) {
if (error.status === 404) {
core.notice("No releases found. Skipping .dev tag creation.");
return;
}
throw error;
}
const prefix = `${baseTag}.dev`;
const escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const pattern = new RegExp(`^refs/tags/${escapeRegex(baseTag)}\\.dev(\\d+)$`);
for (let attempt = 0; attempt < 5; attempt += 1) {
const refs = await github.paginate(github.rest.git.listMatchingRefs, {
owner,
repo,
ref: `tags/${prefix}`,
});
let maxVersion = 0;
for (const ref of refs) {
const match = pattern.exec(ref.ref);
if (match) {
const version = Number.parseInt(match[1], 10);
if (version > maxVersion) {
maxVersion = version;
}
}
}
const tag = `${prefix}${maxVersion + 1}`;
try {
await github.rest.git.createRef({
owner,
repo,
ref: `refs/tags/${tag}`,
sha,
});
core.notice(`Created tag ${tag} at ${sha}`);
return;
} catch (error) {
if (error.status === 422) {
core.warning(`Tag ${tag} already exists, retrying...`);
continue;
}
throw error;
}
}
core.setFailed("Could not create a unique .dev tag after retries.");
+9 -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: |
@@ -99,4 +105,5 @@ jobs:
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
PYTEST_OUTPUT_DIR: /tmp/outputs
VLLM_WORKER_MULTIPROC_METHOD: spawn
run: uv run pytest ${{ matrix.pytest_args }}
+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
+72
View File
@@ -0,0 +1,72 @@
# 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`
- See the `toml-config` skill in `skills/` for full details on TOML structure, CLI overrides, and available commands.
## Skills
Skills live in `skills/` and are symlinked to `.claude/skills/`. They teach agents how to handle specific workflows (e.g. starting the inference server, writing configs). When you make changes to the codebase, check if any skills need to be updated to stay accurate.
You are responsible for maintaining the skills folder. When a workflow fails and you fix it – whether with help from the user or through trial and error – you must update the skills to make implicit knowledge explicit. You are also responsible for keeping the skills up to date whenever you or anyone else modifies the code.
## Testing
Write tests as plain functions with pytest fixtures. Don't use class-based tests.
## Git
Branch prefixes: `feature/`, `fix/`, `chore/`
## Releases
When preparing release notes:
1. **Style reference**: check the previous release (`gh release list --limit 1` then `gh release view <tag>`) to match the tone and formatting.
2. **Gather changes**: use `git log <last-tag>..origin/main --oneline --no-merges` to list all commits since the last release.
2. **Check for new commits**: always `git fetch origin main` and re-check right before publishing, since PRs may have been merged while drafting.
3. **Structure**: organize notes into numbered highlight sections (`# 1.`, `# 2.`, ...), then `# Breaking Changes`, `# Bug Fixes`, and `# Misc`.
4. **Highlights**: group related PRs under a single highlight. Use `##` subsections when a highlight contains multiple items (e.g. Performance & Parallelism). Keep the top highlights for the most impactful user-facing features.
5. **Config examples**: when referencing TOML config, verify the exact field names against the actual code or docs — don't guess.
6. **Links**: use clickable links for docs (`[docs/foo.md](https://github.com/PrimeIntellect-ai/prime-rl/blob/main/docs/foo.md)`) and PR references (`[#1234](https://github.com/PrimeIntellect-ai/prime-rl/pull/1234)`).
7. **Contributors**: list all contributors ranked by number of commits, using their GitHub `@username`. Get usernames via the GitHub API, not git author names (which can be inconsistent).
8. **Draft first**: always create releases as `--draft` first, iterate on content, then publish.
+23
View File
@@ -36,3 +36,26 @@ Documenting changes which affect configuration usage patterns (added/moved/remov
- **`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)
- **`orchestrator.trajectory_strategy`**: Deprecated. Interleaving now automatically handles extension breaks by starting a new sample when the prefix doesn't match, achieving best-of-both behavior. The setting is ignored and interleaved mode is always used. (2026-01-30)
- **`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)
- **`inference.model.enable_prefix_caching`**: Added flag to enable prefix caching in vLLM. Passed to vLLM as `--enable-prefix-caching` (default: None) (2026-02-08)
- **`orchestrator.env.address`**: Added address field on `EnvConfig`. If set, connect to an environment server at this address; if None, spawn a server in a subprocess (2026-02-06)
- **`orchestrator.env.extra_env_kwargs`**: Added on `EnvConfig`. Extra kwargs passed to the env (e.g. seq_len, interleaved_rollouts, score_rollouts). Auto-populated by the orchestrator for training envs; generally not recommended for user override. Main use case is to match these kwargs when running an env in an isolated environment server (default: {}) (2026-02-06)
- **`OrchestratorConfig`**: Removed `workers_per_env`, `max_env_worker_restarts`, and `mask_env_responses` (2026-02-06)
- **`EvalSaveDiskConfig`**, **`EvalSaveConfig`**, **`RetryConfig`**, **`OnlineEvalConfig`**: Removed (2026-02-06)
- **`TemperatureScheduleConfig`**: Renamed to `TemperatureSchedulerConfig` (2026-02-06)
- **`optim.mu`**: Added Muon momentum (`mu`) config field (default: 0.95). Previously hardcoded to Muon class default. Also fixed `optim.betas1`/`optim.betas2` not being passed through to the Muon optimizer (2026-02-09)
- **`dump_config`**: Added `--dump-config <path>` flag to the `rl` command. When set, writes the resolved subconfigs (trainer, orchestrator, inference, teacher_inference) to the given directory and exits without starting any processes (2026-02-12
- **`client.api_key_var`**: Changed default from "OPENAI_API_KEY" to "VLLM_API_KEY" (2026-02-12)
+1
View File
@@ -0,0 +1 @@
@AGENTS.md
+5
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
@@ -96,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"]
@@ -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": "a76eec30",
"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": 22.685546875,
"pct": 47.72
}
}
}
@@ -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": "a76eec30",
"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": 14.1328125,
"pct": 29.74
}
}
}
@@ -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()
@@ -1,15 +0,0 @@
num_examples = 5
rollouts_per_example = 3
[sampling]
max_tokens = 16
[[env]]
id = "primeintellect/math-env"
name = "gsm8k"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
[[env]]
id = "primeintellect/math-env"
name = "hendrycks"
args = { dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default" }
@@ -1,9 +0,0 @@
num_examples = 5
rollouts_per_example = 3
[sampling]
max_tokens = 16
[[env]]
id = "primeintellect/math-env"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
@@ -9,7 +9,7 @@ max_steps = 20
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
[optim]
lr = 2e-5
lr = 3e-5
[sampling]
max_tokens = 128
@@ -17,3 +17,6 @@ max_tokens = 128
[[env]]
id = "reverse-text"
[ckpt]
interval = 10
resume_step = -1
@@ -1,10 +1,16 @@
# Trainer config for multi-run RL integration test
max_steps = 100000
max_concurrent_runs = 2
max_async_level = 5
[model]
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
seq_len = 65536
[model.lora]
rank = 8
[model.ac]
freq = 1
[model.compile]
fullgraph = false
@@ -1,15 +0,0 @@
num_examples = 5
rollouts_per_example = 3
[sampling]
max_tokens = 16
[[env]]
id = "primeintellect/math-env"
name = "gsm8k"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
[[env]]
id = "primeintellect/math-env"
name = "hendrycks"
args = { dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default" }
@@ -1,8 +0,0 @@
num_examples = 5
rollouts_per_example = 3
[sampling]
max_tokens = 16
[[env]]
id = "primeintellect/wiki-search"
@@ -1,9 +0,0 @@
num_examples = 5
rollouts_per_example = 3
[sampling]
max_tokens = 16
[[env]]
id = "primeintellect/math-env"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
-4
View File
@@ -1,4 +0,0 @@
use_tqdm = true
[sampling]
max_tokens = 16
-13
View File
@@ -1,13 +0,0 @@
# Example of generating data in two single-turn environments (gsm8k and hendrycks)
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/math-env"
name = "gsm8k"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
[[env]]
id = "primeintellect/math-env"
name = "hendrycks"
args = { dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default" }
-7
View File
@@ -1,7 +0,0 @@
# Example of generating data in a single single-turn environment (gsm8k)
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/math-env"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
-13
View File
@@ -1,13 +0,0 @@
# Example of generating data in two single-turn environments (gsm8k and hendrycks)
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/math-env"
name = "gsm8k"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
[[env]]
id = "primeintellect/math-env"
name = "hendrycks"
args = { dataset_name = "PrimeIntellect/Hendrycks-Math", dataset_subset = "default" }
-7
View File
@@ -1,7 +0,0 @@
# Example of generating data in a multi-turn environment (alphabet-sort)
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/alphabet-sort"
args = { min_turns = 2, max_turns = 2 }
@@ -1,6 +0,0 @@
# Example of generating data in a multi-turn environment with tool calls
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/wiki-search"
@@ -1,7 +0,0 @@
# Example of generating data in a single single-turn environment (gsm8k)
num_examples = 16
rollouts_per_example = 4
[[env]]
id = "primeintellect/math-env"
args = { dataset_name = "openai/gsm8k", dataset_subset = "main" }
-12
View File
@@ -1,12 +0,0 @@
[model]
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
[[env]]
id = "math500"
args = { use_think = true }
rollouts_per_example = 1
[[env]]
id = "aime2024"
args = { use_think = true }
rollouts_per_example = 16
+17
View File
@@ -0,0 +1,17 @@
# Testing Elastic Inference
To test the elastic inference pool without having the `rl` entrypoint start the inference server:
1. **Run RL with the elastic config** (orchestrator discovers servers via DNS; it will find `localhost:8000` once the server is started):
```bash
uv run rl @ examples/alphabet_sort/rl_elastic.toml
```
The config uses `[orchestrator.client.elastic]` with `hostname = "localhost"` and `port = 8000`. The orchestrator will wait for at least one ready server before starting rollouts.
2. **Start the inference server manually** (in a separate terminal or on another machine):
```bash
uv run inference --model.name Qwen/Qwen3-4B-Instruct-2507 --enable-lora --max-lora-rank 32
```
+46
View File
@@ -0,0 +1,46 @@
# Alphabet sort RL with elastic inference pool (no inference process started by rl).
# Start the inference server manually first, then run: uv run rl @ examples/alphabet_sort/rl_elastic.toml
# The orchestrator discovers servers via DNS (hostname) and only uses ready ones.
# Omitting [inference] means inference = None, so the rl entrypoint will not start an inference process.
max_steps = 200
seq_len = 2048
[ckpt]
[model]
name = "Qwen/Qwen3-4B-Instruct-2507"
[wandb]
project = "alphabet-sort"
name = "alphabet-sort-elastic"
[trainer.model]
impl = "auto"
[trainer.model.ac]
freq = 1
[trainer.model.lora]
rank = 32
alpha = 64
[trainer.optim]
lr = 1e-5
[orchestrator]
batch_size = 512
rollouts_per_example = 8
[orchestrator.sampling]
max_tokens = 768
[orchestrator.client.elastic]
hostname = "localhost"
port = 8000
sync_interval = 5.0
[[orchestrator.env]]
id = "primeintellect/alphabet-sort"
name = "alphabet-sort"
args = { min_turns = 3, max_turns = 5, power_per_turn = false }
-5
View File
@@ -1,5 +0,0 @@
[sampling]
max_tokens = 2048
[[env]]
id = "math500"
+42
View File
@@ -0,0 +1,42 @@
inference_gpu_ids = [0]
trainer_gpu_ids = [1]
max_steps = 3000
seq_len = 8192
[wandb]
project = "hendrycks-math-debug"
name = "hendrycks-math-sanity"
[model]
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
[orchestrator]
batch_size = 512
rollouts_per_example = 8
[[orchestrator.env]]
id = "primeintellect/math-env"
args = { dataset_name = "mikasenghaas/Sanity-Test-R1D-1.5B", dataset_subset = "default" }
name = "hendrycks-math"
[orchestrator.eval]
interval = 50
[[orchestrator.eval.env]]
id = "primeintellect/aime2024"
name = "aime2024"
rollouts_per_example = 16
[trainer.model]
name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
[trainer.model.ac]
[trainer.model.compile]
[inference.model]
max_model_len = 8192
[log]
level = "debug"
@@ -1,5 +0,0 @@
max_concurrent = 128
[client]
base_url = ["https://api.deepseek.com"]
api_key_var = "DEEPSEEK_API_KEY"
@@ -1,6 +0,0 @@
max_concurrent = 128
[client]
base_url = ["https://api.fireworks.ai/inference/v1"]
api_key_var = "FIREWORKS_API_KEY"
@@ -1,4 +0,0 @@
max_concurrent = 1024
[client]
base_url = [ "http://localhost:8000/v1" ]
@@ -1,8 +0,0 @@
max_concurrent = 256
[client]
base_url = ["https://openrouter.ai/api/v1"]
api_key_var = "OPENROUTER_API_KEY"
[client.extra_body]
provider = { order = ["deepseek", "novita/fp8", "atlas-cloud/fp8", "siliconflow/fp8"] }
@@ -1,8 +0,0 @@
max_concurrent = 128
[client]
base_url = ["https://openrouter.ai/api/v1"]
api_key_var = "OPENROUTER_API_KEY"
[client.extra_body]
provider = { order = ["z-ai"], allow_fallbacks = false}
@@ -1,8 +0,0 @@
max_concurrent = 16
[model]
name = "PrimeIntellect/INTELLECT-3"
[client]
base_url = ["https://dev-inference.pinference.ai/api/v1"]
api_key_var = "PRIME_API_KEY_DEV"
@@ -1,5 +0,0 @@
max_concurrent = 128
[client]
base_url = ["https://api.together.ai/v1"]
api_key_var = "TOGETHER_API_KEY"

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