trinity
13
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
691dd4ef14 |
chore: overhaul public configs/ and examples/ (#3085)
* chore: overhaul public configs/ and examples/
Restructure the public configs/ and examples/ trees for clarity.
- examples/: split into basic/ (core-env tutorials) and advanced/
(folder-per-model: qwen3-30b-a3b, glm-4.5-air, glm-5.2, minimax-m2.5,
nemotron-3-super, intellect-3.1), each with a README; drop multinode/
and the example screenshots.
- configs/: add basic/ (small 2-GPU dev mirrors of the core envs, one folder
+ README each, validated at 1 step); rename debug/algorithms -> debug/algo;
move debug/{rl,sft} -> debug/fake/{rl,sft}.toml; remove stale/internal
configs (gsm8k, nemotron_*, hendrycks_math, general_agent, elastic,
debug/v1, debug/{infer,orch,multimodal}.toml, debug/{hendrycks_sanity,moe,multi_env}).
- Remove the k8s/ Helm chart and its docs.
- Repoint README, docs/, nightly tests, and CI to the new paths; lowercase
prime-rl throughout docs and READMEs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore: drop per-model READMEs in examples/advanced
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(k8s): keep Helm chart, refresh reverse-text example configs
Keep the k8s/ Helm chart (undo its removal earlier in this branch) and bring
its reverse-text example back in sync with the current config layout.
The chart invoked examples/reverse_text/rl/{orch,infer,train}.toml — a split
config layout flattened into a single rl.toml months ago (#1859), so the
shipped example had pointed at non-existent files. Add current, validated
orch/infer/train configs under k8s/prime-rl/examples/reverse-text/ (split from
examples/basic/reverse_text/rl.toml), point the chart and docs at them, and
COPY k8s/ into the CUDA image so /app/k8s/... resolves at runtime.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(configs): hyphenate all directory names in configs/, examples/, k8s/
Normalize directory naming to hyphens, matching the model dirs and logical
ids (reverse-text-v1, prime-rl). Renames the env/task dirs that still used
underscores:
examples/basic/{reverse_text,alphabet_sort,wiki_search,hendrycks_sanity}
configs/basic/{reverse_text,alphabet_sort,wiki_search,hendrycks_sanity}
configs/ci/integration/reverse_text{,_lora,_moe,_multi_run,_rl_opd,_rl_sft,_sft,_sft_lora}
to the same names with hyphens, and updates every path reference (README,
docs, skills, nightly + integration test path args, the cpu_tests
config-import check). Python test files/modules and *.toml filenames keep
underscores.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(examples): eval CLI migration, SLURM cleanup, batch sizes, glm-5.2 layout
- Migrate every eval command in examples/basic READMEs from `vf-eval` to the v1
`eval` CLI (pydantic-config): `-b` -> `--client.base-url`, `--max-tokens`/`-t`
-> `--sampling.max-tokens`, `--env-args` -> `--args`, plus `-r 3` (v1 defaults
to 1 rollout; these READMEs report 20x3), `--harness.id null` (these envs train
with the null harness), and `--no-push`. Drop the now-dead vf-eval skip in
tests/unit/test_configs.py.
- Remove all SLURM overlays (slurm_rl.toml, slurm_sft.toml) from examples/basic.
Move the slim-wheel SFT+[slurm] parse fixture to configs/ci/slim_sft.toml and
repoint cpu_tests.yaml; drop the SLURM section from the hendrycks-sanity README
and the SLURM line from the start-run skill.
- Tune basic example batch/group sizes: alphabet-sort 256/16, wordle 512/16
(wiki-search already 512/16).
- Restructure examples/advanced/glm-5.2: inference configs ->
infer/{pd,pd-llmd}.toml, RL configs -> {swe,swe-llmd}.toml; repoint docs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: fix outdated docs/skills/configs surfaced by v1 audit
Swept docs/, skills/, READMEs, and config TOMLs for outdated content (special
focus on v0->v1 drift). Verified every fix against current code.
docs/
- configuration.md: repoint 5 dead Basic example links to examples/basic/<hyphen>;
scope the "each dir has a README" claim to basic (advanced dirs are config-only).
- algorithms.md: opd reference-model field is `teacher` not `model`; renderer names
`glm-5`/`glm-4.5` (were invalid `glm5`/`glm4.5`); rewrite the per-env algorithm
example in the v1 taskset/harness form (was the v0 bare-`id` form).
- development.md: drop invalid `--data.type null` (SFT DataConfig has no such type).
- inference.md: fix "Dissagregation" typo + dead P/D anchor.
- overview.md: token-in route is `/inference/v1/generate`.
skills/
- monitor-run: correct the metric tables to the real
{scope}/{subset}/<metric>/<stat> scheme (num_total_tokens, has_error,
time/wait_for_policy, dispatcher/*); the old seq_len / errored_rollouts /
scheduler/* / generate_completions names never existed.
- install: drop the deep-gemm mention (no such section) from the description.
READMEs
- examples/README.md: basic runs on 1-8 GPUs (not 2); hyphenate env names.
- configs/README.md: drop stale "standalone entrypoint configs"; hyphenate.
- wiki-search: eval inference uses `--model.*` (not `--inference.model.*`) and drops
the auto-derived `enable_auto_tool_choice` flag; "native V1 tools" not "MCP".
- reverse-text: fix dead sft/train.toml path -> sft.toml.
- hyphenate configs/basic/* README headings.
configs/
- qwen3-30b-a3b/tool.toml: move `min_tier` into the taskset (was under a v0
`[...env.args]` block a v1 taskset never reads); group_size alias.
- glm-5.2/swe-llmd.toml: rollouts_per_example -> group_size.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(configs): use prime-qwen3 renderer for reverse-text (was default)
The reverse-text configs run PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT, whose
`-SFT` suffix misses MODEL_RENDERER_MAP's exact-match lookup and so fell back to
the DefaultRenderer. reverse-text is single-turn and always sends a system
prompt ([system, user, assistant]); the prime-qwen3 renderer is token-for-token
identical to the model's apply_chat_template for that shape (verified via
render_ids parity), and unlike the stock qwen3 renderer it does not inject an
empty <think></think> block. Switch the 7 standard + 3 distill reverse-text
configs to prime-qwen3.
Kept `default` where no hand-coded renderer fits (each errors on the model's
tokenizer): hendrycks-sanity (DeepSeek-R1-Distill-Qwen-1.5B), reverse-text-moe
(samsja/mini-glm-moe), intellect-3.1 (INTELLECT-3-Base).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(configs): use prime-qwen3 (not qwen3) for PrimeIntellect Qwen3 configs
The stock `qwen3` renderer injects an empty <think></think> block the
PrimeIntellect Qwen3 template never emits, so it mismatches these models'
apply_chat_template — single-turn for reverse-text, and every multi-turn shape
for wordle (verified via render_ids parity) — corrupting training tokenization.
- configs/basic/wordle/rl.toml: qwen3 + thinking_retention="all" -> prime-qwen3,
matching the tutorial examples/basic/wordle (which already uses prime-qwen3).
- configs/debug/algo/{echo,grpo,max_rl,self_distill,mixed_grpo_opd,opd,opd_lora}.toml
and configs/ci/integration/reverse-text-rl-opd/start.toml: qwen3 -> prime-qwen3
(all run PrimeIntellect/Qwen3-0.6B-Reverse-Text-{SFT,RL}).
prime-qwen3 handles the PI template's think retention natively, so the explicit
thinking_retention="all" is dropped.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(k8s): use prime-qwen3 renderer in reverse-text orch config
The k8s reverse-text orchestrator config was split from the reverse-text example
before that example migrated to prime-qwen3, and the renderer migration was
scoped to configs/ and examples/ — so this one kept the stale `default`. Align
it with the source (PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT → prime-qwen3).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(k8s): drop redundant renderer comment in reverse-text orch config
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|
|
3d2dbae5f7 |
feat: add attn='auto' option (FA3 on Hopper, FA4 on Blackwell) (#3076)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: add attn='auto' option that picks FA3 on Hopper and FA4 on Blackwell Add an 'auto' option to the model.attn config field that resolves at runtime based on GPU architecture: Flash Attention 3 on Hopper (SM90), Flash Attention 4 on Blackwell (SM100+), falling back to FA2 on older architectures. This becomes the new default for model.attn. The resolution happens early in setup_model (before any attention-related setup) and is also called explicitly in the SFT train script before CP kernel patching, since SFT sets up context parallelism before calling setup_model. * fix: enforce impl constraint for attn='auto' resolving to FA3/FA4 - Config validator: reject attn='auto' with impl='hf' at config time - Runtime check in get_model: reject FA3/FA4 when impl='auto' resolves to 'hf' (for models without a custom implementation) |
||
|
|
013a7f8c25 |
Revert "chore: remove fsdp_cpu_offload (#3049)" (#3052)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
This reverts commit
|
||
|
|
c9acaa3c90 |
chore: remove fsdp_cpu_offload (#3049)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* chore: remove fsdp_cpu_offload The knob was effectively unusable: it breaks NCCL weight broadcast in RL (state-dict tensors stay on CPU and the communicator asserts), muon rejects it, it is mutually exclusive with optim_cpu_offload, and no config in the repo uses it. Remove the field and all wiring instead of patching around it: FSDP CPUOffloadPolicy selection, the buffer-migration helper, the gloo backend plumbing in setup_torch_distributed, both muon validators, and docs. optim_cpu_offload remains the supported CPU-offload knob. Default behavior is unchanged: fully_shard's own default offload policy is OffloadPolicy(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: drop offload_policy kwargs from direct fully_shard calls Three fully_shard call sites passed offload_policy=offload_policy directly (not via fsdp_config) and were missed by the removal — setup_fsdp raised NameError. fully_shard's default is OffloadPolicy(), so omitting the kwarg is behavior-identical. Verified by importing the trainer modules and checking setup_fsdp's symbol table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
1cb5d91ab2 |
feat(trainer): ulysses CP beyond num_kv_heads via GQA KV-head replication (#3042)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* fix(trainer): fuse relu2 MoE activation via torch.compile F.relu(x).square() ran eagerly (the expert path graph-breaks out of the layer-level compile at the @expert_parallel all-to-all and the _grouped_mm custom op), materializing an extra full-size copy of the MoE intermediate — the largest activation for high top-k models (NemotronH Super: top-22, moe_intermediate 2688; 57.75 GiB at 65k tokens/GPU) and the empirical OOM site. An explicit torch.compile on relu2 fuses relu+square into a single pointwise kernel. Measured on Nemotron Super (2xH200 nodes, 16k tokens/GPU): OOM -> fits at 126.5/139.8 GiB peak. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(trainer): ulysses CP beyond num_kv_heads via GQA KV-head replication Ulysses CP head-shards Q/K/V, capping the CP degree at num_key_value_heads — for hybrid-Mamba GQA models like NemotronH Super/Ultra/Nano (2 KV heads) that means cp <= 2, i.e. at most 2-way context sharding regardless of node count. (NVIDIA post-trained Super at 256k-512k with CP=64 on Megatron's sequence-sharded, Mamba-aware CP; prime-rl's ring CP is softmax-only.) Replicate each KV head cp/num_kv_heads times before the existing seq->head all-to-all. GQA groups query heads contiguously, so rank r's query-head slice [r*Hq/cp, (r+1)*Hq/cp) attends KV head floor(r*Hkv/cp) — exactly the replica the all-to-all lands on rank r. Backward of repeat_interleave sums gradients over replicas, the exact GQA KV gradient. Q path and the num_kv_heads >= cp case are unchanged; the Mamba layers already head-shard independently via cp_mamba (128 heads, n_groups=8 -> cp <= 8 for NemotronH). New constraint: cp % num_kv_heads == 0 when num_kv_heads < cp (asserted). Unlocks cp=4/8 for NemotronH on H200 where cp=2 made 131k context memory-infeasible (65k tokens/GPU through a top-22/512-expert MoE). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: drop relu2 comment Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
cb43db2ad1 |
feat: make all envs uv workspace members, drop the envs extra (#3019)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: make research-environment envs uv workspace members Research envs under deps/research-environments/environments/*/* are now auto-discovered uv workspace members instead of being hand-registered in the `envs` extra + [tool.uv.sources]. Adding a new research env needs no pyproject.toml change - the glob picks it up and it's locked automatically. They are opt-in: `uv sync` / `--all-extras` no longer install them; use `uv sync --all-packages`. Env-running sites (sbatch training templates, gpu/nightly CI, Docker image + entrypoint, nemotron config, example READMEs) gain --all-packages; dev quickstart and cpu unit tests stay lean. tau2-synth-v1 and tau3-bench-v1 are excluded - they pin `tau2` forks/revs that conflict with the canonical tau2-bench-v1 in the workspace's shared lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: make verifiers envs workspace members, drop the envs extra Extends the workspace glob to deps/verifiers/environments/*, so verifiers-repo envs are auto-discovered members alongside the research envs. Removes the now-empty `envs` optional-dependency and all its [tool.uv.sources] entries, and drops the defunct `--extra envs` from cpu_tests, Dockerfile.cuda, and docker-entrypoint.sh (env members install via --all-packages instead). All 94 env members (66 research + 28 verifiers) lock, install, and import. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(ci): install all env packages in cpu_tests test_load_configs parses every config, and parsing a v1-taskset config makes verifiers import the env package to derive its taskset config type. With envs now workspace members, the lean `uv sync --extra flash-attn` left them uninstalled, so 28 config tests failed with ModuleNotFoundError. Add --all-packages so the referenced env packages are importable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
e96bbae2dd |
feat: derive inference node counts (#2959)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
d70075381c |
feat: configurable env vars (#2863)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(env): consolidate component env vars Add shared env var defaults and per-component env_vars plumbing across RL, SFT, and inference launch paths. Update launcher filtering, SLURM templates, examples, and docs to match the consolidated env config surface. * feat: add rl-wide env vars (#2897) --------- Co-authored-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> |
||
|
|
bf3d381cfe |
refactor: remove "auto" option from fused_lm_head_token_chunk_size (#2890)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
The "auto" value for fused_lm_head_token_chunk_size previously resolved to 8192 for RL training via a config validator. This was redundant since users can simply set the integer explicitly. Remove the "auto" option, its validator (auto_setup_fused_lm_head_token_chunk_size), and update docs/CHANGELOG accordingly. The type changes from int | Literal["auto", "disabled"] to int | Literal["disabled"]. Users who relied on "auto" should set fused_lm_head_token_chunk_size = 8192 explicitly. |
||
|
|
0be5ac452a |
feat: algorithm abstraction — named algorithm classes + inline frozen-model references (grpo, opd, sft_distill, self_distill, echo) (#2746)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
c5afcaa2e2 |
feat: default ep to auto for MoE models (#2868)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: default ep to "auto" for MoE models ep now defaults to "auto" which resolves at trainer startup to the largest valid EP degree up to 8. The resolution loads AutoConfig to read num_experts, then picks the biggest divisor of num_experts that also divides the FSDP island size (world_size // dp_replicate), is a multiple of cp, and is <= 8. For non-MoE models, auto resolves to 1. Changes: - ModelConfig.ep type: int -> int | Literal["auto"], default "auto" - Added resolve_ep() in parallel_dims.py, called before get_parallel_dims() in both rl/train.py and sft/train.py - Fixed validators (validate_ep_comm_backend, ep_only_with_custom_impl) to handle the "auto" string without comparing to int - get_parallel_dims() now asserts ep is resolved to int - Updated docs/scaling.md and CHANGELOG.md * fix: ruff format parallel_dims.py * feat: enable memory-saving defaults (ac, ac_offloading, compile, optim_cpu_offload, chunk loss) - model.ac: None -> ActivationCheckpointConfig() (full mode) - model.ac_offloading: None -> ActivationOffloadingConfig() - model.compile: None -> CompileConfig() (fullgraph=false) - model.optim_cpu_offload: False -> True - model.fused_lm_head_token_chunk_size: disabled -> 1024 - SFT silently disables fused_lm_head_token_chunk_size - Multi-run CI config sets optim_cpu_offload=false - Debug configs disable compile * refactor: replace ep="auto" string with auto_ep boolean - Replace ep: int | Literal["auto"] = "auto" with auto_ep: bool = True + ep: int = 1 - Update validators to check auto_ep instead of string comparisons - Revert SFT changes to main (ep_only_with_custom_impl, sft/train.py) - Keep SFT validate_and_disable_chunked_loss fix (silently disable) - Remove isinstance assertion in get_parallel_dims (ep is always int now) - Update docs and changelog * fix: address review comments - Rename resolve_ep to resolve_auto_ep (samsja) - Add impl guard in resolve_auto_ep: skip EP for hf impl (bugbot) - Add runtime check: raise if deepep resolves to ep=1 (bugbot) - Revert configs/debug/moe/sft/train.toml to keep compile enabled (mika) * fix: update benchmark baselines for memory-saving defaults The new memory-saving defaults (ac, ac_offloading, compile, optim_cpu_offload, fused_lm_head_token_chunk_size) reduce throughput. Update both 1-GPU and 4-GPU baselines to the actual metrics from the CI run. * refactor: replace auto_ep boolean with ep: int | Literal["auto"] - Remove the auto_ep boolean field from ModelConfig - Change ep type from int to int | Literal["auto"], default "auto" - Rename resolve_auto_ep back to resolve_ep, check config.ep != "auto" - Update validators to handle ep being a string (isinstance check) - Add assertion in get_parallel_dims that ep is resolved to int - Update docs/scaling.md and CHANGELOG.md * fix(sft): handle ep="auto" in ep_only_with_custom_impl validator The SFT validator used which raises TypeError when ep is "auto" (a str). Match the RL trainer's approach using != comparisons to handle both int and str types. * fix(sft): call resolve_ep before get_parallel_dims in SFT trainer * Simplify resolve_ep: min(fsdp_island_size, 8) for MoE, 1 otherwise Remove the magic auto-resolution that searched for the largest EP degree satisfying num_experts divisibility, FSDP island divisibility, and cp multiple constraints. Now just checks if the model is MoE and resolves to min(fsdp_island_size, 8). * docs(inference): document required NIXL/UCX from-source build for P/D disaggregation --------- Co-authored-by: samsja <samsja@users.noreply.github.com> |
||
|
|
9589c04de3 |
[Minor]: Docs (#2680)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* Fix: advanced * Fix: development * Fix: overview * Fix: scaling * Fix: inference --------- Signed-off-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com> |
||
|
|
c1f6fbdd3b |
docs: big revamp (#2602)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* docs: rewrite into 8 task-oriented pages with auto-generated reference Replaces 22 small/uneven docs files with 8 longer pages modeled on the verifiers docs: each page opens with a TOC, content is grouped by task (configure, train, scale, …) instead of by feature, and a single auto-generated reference page covers every config field. New pages: overview, configuration, training, scaling, algorithms, advanced, faqs, reference. reference.md is generated by scripts/generate_docs_reference.py from the Pydantic config models; regenerate with `uv run python scripts/generate_docs_reference.py`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: fix stale claims found in source verification pass - algorithms.md: max_async_level default is 1 (not 2); default loss includes the Kimi-K2.5 KL regularizer (was wrongly claimed to drop it); update the formula to show the full L = -PG + tau_KL * KL form; filter table is `[[orchestrator.filters]]` (plural) - training.md: checkpoint paths nest under `checkpoints/step_N/{trainer, orchestrator}/` rather than separate hierarchies; --inference-gpu-ids / --trainer-gpu-ids don't exist — use --deployment.num-{infer,train}- gpus and pin physical GPUs via CUDA_VISIBLE_DEVICES; update max_async_level prose to match the new default - scaling.md: same GPU-flag fix throughout the single/multi-GPU examples; correct the claim that Muon + optim_cpu_offload is unsupported (only fsdp_cpu_offload is blocked) - configuration.md: there is no generic PRIME_* env var override mechanism in pydantic-config — rewrite the env vars section to list the specific named vars that individual fields read as defaults - advanced.md: add the qwen3_vl_moe entry to the VLM registry table; the small-scale MoE RL config lives at configs/ci/integration/reverse_text_moe/start.toml, not .../rl/ - faqs.md: update the max_async_level Q&A to match the new default Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci: enforce docs/reference.md stays in sync with configs Adds two safety nets so the auto-generated reference can't silently drift from the Pydantic config models: - Pre-commit hook (local): re-runs scripts/generate_docs_reference.py whenever a config class or the generator itself is staged. If the generated file changes, pre-commit fails the commit so the contributor re-stages the regenerated reference. - GitHub Actions (CI): a small workflow runs the generator and `git diff --exit-code docs/reference.md`. Catches anyone who bypassed the pre-commit hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: rename pre-commit hook id to docs-reference Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(overview): tighten landing page - Quick run now uses examples/reverse_text/rl.toml; the env is bundled with the verifiers submodule so no prime env install is needed, and the tmux helper is documented elsewhere instead of duplicated here - Architecture bullets advertise the SOTA features per process: vLLM multi-node + FP8 + P/D disaggregation for inference; FSDP2 + EP (incl. DeepEP) + CP + selective AC + FP8 + LoRA + multi-run for the trainer - Drop the "Use prime-rl when you want to" bullets and the CPU-only SFT smoke check — the landing page reads cleaner without them Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(configuration): trim and reorganize - Drop the env-vars section entirely (and the precedence callout that referenced it) — the page is now strictly TOML + CLI. The few named env vars that individual fields read as defaults are out of scope for the config docs and stay in the per-feature pages (training.md, etc.) - Drop the entrypoint enumeration and the W&B/output-dir recommendation blurb in the intro - Reword "@ introduces a TOML file" so the sentence doesn't lead with an inline code token; convert the "Mind the space" hint to a blockquote - Drop --output-dir from the convenience-flag list (it's just another override, not a special flag) - Note that --dry-run is available on rl, sft, and inference only — the standalone trainer and orchestrator configs don't have a dry_run field - Split "Booleans, None, and lists" into one section each, matching the pydantic-config README style; add a Dicts section - Drop the "Prefer --ckpt" convention bullet — checkpointing is covered in training.md and didn't belong in the config conventions Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(training): drop redundant OpenAI-compatible prefix on vLLM server vLLM is an OpenAI-compatible server by default; the prefix in the entrypoints table was just noise. Other mentions of "OpenAI-compatible" describe the API surface or third-party endpoints and stay. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(training): trim and restructure per review - Quick-start now uses examples/reverse_text/rl.toml; drop the prime env install and tmux preamble (covered elsewhere) - Add a "Useful CLI flags" subsection: --ckpt, --wandb, --orchestrator. prime-monitor (Prime Lab), --clean-output-dir, --output-dir, --max-steps, --dry-run - Mention the env-server / env-worker fan-out in the orchestrator bullet under "What each process does at runtime" - Restrict the Key knobs table to orchestrator-only args; drop max_async_level, max_completion_tokens, inference, trainer rows; rename rollouts_per_example row to lead with "Group size" - SFT Launch now uses examples/reverse_text/sft.toml; drop the CPU fake-data smoke alternative - "two distillation modes" -> "three training modes" (rl/opd/sft) - Drop the long-run checkpoint-combo recommendation - Drop the trainer+orchestrator lockstep note from Resuming a run - Swap order: Platform monitoring now appears before Prometheus + BetterStack under Observability; show --orchestrator.prime-monitor CLI invocation - Rename "Metrics that matter" -> "Important metrics"; drop the live vLLM curl snippet - Drop "Eyeball the reward distribution", "Match inference.parallel.tp", and "Set max_async_level deliberately" rules of thumb - Add new rules of thumb: batch size >= 64; group size >= 8 with the reasoning that all-succeed / all-fail groups give the trainer no signal because the within-group advantage collapses - Drop the Common Issues section entirely Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: trim scaling layout table and move multi-node logs to training - scaling.md: drop the 1-GPU row and the "Production MoE with long contexts" row from the "Choosing a layout" table; the disaggregated prefill/decode page section is still findable via its own H2 - scaling.md: drop the trailing "Multi-node logs" section (heading + TOC entry); the content now lives next to single-node log layout - training.md: fold the multi-node tree into "Log files" with the single-node skip note inlined; add live-tail recipes and the per-rank torchrun debug note; mention the tmux helper works on a SLURM head node Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(algorithms): add Renderers section, trim renderer prose - New Renderers section explains why best-effort interleaving works: the renderer guarantees the exact-prefix invariant by construction via bridge_to_next_turn. Lists the renderer API surface and the hand-coded model coverage - Drop the verifiers trajectories-design-note link from Discontinuous trajectories and the --trajectory-strategy branching deprecation - Drop preserve_all_thinking workaround mentions from algorithms.md and faqs.md (reference.md still documents the fields) - Leave a TODO(blog-post-url) for the PI site writeup Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: refresh FAQ + training W&B claim + recommend prime eval faqs.md: - Drop the "override an env var in TOML" Q&A (matches the configuration page where env vars are no longer documented as a generic override) - Drop the "max_async_level" Q&A; replace with a max_off_policy_steps Q&A — the more impactful knob to tune on long agentic rollouts - Drop the outdated "two W&B runs per RL job" Q&A; default is shared now (wandb.shared = true) - Drop the SFT-section Q&As that referenced preserve_all_thinking or were too thin to keep - Switch the "evaluate without training" recipe from vf-eval to prime eval run (the Prime CLI is the recommended entrypoint) training.md: - Fix the W&B section to describe the new default: shared single run (wandb.shared = true), with the legacy split as opt-out - Add max_off_policy_steps to the Key knobs table - Switch the eval example from vf-eval to prime eval run Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(faqs): drop the CP <= 8 recommendation Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(faqs): drop the vLLM log-quieting and KV-cache pressure Q&As Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(faqs): drop the Environments Hub install Q&A Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(faqs): drop the Models and environments section Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(overview): second tightening pass - Inference bullet now leads with the local default (token-in /v1/generate via renderers; OpenAI-compatible routes called out as the external-client path) and adds DP/TP/EP with deepep + flashinfer all-to-all backends + EPLB, P/D disaggregation behind vllm-router, CPU KV-cache offload, and router replay (FP8 MoE numerical-parity feature). Weight broadcast is filesystem or NCCL. - Orchestrator bullet now leads with "owns the data plane across many verifiers training and eval environments" plus the per-env isolated subprocess + variable-size env-worker pool. - Trainer bullet drops "torchrun-launched" and surfaces the custom modeling code as the enabler for advanced trainer parallelism (EP with DeepEP, CP for long sequences). - Drop the [AIPO] link in the async paragraph (off-policy-aware PG + KL regularizer, no paper handle); also drop the "AIPO loss" mention from the Algorithms blurb in "Where to go next" so the page is internally consistent. - Quick-run command is now bare: uv run rl @ examples/reverse_text/rl.toml (no --wandb.* / --ckpt). - Drop the trailing scaling pointer (Scaling is already linked in "Where to go next"). Co-authored-by: Cursor <cursoragent@cursor.com> * docs(configuration): second tightening pass - Drop the entrypoint-splitting paragraph ([trainer] / [orchestrator] / [inference] table lifting); covered elsewhere. - Rename "TOML files and composition" -> "TOML composition", and "Special syntax" -> "Syntax". - Open "Sources and precedence" by naming the three sources (Pydantic defaults, TOML files, CLI flags) up front, then layering them. - Drop the "(-- is a kebab-case marker)" parenthetical from CLI overrides; turn the snake/kebab note into a callout. - Drop the --help / --dry-run convenience-flag block and the "--dry-run is the single most useful debugging tool" prose; the bash example is enough. - Reorder Syntax subsections to mirror the pydantic-config README: Booleans -> Lists -> Dicts -> Optional sub-configs -> None -> Discriminated unions -> Environments. None moves down and is cross-linked from "disabling an optional sub-config". - Booleans example swapped from --ckpt (which is itself an optional sub-config) to --clean-output-dir (a real bool = False field), showing both --flag and --no-flag forms. - Lists / Dicts now show TOML and CLI on the *same* field name so the mapping is obvious (target_modules for lists, env.0.args for dicts), and add the "lists are replaced wholesale" overlay note + "dicts deep-merge across sources" detail. - Add a callout on validation aliases (rollouts_per_example still works after the rename to group_size) — only material gap vs the pydantic-config README that's relevant to end users. - Worked example: --dry-run is now the final flag. - Drop the Conventions section. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): second tightening pass - Rename "RL training" -> "RL trainer" and "SFT training" -> "SFT trainer" (and update the page intro accordingly). - Entrypoints table: clarify that `uv run rl` wraps the trainer, orchestrator, and inference server in one launch — runs locally for single-node experiments and submits to SLURM for single- or multi-node when [slurm] is set. Drop the trailing "rl is a convenience wrapper" paragraph. - RL trainer Launch: minimal command is now bare `uv run rl @ examples/reverse_text/rl.toml` (no flags). Drop the GPU-placement paragraph + multi-GPU example (covered in scaling.md). - Replace "Useful CLI flags" + "Key knobs" + "What each process does at runtime" with one consolidated "Useful knobs" section split into three sub-tables: data-and-algorithm, monitoring, run management. - Add training environments ([[orchestrator.train.env]] for multi-env training) - Add eval environments ([[orchestrator.eval.env]] + orchestrator.eval.interval) - Add monitoring entries: orchestrator.log.vf_level, --wandb, --orchestrator.prime-monitor - Move Training modes from a top-level section into RL trainer as a subsection (it's RL-entrypoint-specific). - Drop the standalone Evaluations section — eval syntax is covered in configuration.md and the eval-knobs row in Useful knobs links to `prime eval` for one-off evals. - Drop the optimization_dtype / reduce_dtype rule of thumb. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): SFT trainer metrics + tools column + minor renames - Drop "-via-orchestrator" from the Training modes heading and the internal/cross-doc anchors. The mode value is just `sft` and the short title reads cleaner. - Drop "and the tmux helper" from the Console output subsection title; the tmux helper is still documented in the section body. - Important metrics is now split into RL trainer and SFT trainer subsections so the SFT-only metrics (loss/mean, val/loss, progress/{epoch,num_samples,num_tokens}, optim/zero_grad_ratio, per-subset mixing ratios, MoE max_vio + routing_confidence, perf/peak_memory + the time/* breakdown) are documented. - SFT Dataset format gains a Tool definitions paragraph: rows can carry a `tools` column (OAI function-calling format) or `tool_defs` (verifiers rollout format), as either a list of dicts or a JSON-encoded string. `tool_defs` is auto-converted to OAI shape before being passed into the chat template's `tools=...` argument. `chat_template_kwargs` rows pass through verbatim. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): rename 'Saving HF weights for serving' -> 'Serving checkpoints' Co-authored-by: Cursor <cursoragent@cursor.com> * docs: cross-link the agent skills from training + configuration Adds a callout under the intro of training.md and configuration.md pointing at the equivalent skill files for AI agents working in this repo: - training.md -> skills/training/SKILL.md (top-level routing) + skills/training/start-run/SKILL.md (launch details) + skills/training/monitor-run/SKILL.md (check-in / restart). - configuration.md -> skills/configs/SKILL.md. The skills aren't part of the published Mintlify nav, so the links go to GitHub blob URLs. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): fold Important metrics into RL + SFT trainer sections The standalone "## Important metrics" section is gone. Each trainer subsection now ends with its own "### Important metrics" covering only the metrics relevant to that flow: - RL trainer / Important metrics: reward + rollout signals from the orchestrator, mismatch_kl + entropy + grad_norm from the trainer, and the trainer/orchestrator/vLLM performance grid. - SFT trainer / Important metrics: loss/mean, val/loss, progress counters, optim signals, MoE max_vio + routing_confidence, and the perf/{throughput,mfu,peak_memory} + time/* breakdown. TOC updated to point at #important-metrics (RL) and #important-metrics-1 (SFT) — Mintlify de-duplicates with the same -N suffix scheme it already uses for the two Launch subsections. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): drop Prometheus and BetterStack subsection Not ready for end-user docs yet. Both knobs (trainer.metrics_server.port, trainer.heartbeat.url) are still in reference.md for anyone who needs them, just no narrative coverage. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): tighten Useful knobs language - Use "task" not "prompt" for the conceptual unit ingested by the orchestrator (rows for batch_size and group_size, plus the matching Rules of thumb wording). - group_size: drop the "Used for advantage normalization and pass@k estimation" trailer; the row name is enough. - max_off_policy_steps: rename "throughput-vs-noise dial" to just "off-policy dial". - eval row: drop the "Scores land in trainer logs and W&B as eval/{env}/{avg@k,pass@k}" + `prime eval` trailer; keep the row scoped to what the knob does. - Add log.level to the Monitoring table (trainer/orchestrator process log level, $PRIME_LOG_LEVEL fallback, per-process or global on rl). - Drop --ckpt from Run management; checkpointing has its own section. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): trim RL Performance table to the bottleneck signals Drop the throughput/MFU/async-lag/KV-cache rows from the RL trainer Performance table — they're either generic perf metrics already covered by the SFT trainer's perf table or vLLM-internal. The two remaining rows (time/wait_for_batch, time/wait_for_ckpt) are the useful diagnostic — they tell you which side is the bottleneck. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): refresh chat-template prefix-property paragraph The old wording recommended only patched checkpoints / a custom chat template as the fix for position-dependent templates. The renderer-based path landed in SFT (use_renderer flag) and is now the primary recommended fix, but it's still off by default (use_renderer: bool = False on SFTConfig), so the patched- checkpoint path also still works — and is what examples/reverse_text/sft.toml uses today via PrimeIntellect/ Qwen3-0.6B. Rewrite the paragraph to cover both fixes: - Renderer path: use_renderer = true, lists the hand-coded renderers, calls out the VLM unsupported case. - Patched template path: the prime-rl-patched checkpoint or a user-supplied template that preserves thinking. Cross-link both to Algorithms § Renderers and § Multi-turn trajectories. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): fix SFT data row (data.name, drop default data.type) - data.type = "sft" is the discriminated-union default for SFTConfig.data, so users don't need to spell it out. - The dataset path field is data.name, not data.path. Confirmed against SFTDataConfig.name in packages/prime-rl-configs/src/ prime_rl/configs/sft.py. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): drop loss/nan_count from SFT trainer metrics Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): drop the Environments section Environment installation, authoring, and multi-env mixing are already covered concisely in configuration.md (Environments syntax) and training.md (Useful knobs row pointing at the same). The advanced.md duplicate just spread the same material across three subsections without adding anything material. - Drop the section + its TOC entries. - Update the page intro and overview.md "Where to go next" to stop advertising "environments deep-dive" / "environments installation and authoring". Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): rename "MoE models" -> "Custom modeling" + "LoRA" -> "LoRA training" The first section was conceptually about our custom modeling stack (model.impl = "custom"/"auto", the family registry, EP backends), not about MoE specifically — even though the supported families happen to be MoE-heavy. Rename so the section title matches the defining feature. Bump LoRA to "LoRA training" for parity with the trainer-oriented section names elsewhere on the page. Update the page intro and TOC entries to match. No external doc links to the renamed anchors (#moe-models, #lora) so nothing else to fix. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): drop 'Poolside' prefix from Laguna family row Co-authored-by: Cursor <cursoragent@cursor.com> * docs: rename Vision-language models -> Multimodal training Standardize on "multimodal training" as the section title: - advanced.md: "## Vision-language models" -> "## Multimodal training" + "### Multi-turn VLM training" -> "### Multi-turn training" (the parent context is already multimodal). "### Enabling VLM mode" stays because it's literally enabling the [model.vlm] config block. - advanced.md page intro: "vision-language models" -> "multimodal training". - advanced.md custom-modeling cross-link to (#vision-language-models) -> (#multimodal-training). - overview.md "Where to go next" blurb: align the Advanced bullet's language ("MoE training" + "VLMs") with the destination's section titles ("Custom modeling" + "multimodal training"). reference.md still mentions "vision-language model" in auto-generated descriptions sourced from Pydantic field docstrings. Those are out-of-scope for this rename; would need a config docstring change. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): drop the DeepEP grad-clip-disable tradeoff aside Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): fix the freeze_vision_encoder + LoRA claim The bullet said the combo "has no effect under LoRA (LoRA freezes everything non-adapter regardless)". Source check: packages/prime-rl-configs/.../trainer.py:591-597 now contains a vlm_freeze_incompatible_with_lora validator that explicitly *rejects* the combo with an error. So the user-facing behavior is not silent-no-op, it's a config validation failure. Other bullets in the Limitations list verified against source and are correct as written: - "No multimodal-safe truncation": confirmed in trainer/batch.py (input_ids / mm_token_type_ids truncated to seq_len; mm_kwargs passes through unchanged). - "bfloat16 mandatory": confirmed by the vlms_require_bfloat16 validator in trainer.py. - "Images aren't logged to monitors": confirmed — no image / pixel handling in src/prime_rl/utils/monitor/. The "Higher KL mismatch with multi-image inputs" bullet is left unchanged for now — flagged for review separately because the cited rationale ("minor numerical differences between trainer and vLLM image processing") no longer matches reality after the renderer- only multimodal path landed (#2473): the renderer now owns image processing end-to-end and both sides consume the same pre-processed pixel_values / image_grid_thw. The empirical observation may still hold but the reason given would be stale. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): drop the Multi-turn training subsection The render/pack/forward rendition lived close to internal code and felt out of scope for the user-facing Advanced page; the spawn-method hint that ended it can move elsewhere if needed. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): rename Multi-run manager -> Multi-tenant training User-facing framing now leads with the actual use case: many concurrent LoRA tenants sharing a single trainer + inference deployment, which is the topology behind hosted training on the Prime Intellect platform (Lab). The MultiRunManager class still exists in code and is name-checked in the section body — only the section title and surrounding prose change. - advanced.md: rename TOC entry + H2 + open paragraph; drop the now- redundant "primary use case today" trailer (Lab is in the intro). - advanced.md LoRA section: reword the cross-link. - overview.md: trainer description bullet now says "multi-tenant training" instead of "multi-run manager"; "Where to go next" Advanced bullet renamed similarly. - scaling.md: parenthetical aside on optim_cpu_offload incompatibility updated for consistency. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): trim multi-tenant training to user-facing surface only Drop the per-run filesystem layout, Run discovery / Eviction / Hooks subsections — these are MultiRunManager internals (run_* dir discovery, evicted.txt protocol, hook lifecycle) that don't belong in a user-facing Advanced page. The pointer to src/prime_rl/trainer/runs/ still tells anyone who needs the API where to look. The remaining section is one paragraph: what multi-tenant training buys you, that Lab is the production user, and the trainer.max_concurrent_runs entry point. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add a Development page; move "Testing MoE at small scale" off Advanced Advanced was mixing user-facing features (custom modeling, multimodal, LoRA, multi-tenant training) with developer-facing workflows (building a tiny MoE for modeling-code iteration, adding a new architecture). Split the latter into a new Development page so each audience reads only what's relevant. - New page: docs/development.md, scoped to "developing on prime-rl itself". Contains the unchanged Testing MoE at small scale recipe (build/verify mini model, SFT warmup, RL on reverse-text) and the Adding a new architecture how-to. - advanced.md: drop the section + TOC entry; rewrite the page intro to point at Development for developer-side workflows. - mint.json: insert "development" in the nav between "advanced" and "faqs". - overview.md "Where to go next": add the Development bullet, drop "small-scale MoE testing" from the Advanced bullet. - README.md docs index: same split (Advanced + Development as two separate bullets). No external links to the moved anchors needed updating; the only existing cross-link was the relocated TOC entry in development.md itself. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(algorithms): fold Renderers into Multi-turn trajectories Renderers existed as a top-level section because they were added in a follow-up, but conceptually they're the mechanism that makes best-effort interleaving safe — splitting them apart forced a forward-reference and duplicated the "exact-prefix invariant" framing. - Demote "## Renderers" to "### Renderers" inside "## Multi-turn trajectories", placed between Best-effort interleaving and Discontinuous trajectories. - Move the Qwen3 thinking-stripping example from Best-effort interleaving into Renderers — it's the failure case the renderer fixes, so it reads better adjacent to the family list / config block. - Drop the "Workaround: use a chat template that preserves thinking" trailer; the patched-checkpoint workaround for SFT is already documented in training.md and isn't relevant in the orchestrator context (use_renderer defaults to true). - Open Multi-turn trajectories with a forward-link to Renderers so the reader knows the safety mechanism is coming. - TOC updated; both #multi-turn-trajectories and #renderers anchors preserved (only their nesting changes), so the existing cross- links from training.md and faqs.md keep working. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(algorithms): drop max_async_level tuning + reframe as fixed one-step max_async_level is being deprecated as a user-facing knob (hardcoded to 1; matching reframe in docs/async.md on feat/deprecate-max-async- level). Update algorithms.md so the long-form treatment matches. - Drop the "### Tuning max_async_level" subsection (the k=0/1/2/>=3 table) and the NCCL-needs-max_async_level=1 line that follows it — both become vacuous when k is fixed at 1. - Reword the Async / off-policy training intro to describe the one-step overlap directly instead of "up to k steps where k = max_async_level". - Step semantics: rho_inference is now pi_{max(0, n-1)}, with prose "inference is exactly one step behind the trainer" replacing the generic "gap is at most k steps". - Drop the Tuning entry from the page TOC. Other docs (overview.md intro, training.md rule of thumb, faqs.md two entries, scaling.md NCCL-example comment) still mention max_async_level and are now stale; will clean those up in the next turn unless flagged otherwise. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): add Test suite + Pre-commit hooks sections Pull in the testing- and contributor-workflow content from README and the GitHub Actions configs so contributors don't have to dig through .github/workflows/ to figure out what runs where. New sections in development.md: - Test suite - Layout: tests/unit/, tests/integration/, tests/nightly/ — what each tier is for, with the actual file names contributors will encounter. - Running tests locally: pytest one-liners (everything, unit-only, integration-only, -m "not gpu", -m gpu, single file). - CI workflows: a 3-row table covering cpu_tests.yaml, gpu_tests.yaml (matrix list pulled verbatim from the workflow), and nightly_tests.yaml — including the trigger conditions (cpu = always, gpu = non-draft, nightly = scheduled + workflow_dispatch) and the runners (ubuntu-latest, vm/4xa6000, research-cluster). - Markers: gpu + slow, both declared with --strict-markers in pyproject.toml. - Pre-commit hooks - uv run pre-commit install - Currently configured hooks: ruff check/format and docs-reference (regenerator that fails the commit if docs/reference.md would drift). Plus update the Development pitch in overview.md "Where to go next" and README.md docs index to mention the new scope. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(algorithms): fold Length penalties into Default advantage Length penalties are configured under [orchestrator.length_penalty] and layer on top of *any* advantage function — they're conceptually not a standalone advantage variant. Move them into Default advantage where readers will see the option while reading about advantages. Drive-by: clean up the parenthetical hint in Default advantage. The old version listed "length penalties tied to turn count" as a reason to write a custom advantage, which conflicts with the actual turn-count length penalty being a built-in. New wording points length-penalty users at the now-adjacent built-in section, and points custom-advantage users at trajectory-metadata-driven shaping (sub-agents, relative-rank, …). TOC entry for #length-penalties dropped; no external doc links to that anchor. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(advanced): add Difficulty pools + Online difficulty filtering Covers the two complementary buffer-side mechanisms for keeping the trainer batch high-signal. Verified each claim against src/prime_rl/orchestrator/buffer.py and packages/prime-rl-configs/ src/prime_rl/configs/orchestrator.py. - Difficulty pools (buffer.easy_threshold / hard_threshold + easy_fraction / hard_fraction): per-problem running-average reward is compared to the thresholds; problems hitting either bound move to easy/hard pool and stop being sampled. Pool assignments persist across checkpoints (easy_examples.jsonl / hard_examples.jsonl); *_fraction lifts a fraction of pooled problems back into normal on resume / start. - Online difficulty filtering (buffer.online_difficulty_filtering bool): groups whose avg reward is exactly 0.0 or 1.0 are dropped from the buffer because their within-group advantage is zero (DR-GRPO produces no signal). Counted under filtered_rollouts/ {env}/{easy,hard} for visibility. - The tradeoff bit the user asked for explicitly: with ODF on each trainer step's effective batch is dense + predictable, but the orchestrator pays for the throw-away rollouts and may need a higher oversampling_factor; if time/wait_for_batch is already high on the trainer, ODF can starve the loop. - ODF is orthogonal to the pools — ODF reacts to the current group's reward distribution, pools track the running per-problem average. Configs often use both. Plus a one-line page-intro update + TOC entries. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: relocate Difficulty pools + ODF from Advanced to Algorithms Both are buffer-side controls over what reaches the trainer — same conceptual category as Filters and the loss/advantage knobs. Algorithms is the right home; Advanced is for orthogonal feature sets (LoRA, multi-tenant, custom modeling, multimodal). Promote each to its own top-level section. - algorithms.md: new "## Difficulty pools" and "## Online difficulty filtering" sections, inserted between Filters and Multi-turn trajectories. TOC updated. - advanced.md: section + TOC entries + page-intro mention removed. Content unchanged from the previous commit on Advanced — same threshold / fraction / persistence claims, same ODF tradeoff explanation, same cross-link to oversampling_factor. ODF section back-links to Difficulty pools for the orthogonality note. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): split MoE-debug recipe; promote "Adding a new architecture" - "Adding a new architecture" promoted to its own top-level section, placed *before* the renamed Debugging MoE recipe so the natural reading order is "here's how to wire up a new arch -> here's how to smoke-test it". Step 3 of the recipe now forward-links to Debugging MoE instead of "the three steps above". - "Testing MoE at small scale" -> "Debugging MoE". The page is already titled Development, so the qualifier was redundant. - Subsection titles drop the "Step N:" prefixes (the page-level TOC already implies sequence) and switch to sentence case for consistency with the rest of the docs: - Step 1: build and verify a mini model -> Build and verify a mini model - Step 2: SFT warmup -> SFT warmup (already correct) - Step 3: RL on reverse-text -> RL on reverse-text (already correct) - TOC updated; README docs index pitch swaps "small-scale MoE testing" -> "debugging MoE" to match the new section title. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): tighten Debugging MoE subsections - "### Build and verify a mini model" -> "### Create mini model". The roundtrip-verify body covers the "and verify" half; the shorter title is enough. - Merge "### SFT warmup" + "### RL on reverse-text" into one "### Smoketest training" subsection. The two were always run together as a single end-to-end smoke test (warmup so KL is meaningful, then RL stack), so a single subsection with two code blocks reads better than two artificially-split ones. - TOC updated. No external doc links to the old sub-anchors. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: rename Worked example -> Examples; update reference generator User-facing docs no longer reference configs/ directly — examples/ is the only "we keep this up to date" surface, the rest is CI- and debug-internal: - configuration.md: launch line + worked-example switched to examples/reverse_text/rl.toml. Section renamed "Worked example" -> "Examples" with a curated tour of the 10 README examples (basic 1-8 GPU + advanced SLURM tiers); the compose / override / dry-run walkthrough lives as a "### Worked example" subsection. - training.md: drop the "Debug configs for all variants ship under configs/debug/training_modes/" pointer in the Training modes section. The prose already explains how to set the mode. - scaling.md: P/D inference now points at examples/glm5_pd_disag/ rl.toml (with a link to its README) instead of the configs/-side inference-only TOML. - faqs.md: install-verify and smoke-test recipes both switch from configs/debug/sft and configs/gsm8k to examples/reverse_text. Reference generator (scripts/generate_docs_reference.py): - Drop "from the Pydantic config models" from the page header. - Move the regenerate command + structural notes from the header to a new "## About this page" footer. - Wrap the Type column in code spans so list[int], int | None, etc. render as code instead of plain text. fmt_type now emits literal `|` (GFM accepts pipes inside code spans inside table cells; no escaping needed). - Walk list-of-BaseModel fields. Previously orchestrator.train.env / orchestrator.eval.env / orchestrator.filters were rendered as one row showing the default repr; their leaf fields never showed up. New _list_inner_models() detects both list[X] (single model) and list[Annotated[Union[A | B], discriminator]] (discriminated union of list items, e.g. filters: list[FilterConfig]). Index placeholder rendered as <n> to match the CLI form (--orchestrator.train.env.0.id ...). Regenerate reference.md: +5k chars, mostly the new env/filter list-item subsections that were missing before. development.md still references two CI-tested configs/ paths (configs/debug/moe/sft/train.toml, configs/ci/integration/ reverse_text_moe/start.toml) — those are validated by the reverse_text_moe GPU integration test on every PR, so they don't risk drifting. Flagging in case the user wants those swapped too. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(training): correct batch-size rule of thumb 128-512 is the range for quick ablations, not production. Production RL often runs at 1024+. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: relocate "Disaggregated prefill/decode inference" to Advanced P/D disaggregation is a feature you opt into for large-MoE serving, not a step on the single-GPU -> 1000-GPU scaling ladder. It pairs naturally with Custom modeling / multi-tenant / multimodal as a specialized inference topology, so Advanced is the right home. - scaling.md: drop the section + TOC entry + "disaggregated prefill/decode inference" from the page intro. Page intro now forward-links to Advanced for users who came in for P/D. - advanced.md: append the section after Multi-tenant training, unchanged content (P:D ratio table, glm5_pd_disag example link, queue-depth monitoring snippet, UCX 1.19 build-from-source note). TOC + page-intro list updated. - overview.md "Where to go next": drop disagg from the Scaling bullet, add to the Advanced bullet. Anchor preserved (#disaggregated-prefilldecode-inference) — no external doc links to it survived the move check. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(scaling): correct the Single GPU section The previous claim "trainer and inference server can share a GPU" via the rl launcher was wrong. Verified against src/prime_rl/entrypoints/rl.py:86-99: the launcher partitions visible GPUs strictly (inference 0..N-1, trainer N..N+M-1) and raises ValueError when total_requested_gpus > len(physical_gpu_ids). Setting CUDA_VISIBLE_DEVICES=0 + --num-infer-gpus 1 + --num-train-gpus 1 makes total=2, visible=1, validation fails before anything launches. What actually works for single-GPU RL is the manual three-pane launch: each of uv run {inference,orchestrator,trainer} is an independent process with no cross-process GPU validation, so pinning CUDA_VISIBLE_DEVICES=0 on inference *and* trainer lets them share the same physical GPU. - Drop the misleading `uv run rl` recipe. - Promote the manual three-pane recipe to the canonical single-GPU path, with CUDA_VISIBLE_DEVICES=0 spelled out on both the inference and trainer panes. - Lead with SFT (where single-GPU is the default and just works). - Add an explicit "single-GPU RL is for debugging only" caveat. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(scaling): collapse Single GPU / multi-GPU / Multi-node manual into one umbrella - New umbrella section "## Single-node vs. multi-node deployment" framing the [deployment] discriminated union as the user-facing knob: single_node runs locally; multi_node currently goes through SLURM. Subsections nest beneath: - ### Single GPU (unchanged content from "## Single GPU") - ### Single-node multi-GPU (unchanged from "## Single-node multi-GPU") - #### RL placement - #### SFT and torchrun - ### Multi-node (new short pointer to ## SLURM with two cross- links to the existing RL / SFT-and-inference examples) - The umbrella section opens with a callout that manual multi-node launches are technically possible but reimplement what the SLURM launcher does — the user's preferred framing. - Drop "## Choosing a layout" entirely (the new umbrella section conveys the same routing more naturally + the layout table was going stale). - Drop "## Multi-node (manual)" entirely (RL training, SFT training, Multi-node inference subsections all gone). Anyone who needs the manual recipe can replicate what the SLURM templates do. Cross-link fixes: - training.md SFT § Launch line previously pointed at scaling.md#sft-training (under "## Multi-node (manual)"). Now points at scaling.md#sft-and-torchrun for non-default single-node layouts and scaling.md#slurm for multi-node. - faqs.md "Multi-node without SLURM or K8s?" answer updated: from "yes, see [Scaling § Multi-node (manual)]" to "not currently documented; technically possible but reimplements the SLURM launcher". Page intro adjusted to match the new structure ("multi-node SLURM and Kubernetes deployments" -> "single-node and multi-node deployments"). Co-authored-by: Cursor <cursoragent@cursor.com> * docs: drop Kubernetes coverage for now The K8s Helm chart at k8s/prime-rl/ still ships, but the user-facing docs are dropping coverage until the chart and the matching guide are re-validated together. - scaling.md: drop the "## Kubernetes" section + TOC entry. Page intro already covered (was reworded earlier in the restructure). - overview.md "Where to go next": drop "Kubernetes guides" from the Scaling bullet. - README.md docs index: drop "Kubernetes" from the Scaling bullet. The two passing-mention "k8s" / "Kubernetes" lines in README (Overview features list, Advanced Training Examples adaptability note) are left as-is — they describe codebase capability, not docs coverage. Reference.md still mentions Kubernetes liveness probes in an auto-generated field docstring; that's source-side, out of scope for this pass. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): tighten test-suite layout bullets - Drop the example test filenames from the tests/integration/ bullet — they're a moving list and not the point. - Reframe the tests/nightly/ bullet around what it does (runs the examples/ configs to catch regressions) instead of listing the individual nightly tests by name. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): drop the nightly 24h-timeout / research-cluster aside Co-authored-by: Cursor <cursoragent@cursor.com> * docs(development): polish 'Adding a new architecture' prose - Replace the bare 'To add (e.g.) Kimi 2.5:' opener with a one-line framing of the two-step contract: implement modeling code, register a mini preset for smoke-testing. - Bold the leading verb on each numbered step so the structure reads as a checklist. - Step 1 now nudges readers at glm4_moe/ and qwen3_moe/ as templates for the modeling code. - Step 2 explains *what* the preset is for ('build a ~0.5B test model in your architecture') rather than just listing fields. Path now links to scripts/mini_moe.py. - Step 3 says what the smoke-test actually exercises (roundtrip + SFT + RL stack) so users know what 'smoke-test' means here. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(docs-reference): add minimal GITHUB_TOKEN permissions CodeQL alert actions/missing-workflow-permissions (security/code-scanning/19) flagged the new workflow for relying on the repo's default GITHUB_TOKEN permissions. The workflow only checks out code (contents: read), syncs deps via uv, runs the doc generator, and runs git diff. None of that needs write scope on any resource type. Pin to contents: read at the workflow level — explicit minimum that satisfies the rule. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: refresh architecture + async diagrams - assets/architecture.png: replace with the new diagram (trainer + orchestrator + inference deployment, GPU layout per process, data + scheduling + weight-broadcast arrows). Was 511k 96dpi, now 111k @ 200dpi from architecture.pdf. - assets/two-step-off-policy.png removed; assets/async-pipeline.png replaces it with the cleaner one-step-overlap diagram (trainer steps g_0..g_n above, inference samples with theta_{n-1} below). algorithms.md image reference + alt text updated to match the post-deprecation "one-step overlap" framing. - assets/rollout-timeline.png added but not yet referenced. It's a continuous-time view showing rollouts spanning policy boundaries (policies pi_{i-2}, pi_{i-1}, pi_i on the x-axis with rollout bars crossing the boundaries) — that's the picture behind max_off_policy_steps, not max_async_level. Want me to drop it into algorithms.md (e.g. above the off-policy / max_off_policy discussion) or save it for later? Co-authored-by: Cursor <cursoragent@cursor.com> * docs: normalize package mentions to [\`pkg\`](github-url) User-facing prose mentions of verifiers / renderers / research- environments / pydantic-config now consistently render as code-spans with a github link to the package. Affected lines: - overview.md: orchestrator-bullet [verifiers](url) (dropped the bare-text variant), install paragraph (linked all three submodules individually), quick-run paragraph. - algorithms.md: "Since [\`verifiers\` v0.1.8]..." (added backticks around the package name in the release-tag link). - training.md: SFT \"verifiers submodule\" launch line, useful-knobs vf_level row, tool-defs paragraph. Intentionally left alone: - algorithms.md \`verifiers.RolloutOutput\` (dotted-path code ref; whole expression already in code). - algorithms.md / training.md [renderers](#renderers) / [Renderers] (#renderers) (internal anchors to the in-page section, more useful than the github repo for a reader inside the doc). - algorithms.md "Hand-coded renderers ship for ..." and "the renderers writeup on the PI blog" — generic prose, not a package mention. - reference.md docstring-sourced mentions ("verifiers package", "renderers package", etc.) — those come from Pydantic field docstrings; would need source-side edits + regen. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(overview): drop the async-by-default + loss summary paragraph Out of date with the max_async_level deprecation and duplicates content already covered properly in algorithms.md (one-step overlap framing + the AIPO/KL loss math). Architecture bullets above already mention async semantics where relevant. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(overview): tighten 'Where to go next' to one-line pitches Co-authored-by: Cursor <cursoragent@cursor.com> * docs(readme): collapse test-suite commands into one code block Was four separate code blocks separated by one-line prose; now a single bash block with inline-comment annotations for each variant. Reads cleaner and matches the test-suite block in development.md. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: review-pass cleanups (max_async_level fallout, anchor fix, smoke-test) Self-review found a handful of small inconsistencies and stale claims that survived earlier passes. Stale max_async_level references (now hardcoded to 1, so any prose that treats it as tunable is wrong): - faqs.md: "If growing, drop max_async_level or LR" -> drop max_off_policy_steps. NCCL FAQ no longer says "requires max_async_level=1" — that constraint is vacuous. - training.md Rules of thumb: NCCL/max_async_level=1 dropped from the dry-run validator example; CP / flash-attention example stays. - scaling.md NCCL example: drop the trailing "# synchronous; max_async_level forced to 1" comment. Other accuracy / consistency fixes: - faqs.md hardware FAQ: drop "you can co-locate both on a single GPU" — verified earlier that the rl launcher rejects this; the manual three-pane recipe is the actual single-GPU path. Cross- link to Scaling § Single GPU. - faqs.md max_off_policy_steps wording: "throughput-vs-noise knob" -> "off-policy dial" to match algorithms.md / training.md. - training.md sft.data.loss_mask cross-link: anchor was reference.md#sft-data (the discriminated-union heading); the loss_mask sub-table actually lives at #sft-data-sft-loss-mask. - development.md "Smoketest training" -> "Smoke-test training" in the section title and TOC anchor, matching the hyphenated verb form ("smoke-test the new architecture") used in the page body. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: review-pass cleanup (drop FAQs, Title Case, smell fixes) Four asks rolled in: 1. **Drop docs/faqs.md entirely.** Removed the file plus all its cross-references: docs/mint.json nav, README.md docs index, and docs/overview.md "Documentation" list. The standalone Q&A page wasn't pulling its weight against the verifiers tone reference. 2. **Title Case all headings** across the user-facing pages so the visual style matches deps/verifiers/docs/* (which uses "Hosted Training" / "Performance Trade-offs" etc., not sentence case). Anchors are slug-based (lowercase + hyphen), so internal #links survive the case flip — only the link text in cross-doc "§ Section" references needed updating (training.md → Algorithms § Multi-Turn Trajectories, training.md → Scaling § SFT and Torchrun, scaling.md → Configuration § TOML Composition, scaling.md → SLURM § RL Example / SFT and Inference Examples). 3. **Rename overview.md "Where to go next" → "Documentation"** for symmetry with the verifiers landing page. 4. **Smell fixes**: a. algorithms.md had two near-identically-named subsections ("### The default loss" under Async with the loss math, and "### Default loss" under Loss with the mode dispatch). Collapse: the loss math now lives under "## Loss > ### Default Loss" together with the rl/opd/sft mode-dispatch bullets; the Async section is just intro + step semantics. One source of truth. b. reference.md auto-generated docstring mentions of "verifiers package" / "renderers package" / "renderers library" / "renderers.parsers" / "Registered verifiers environment ID" now render as [`pkg`](github-url) links. Source-side edits in packages/prime-rl-configs/src/prime_rl/configs/{shared, orchestrator,sft}.py, then regenerated reference.md. Net: faqs.md deletion (-198) dominates; everything else is small churn for case + anchor consistency. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: tightening pass after main merge Restructure + accuracy fixes that were piled up locally during the SSH-signing block earlier today. - configuration.md: note that reusing an env id requires a unique name; drop the "See each environment's README on the Hub" tail. - development.md: collapse "Adding a New Architecture" + "Debugging MoE" (with its Create Mini Model + Smoke-Test Training subsections) into a single "## Adding a New Model" with three subsections — Implement the Modeling Code, Register a Mini Preset, Run the Smoke Test. Page intro updated. - scaling.md: drop "## Single GPU" subsection; rename "## Single-Node Multi-GPU" -> "## Single-Node" so "Single-Node vs. Multi-Node Deployment" has just two clean children. Drop the manual-multi- node prose. Drop the [slurm] field reference table; rename the section to "## [deployment] Block" and link to reference.md. Collapse the two example subsections into one "## Examples" with pointers to examples/multinode/{rl,sft}.toml. Rename "## CPU Optimizer Offload" -> "## Optimizer Offloading". Add new "## LM Head Chunking" subsection covering the fused_lm_head_token_chunk_ size knob. Drop torchrun phrasing in the SFT scaling subsection, the CP recommendation paragraph, "(offloads checkpoints to CPU)" parenthetical, "RL gradient-accumulation amortization" line, attn = "flash_attention_2" from the memory-tight recipe, dry-run invaluable line. - algorithms.md: drop the Step Semantics subsection heading (body stays); replace the AIPO link with a plain "DPPO + KL similar to Kimi-K2.5" framing. - advanced.md: drop the "## Custom vs HF Implementations" subsection heading; the body becomes the lead content under "## Custom Modeling". - overview.md + README.md: pitch updates ("adding a new architecture" -> "adding a new model"; FAQs row already gone). Co-authored-by: Cursor <cursoragent@cursor.com> * docs: drop the auto-generated reference page and its tooling Removes everything in the reference-generation pipeline: - docs/reference.md — the 197k-char auto-generated field reference. - scripts/generate_docs_reference.py — the generator that walks Pydantic config trees, discriminated unions, list-of-models, etc. - .github/workflows/docs-reference.yaml — the CI guard that ran the generator and failed on git diff drift. - .pre-commit-config.yaml — drops the local docs-reference hook that re-ran the generator on staged config-class edits. Knock-on cleanup of cross-references: - mint.json: drop the "reference" page from nav. - overview.md / README.md: drop the Reference bullet from the Documentation list / docs index. - configuration.md: drop the two trailing "See [Reference] ..." pointers (under Discriminated Unions and at the end of the Examples section). - training.md: drop the "for the full field reference see [Reference]" tail in Useful Knobs; the loss_mask row no longer cross-links and just lists the four roles. - scaling.md: drop the [Reference § trainer.model] DeepEP pointer and the [Reference § slurm] pointer in the [deployment] block. - algorithms.md: drop the [Reference § orchestrator length penalties] line. - development.md: simplify the Pre-Commit Hooks section — only the ruff hook remains, so the configured-hooks bullet list goes away. Co-authored-by: Cursor <cursoragent@cursor.com> * revert: drop github-url docstrings on config fields The earlier edits added [\`verifiers\`](github-url) / [\`renderers\`] (github-url) markdown to a handful of Pydantic field docstrings so the auto-generated docs/reference.md rendered them as code-spans with links. With reference.md now removed, those annotations are inert clutter inside the runtime config classes — they don't render anywhere user-facing. Restore the three affected files to their state on main: - packages/prime-rl-configs/src/prime_rl/configs/orchestrator.py - packages/prime-rl-configs/src/prime_rl/configs/sft.py - packages/prime-rl-configs/src/prime_rl/configs/shared.py Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com> |