trinity
103
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6087c3addb |
Add LoRA adapter warm start and longer adapter reload timeouts
- model.lora.init_path on trainer and orchestrator initializes a fresh optimizer run from an attention-only PEFT adapter (strict shape, key, and finiteness checks). - Adapter reload read timeout 30s -> 300s and retry budget 120s -> 600s; loaded TP2/DP3 servers can take minutes to apply an update. |
||
|
|
55fc08db46 |
feat(rl): pack multimodal samples with context parallelism (#3103)
* feat(rl): pack multimodal samples Multimodal RL samples no longer force one-sample micro-batches: eager image samples pack with text spans and compatible mm_kwargs samples from the same run/LoRA, with per-sample boundaries kept in seq_lens. Packing is always on — VLM training is custom-implementation-only and the custom Qwen3.5 models advertise supports_packed_multimodal_training; a config validator requires varlen flash attention for VLM training and validate_multi_modal_pack fails loudly at startup for models without packed-MM support. Ported from #2889 minus its gating (pack_multimodal knob, resolve_pack_multimodal) and its tokenizer packer params (removed on main since). (cherry picked from commit 027edc2c510c35ab5666e8f9cbf160f58b1fba48) * fix: fail loudly when RL micro batches carry multimodal data without [model.vlm] Mirrors the SFT-side check: transported mm samples would otherwise flow into forward unvalidated (no packability, attn, or freeze policy checks). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(rl): preserve multimodal packing across workers Keep multimodal bins intact during worker balancing and reject malformed multimodal samples before they can stop shared multi-run packing. |
||
|
|
cd00986f71 |
feat(monitor): add local file monitor (#3111)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
c505e07a1a |
feat(weight-transfer): add NIXL + ModelExpress synchronization (#3060)
* feat(weight-transfer): add NIXL ModelExpress synchronization * refactor(weight-transfer): simplify NIXL integration * refactor(weight-transfer): simplify NIXL worker planning * refactor(weight-transfer): align MX update lifecycle * feat(inference): pass through online quantization methods * feat(weight-transfer): add GLM trainer conversion graph * feat(weight-transfer): stream NIXL updates by layer * feat(weight-transfer): pipeline NIXL layer reloads * fix(weight-transfer): preserve single-buffer NIXL behavior * fix(weight-transfer): reserve observed inference peak * feat(weight-transfer): preserve model-declared FP32 tensors * cleanup(weight-transfer): simplify trainer wire schema * cleanup(weight-transfer): make trainer shard ranges explicit * cleanup(weight-transfer): resolve model conversions through registry * cleanup(weight-transfer): clarify lazy copy destinations * cleanup(weight-transfer): derive lazy metadata from source * cleanup(weight-transfer): rename weight load tracing * cleanup(weight-transfer): name recorded tensor operations * cleanup(weight-transfer): simplify transfer planning * cleanup(weight-transfer): consolidate load graph * cleanup(weight-transfer): name trainer tensor table * cleanup(weight-transfer): clarify tensor routing * cleanup(weight-transfer): simplify NIXL adapter * cleanup(weight-transfer): clarify ModelExpress sessions * cleanup(weight-transfer): clarify CUDA memory sizing * cleanup(weight-transfer): clarify staged trainer shards * cleanup(weight-transfer): simplify trainer broadcast guards * cleanup(weight-transfer): clarify trainer staging state * cleanup(weight-transfer): simplify trainer constants * cleanup(weight-transfer): use ModelExpress client name * cleanup(weight-transfer): clarify trainer shard discovery * cleanup(weight-transfer): structure trainer initialization * cleanup(weight-transfer): reuse trainer agent metadata * cleanup(weight-transfer): reuse trainer table fragments * cleanup(weight-transfer): simplify trainer staging setup * cleanup(weight-transfer): simplify inference transfer planning * cleanup(weight-transfer): split inference plan construction * cleanup(weight-transfer): clarify inference replay methods * cleanup(weight-transfer): localize receive arena sizing * cleanup(weight-transfer): clarify loader recording wrapper * cleanup(weight-transfer): clarify watcher synchronization * cleanup(weight-transfer): unify checkpoint wait timing * cleanup(weight-transfer): align in-memory broadcast lifecycle * fix(weight-transfer): skip NIXL startup filesystem wait * cleanup(weight-transfer): use declarative model conversions * style(weight-transfer): format NIXL implementation * fix(weight-transfer): stabilize ranks and final watcher step * fix(tests): use instance conversion API * cleanup(weight-transfer): scope package to NIXL * cleanup(weight-transfer): align names and package layout |
||
|
|
cb74ae2beb |
feat: bump verifiers to 0.2.2.dev7, adopt the multi-agent episode wire (#3104)
* feat: bump verifiers to 0.2.2.dev7, adopt the multi-agent episode wire Companion to PrimeIntellect-ai/verifiers#1939 (multi-agent api). Re-pins deps/verifiers to 192fd8ef0 (= 0.2.2.dev7) and deps/pydantic-config to v0.4.2 (verifiers now requires prime-pydantic-config>=0.4.2). - Serve wire: the env-server route run_rollout -> run, answering one Episode envelope ({id, env, ok, errors, traces}) per env-rollout. Env.run returns list[Rollout]; an episode that failed before minting any trace raises (the dispatcher synthesizes its error marker), and a not-ok episode marks its clean traces failed so a broken episode's partial seats are never trained on. - The episode is the pipeline currency: the dispatcher emits one episode (list[Rollout]) per completed task onto out_q (a legacy run_group result emits its traces as single-trace episodes), and both sinks count episodes - never loose traces - toward group_size and eval epoch sizes. episode_id is stamped into info so saved records keep grouping. - ok is the success sentinel: has_error now reads it, so the dispatcher's empty-trajectory promotion also flips ok, and error markers carry it. - Only the trainable subset becomes training samples: a trace stamped untrainable (a multi-agent env's frozen agent) is never tokenized, never enters the group advantage, and never ships; it still lands in the trace files and observation window. - Config shape: everything env lives under the env block, following the new vf.EnvServerConfig (env.taskset, env.agent.harness, per-agent caps under env.agent.*). All checked-in TOMLs migrated; the spawned env server receives the picklable env block via env_config_data. - run_group survives only for v0/legacy bridge envs (a v1 server refuses it and always reports requires_group_scoring=False); vf's @group_reward removal doesn't touch prime-rl's own Algorithm.score_group. Verified: tests/unit green (487 passed; config-loading params covered all migrated TOMLs), ruff clean, and a 3-step reverse-text RL run on 2 GPUs trains at 0% errors with every saved trace carrying ok, agent.name, agent.trainable, and a distinct info.episode_id. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: trim narrative comments to the load-bearing facts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: count buffered sink progress in episodes; explicit ok=False on cancel markers Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: keep untrainable traces out of the effective views and the derived avg@k Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
d69dbb8da4 |
feat(cp): context parallelism for hybrid + VLM SFT (#3099)
* feat(cp): context parallelism for hybrid + VLM SFT Unify model CP setup and make packed-boundary metadata CP-aware: - setup_model_cp replaces setup_hybrid_cp/setup_nemotron_h_cp: models owning linear-attention/Mamba layers expose set_context_parallel_attributes (dense + MoE Qwen3.5, NemotronH) and wire their own layers; hybrid models without the hook are rejected instead of silently misconfigured. - seq_lens stays global under CP: documents can straddle the shard cut, so input_ids/position_ids shard per rank while seq_lens keeps the full pre-shard boundaries, flagged via seq_lens_are_global through forward() / prime_forward_kwargs into both Qwen3.5 models. A cu_seqlens_are_global provenance flag rides along to fla's GatedDeltaNet instead of reading cu_seqlens back (which cost one CPU-GPU sync per linear-attention layer per microbatch); the CP conv path switches to fla's causal_conv1d with a CP context so conv state passes between ranks with document-boundary resets. - VLM CP defers sharding to the model: the vision encoder and the image-embed merge see the full sequence, then the root forward shards embeds/positions (shard_position_ids_for_cp handles 3D MRoPE) and updates ulysses attention params from global seq_lens. The SFT trainer skips pre-sharding for MRoPE batches; the vision encoder is pinned to SDPA under CP. - shard_for_cp validates divisibility (uneven shards deadlock ulysses all-to-all) and CatDataset's seq_len padding guarantees it; the LoRA token count follows the sharded loss_mask. - Qwen3.5 CP requires the custom implementation (the HF impl has no set_context_parallel_attributes); rejected in get_model. |
||
|
|
0af5506215 |
feat(sft): multimodal (VLM) SFT (#3075)
* feat(sft): multimodal (VLM) SFT Renderer-produced multimodal samples flow end to end through SFT: - SFTDataset keeps the renderer's MultiModalData: image-safe truncation (never cuts inside a placeholder run, drops truncated-out images, and skips samples whose EOS was truncated away), mm_token_type_ids kept aligned through EOS append and causal shift, video inputs rejected explicitly. _flatten_mm_items folds per-image processor outputs into model-forward kwargs (pixel_values, image_grid_thw, ...). - Cat packing concatenates mm_kwargs across samples in a pack and represents text-only spans as zeros in mm_token_type_ids; stack bucketing emits multimodal samples solo. Collates move mm tensors to CUDA and keep packed rows batch-size 1. - Local data_files normalization wraps string message content into typed content blocks under a multimodal flag so Arrow can unify text and image rows. - setup_processor loads the AutoProcessor and attaches it to the renderer; VLM SFT fails fast without one; weight checkpoints save the processor alongside the tokenizer. - Dense Qwen3.5 gains the composite VLM body (HF vision encoder + custom text model) with MRoPE positions from mm_token_type_ids and registers in _CUSTOM_VLM_MAPPING; VLM training requires a custom PrimeRL implementation. Both dense and MoE VLM bodies always run the vision encoder (dummy input on text-only microbatches, kept in the backward graph) for FSDP/EP collective symmetry. - Config: VLM SFT requires micro_batch_size=1; unfreezing the vision encoder is incompatible with LoRA; the renderer-vs-VLM rejection is gone (renderers own multimodal tokenization now). |
||
|
|
4453922943 |
chore: bump verifiers to 0.2.1, prime-pydantic-config to 0.4.2, renderers to 0.1.8 (#3095)
* chore: bump verifiers to 0.2.1, prime-pydantic-config to 0.4.2, renderers to 0.1.8 - deps/verifiers -> v0.2.1 (ab65b6e8d), pin verifiers[harbor]>=0.2.1 - deps/pydantic-config -> v0.4.2 (4f5ae37), pin prime-pydantic-config>=0.4.2 - prime-rl-configs: verifiers>=0.2.1, renderers>=0.1.8 (drop dev pins) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: bump research-environments to verifiers 0.2.1 pins Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: drop use_prime_registry from example configs research-environments#676 removed the field from the swe/terminal tasksets (the platform now auto-builds images from any docker ref), so taskset configs no longer accept it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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) |
||
|
|
8dcf55acbc |
feat(trainer): use seq_lens as the packed-sample boundary contract (#3032)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: use seq_lens as the packed-sample boundary contract - Thread seq_lens through transport, packer, trainer forward, and all model forward methods - Add get_cp_local_seq_lens() for CP sharding of document boundaries - Replace get_cu_seqlens_from_position_ids with get_cu_seqlens_from_seq_lens in models - Remove StackDataset and pack_function config (cat is the only packing strategy) - Fix pending_sample preservation across resume in CatDataset - Change padding to extend last segment rather than creating a new one - Remove SDPA/eager guards — flash attention is the only path (consistent with PR #3057) - Update all model tests to pass seq_lens - Add seq_lens and padding_len to MicroBatch transport type * refactor: remove redundant packing metadata Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Sami Jaghouar <sami@primeintellect.ai> Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
cac463e795 |
feat: use FA3 as default, rename fa4 to flash_attention_4, remove eager (#3057)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: use FA3 as default, rename fa4 to flash_attention_4, remove eager Three changes: 1. Default attention implementation changed from flash_attention_2 to flash_attention_3. 2. Renamed internal 'fa4' alias to 'flash_attention_4' everywhere for consistency. The _ATTN_ALIASES mapping and _normalize_attn_alias validator are removed since flash_attention_4 is now the canonical name. The _register_fa4_attention_interface noop is also removed since transformers already registers flash_attention_4 in AttentionInterface._global_mapping. 3. Removed 'eager' from AttnImplementation Literal. GPT-OSS non-Hopper fallback updated to suggest 'sdpa' instead of 'eager'. * fix: allow impl='auto' with FA3/FA4 + CP, fix ruff format - Update CP+FA3/FA4 validator to also accept impl='auto' (which resolves to 'custom' at runtime for supported models). This fixes the config test for rl_qwen3_30b_a3b.toml which uses cp=2 with the new FA3 default. - Apply ruff format to qwen3_5 and qwen3_5_moe model files (multi-line tuple formatting for long in-check). * feat: remove sdpa and eager attention support Remove 'sdpa' and 'eager' from AttnImplementation. Only flash_attention_2, flash_attention_3, and flash_attention_4 are now supported. Changes: - Remove 'sdpa' from AttnImplementation Literal in trainer config - Remove SDPAAttention class from layers/attn.py - Remove all SDPA attention classes from custom models (AfmoeSDPAAttention, LagunaSDPAAttention, Qwen3_5MoeGatedSDPAAttention, Qwen3_5GatedSDPAAttention) - Remove 'sdpa' entries from all ATTN_IMPL2CLASS dispatch dicts - Remove eager->sdpa fallback logic in afmoe, laguna, qwen3_5_moe - Set _supports_sdpa = False on all custom model configs - Remove GPT-OSS non-Hopper SDPA fallback (now errors on non-Hopper) - Update normalize_qwen3_5_attn_implementation to drop eager alias - Update default attn_impl in qwen3_5/qwen3_5_moe _check_and_adjust - Update configs and tests to use flash_attention_2 instead of sdpa - Mark test_qwen3_5_dense_matches_hf_state_keys_on_meta as GPU test (HF model validates flash attn availability at init, requires GPU) * fix: accept impl='auto' for flash_attention_4 validator Same pattern as the CP+FA3/FA4 validator fix: 'auto' resolves to 'custom' at runtime for supported models, so it should be accepted at config validation time. Also improve error message to match. * fix: bypass flash attention availability check for custom models Override _check_and_adjust_attn_implementation on PreTrainedModelPrimeRL to skip transformers' flash attention package/device validation. This restores the behavior of the old _register_fa4_attention_interface() noop that was removed when fa4 was renamed to flash_attention_4. Without this override, instantiating a custom model with _from_config fails on machines where flash_attn_3 or flash_attn_cute is not installed, because transformers recognizes flash_attention_3/4 as flash attention and tries to validate availability before our own ATTN_IMPL2CLASS dispatch runs. Custom models use their own attention dispatch (ATTN_IMPL2CLASS) and never call transformers' ALL_ATTENTION_FUNCTIONS, so the availability check is unnecessary. qwen3_5 and qwen3_5_moe already override this method with their own validation; those overrides take precedence via MRO. |
||
|
|
e0d60e4d85 |
refactor(sft): unify the loss path with the RL trainer (#3044)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* refactor(sft): unify the loss path with the RL trainer Remove loss_impl (torch / liger / liger_fused / quack_fused) and route SFT through the same chunked LM head the RL trainer uses: - fused_lm_head_token_chunk_size (int, default 1024) selects FusedOutputLinear; per-token cross-entropy is the negative target logprob computed in token chunks — full [N, V] logits are never materialized. "disabled" falls back to the vanilla logits + CrossEntropyLoss path. - The same [model] block now behaves identically across SFT and RL, and SFT drops the ~17 GB logits tax that loss_impl="torch" carried at long context. - Delete the liger/quack fused-CE heads, the fused_cross_entropy plumbing in setup_model/inject_prime_lm_head, the SFT validator that force-disabled chunking, and the liger-kernel dependency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: relock without liger-kernel Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: restore _online_logsumexp_and_weighted_update The fused-CE class removal also swallowed this helper (defined between the deleted classes) which the chunked logprob head uses at runtime. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * style: ruff Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
d7bcd1b1f5 |
Add MXFP8 Support (#2910)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* Add MXFP8 Linear Layer * Add MXFP8 Receipe * Add MXFP8 * Refractor, remove constants, cleanup * Remove import from local path * Reformat * Add MXFP8 expert parallel impl to support TorchAO's MXTensor in backward for all2all in MXFP8 * Build torchao from source for py3.12 MXFP8 CUDA kernel Pin torchao to the pytorch/ao git source (rev 02105d4) and build its CUDA kernels from source against the local torch cu128 / cpython-3.12. The PyPI wheel ships the MXFP8 kernel as a cpython-310-only .so that fails to load on prime-rl's Python 3.12, so torchao::mxfp8_quantize was never registered with a CUDA backend and MXFP8 died in backward. Building from source produces a cpython-312 extension (_C_mxfp8.cpython-312-*.so). - no-build-isolation-package += torchao (build against local torch) - extra-build-variables: CUDA_HOME=/usr/local/cuda-12.8, TORCH_CUDA_ARCH_LIST=10.0a (B200/sm_100a), USE_CPP=1 Enables the MXFP8 all-to-all and dense-linear paths (verified on 8xB200). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Relax torchao MXFP8 grouped-GEMM torch-nightly gate torchao's _get_tensor_cls_for_config (added in pytorch/ao#4141, "require torch nightly and cuda 12.8+", Mar 2026) asserts two post-2.11.0 DTensor symbols (_ops.scaled_mm_single_dim_strategy, _dispatch.is_pinned_handler) exist, else raises "install the latest torch nightly". This blanket-blocks all MXFP8 training, but is over-broad for us: prime-rl's EP path pulls expert weights local (.to_local()) before the grouped GEMM, so the DTensor scaled-mm strategy is never hit, and current torch's non-single-dim scaled_mm_strategy covers the rest. Neutralize just that assert (MXFP8 branch only) before quantize_, so enable_grouped_gemm works on our pinned torch 2.11 without a nightly bump. Verified 8xB200 SFT (GLM-0.5B, ep=8, grouped_gemm + a2a): 8/8 steps, all ranks; numerics vs bf16 within mxfp8 range (out ~4.8%, grads ~6-7%) for both mxfp8_rceil and mxfp8_rceil_wgrad_with_hp recipes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Use prebuilt torchao wheel from v0.6.0 release (x86_64) Replace the torchao build-from-source git dependency with the prebuilt cp312 CUDA wheel hosted on the prime-rl v0.6.0 release, matching how deep-ep / deep-gemm / nixl-cu12 are shipped. Avoids requiring the CUDA toolchain at install time on x86_64. - torchao source -> release wheel URL, scoped to platform_machine == 'x86_64' (aarch64 continues to resolve torchao from the default index, untouched) - drop torchao from no-build-isolation-package + the extra-build-variables block - add torchao to the exclude-newer-package trusted-sources list Wheel is H100 (sm90a) + B200 (sm100a), built from pytorch/ao@02105d4, verified in a fresh py3.12 env (mxfp8 op registers, a2a imports). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Sort imports in expert_parallel.py (ruff I001) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Fix comments * Fix alignment of 32 for grouped gemm backward * Apply Samis Suggestions * Add back default ignore patterns * Fix name bug * Reformat with ruff * Config verifier * Fix kernel redirect for > 32 token groups * Ruff reformat * chore: update uv.lock for torchao dependency Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * style: fix import sorting in MXFP8 files Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Move config check to config code * Fix ruff * Move config check to trainer --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
7a7dd80291 |
feat(inference): add online quantization config (#3031)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(inference): add online quantization config * fix(config): report missing torch for mxfp8 |
||
|
|
5af45e4310 |
feat(sft): require renderer-based tokenization (#2988)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(sft): renderer-only SFT tokenization SFT tokenization now goes exclusively through the renderers library: - build_training_sample with a hand-coded renderer replaces the incremental apply_chat_template masking path, which corrupted loss masks under position-dependent chat templates (e.g. Qwen3 stripping past thinking blocks across user turns). DefaultRenderer is rejected in setup_renderer; fake data skips renderer construction entirely. - [renderer] config defaults to auto-resolution from the tokenizer; template controls (e.g. enable_thinking) are set run-wide via the typed renderer config. - Non-assistant roles opt into the loss via the renderer's body-only path (content_sft_roles). - _drop_null_fields strips Arrow phantom nulls before tool-call deserialization so genuine nulls inside argument strings survive. - Null-check rather than key-check for messages vs prompt/completion resolution (Arrow schema union adds messages: null to prompt/ completion rows). - seq_len default 256 (FakeDataConfig keeps 128); loss_impl defaults to liger_fused; CI reverse-text configs pin [renderer] name=qwen3. |
||
|
|
57d2b84330 |
feat(config): allow prime-rl conversions to be stored separately from model (#3023)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(config): allow prime-rl conversions to be stored separately from model Add primerl_conversion_dir config field to decouple converted weight storage from the (potentially immutable) model snapshot directory. When set, HF<->PrimeRL format conversions are written there instead of inside the model directory. Defaults to None (existing behavior). Also fixes load_state_dict to always read from the original source_path instead of the converted snapshot path's parent. Signed-off-by: Sami Jaghouar <sami.jaghouar@gmail.com> * chore: rename primerl_conversion_dir to conversion_dir Address review: shorter field name and clarify the docstring that converted weights land in a prime/hf subdirectory. Keep the /prime subdir layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: Sami Jaghouar <sami.jaghouar@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
2fdffa7d3d |
fix(trainer): broadcast resumed policy weights before training loop (#3004)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* fix(trainer): broadcast resumed policy weights before training loop
On resume, the orchestrator advances to v{checkpoint_step} and pauses
inference to receive those weights over NCCL. Since #2896 moved the
in-loop weight broadcast to the END of a step, the trainer would start
step {checkpoint_step+1} first — which blocks on rollouts the paused
inference engines cannot produce until they get v{checkpoint_step}.
Both sides then wait forever (confirmed on GLM-5.2 resume: orchestrator
"Created NCCL_READY marker" then silent, trainer stuck "Looking for
batches" for the next step).
Restore the pre-#2896 top-of-loop sync with a one-shot broadcast right
after checkpoint load. Runs are only registered during batch collection
(packer.discover_runs), so discover run 0 first (mirroring optim.py's
wait-for-run-0 pattern) to populate used_idxs before broadcasting.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(resume): broadcast startup weights on the first step (fresh or resume)
Address review: instead of a resume-only pre-loop broadcast, always sync
inference to the incoming policy on the first training step.
- trainer: broadcast v{step-1} at the top of the loop's first iteration
(fresh -> v0, resume -> v{checkpoint_step}), replacing the pre-loop block.
- orchestrator: always pause + sync inference at startup (previously
resume-only), so it rendezvouses with the trainer's first-step broadcast
in both cases and startup is symmetric.
- factor the "wait for run 0 to be discovered" loop into
MultiRunManager.wait_for_run(); reuse it in optim.py (dedupes the
copy that lived there) and the first-step broadcast.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(orchestrator): wait for startup broadcast on fresh start
The unconditional startup weight sync fell back to wait_timeout=None when
there was no ckpt block (from-scratch run). With filesystem weight broadcast
(check_exists=True), get_weight_dir then raised FileNotFoundError immediately
instead of waiting for the trainer to write broadcasts/step_0/STABLE.
Fall back to a default timeout so the orchestrator waits for the trainer's
startup broadcast, which is always coming.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(config): reject NCCL weight broadcast with LoRA
LoRA adapters are transferred via the filesystem (loaded from disk by the
inference servers); NCCL broadcast only writes a STABLE marker. The now
unconditional startup weight sync makes a fresh LoRA + NCCL run try to load an
adapter from a disk path NCCL never populates, hanging/failing during setup
(and LoRA over NCCL is broken for training-time updates too).
The auto weight-broadcast setup already falls back to filesystem for LoRA when
unset; enforce the same invariant for an explicitly configured NCCL broadcast
instead of failing at runtime.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|
|
df5f991bf4 |
fix: preserve explicit None config overrides across config write/re-parse (#2981)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
Launcher-written TOMLs (slurm rl.toml/subconfigs, sft, inference, and the orchestrator's control/orch.toml) were dumped with exclude_none=True, so a field explicitly overridden to None (e.g. --trainer.model.compile None) was dropped and silently reverted to its non-None default when the file was re-parsed by the sbatch job. Add to_toml_dict(), which drops unset None fields as before but encodes explicitly-set ones as the string "None" — the config system's TOML null convention, converted back by BaseConfig on load. Serializing all Nones would instead trip RLConfig's shared-vs-subconfig conflict validator (shared defaults like log.level=None disagree with sub-config defaults), hence the model_fields_set distinction. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
9e0d242cd0 |
chore: bump research-environments and verifiers to 0.2.0 (#2995)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
77766bb59c |
feat: make NCCL the default weight broadcast transport (#2982)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
Change the default weight_broadcast type from 'filesystem' to 'nccl' in RLConfig. When no weight_broadcast is explicitly configured: - Default to NCCL broadcast (in-memory GPU-to-GPU transfer) - Fall back to filesystem when LoRA is enabled (not yet supported with NCCL) - Fall back to filesystem when no inference server is configured Sub-config defaults (TrainerConfig, OrchestratorConfig, InferenceConfig) remain filesystem since they are always overridden by RLConfig propagation in the rl entrypoint, and standalone usage shouldn't default to NCCL. Pin explicit filesystem broadcast in the multi-run integration test configs that use standalone entrypoints with LoRA. Update docs to reflect the new default. |
||
|
|
db04385acf |
fix(examples): update disaggregated configs to use prefill/decode_nodes_per_replica (#2980)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* fix(examples): update disaggregated configs to use prefill/decode_nodes_per_replica The derive inference node counts PR (#2959) renamed num_prefill_nodes → prefill_nodes_per_replica and num_decode_nodes → decode_nodes_per_replica in the config schema, and made deployment.num_infer_nodes auto-derive from inference.deployment.num_nodes. The configs/ and docs/ were updated but examples/ was missed. - glm5_llmd/rl.toml: num_prefill_nodes=8 → prefill_nodes_per_replica=2 (8 ÷ 4 replicas), num_decode_nodes=8 → decode_nodes_per_replica=8, remove num_infer_nodes (auto-derives to 16) - glm5_pd_disag/rl.toml: num_prefill_nodes=4 → prefill_nodes_per_replica=4, num_decode_nodes=4 → decode_nodes_per_replica=4, remove num_infer_nodes (auto-derives to 8) * refactor: remove backward-compat shim for old disaggregated node field names The normalize_node_counts before-validator silently accepted the old num_prefill_nodes / num_decode_nodes field names and converted them to prefill_nodes_per_replica / decode_nodes_per_replica. This made it impossible for CI to detect stale configs still using the old names — parsing succeeded silently instead of failing with a validation error. Now that all in-repo configs and examples have been updated to use the new field names, remove the shim so old names are rejected as extra_forbidden by pydantic, turning future regressions into CI failures. |
||
|
|
e96bbae2dd |
feat: derive inference node counts (#2959)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
5448f5a722 |
feat: opt-in fp32 MoE routing (trainer gates + inference router logits) (#2952)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(trainer): fp32 MoE router gates via model.moe_router_dtype Add model.moe_router_dtype = "float32" to run MoE router gates in fp32, matching checkpoints trained with fp32 routing (e.g. GLM-5.x via Megatron's --moe-router-dtype fp32): - router gate weights are cast to fp32 and exempted from the FSDP bf16 parameter cast via a nested fully_shard unit with an fp32 mp policy (gradients also reduce in fp32) - TokenChoiceTopKRouter upcasts the gate GEMM input to fp32, so routing logits are fp32 end-to-end in forward and backward (NemotronHRouter already computes in fp32; it only needed the weight exemption) - router FSDP units join the manual EP prefetch schedule Default "bfloat16" preserves current behavior exactly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(inference): fp32 MoE router logits for DeepSeek-family models Add inference.enable_fp32_router_logits (default off): sets out_dtype=float32 on vLLM's DeepseekV2MoE gate via a monkey patch, so the bf16xbf16 gate GEMM writes its fp32 accumulator out unrounded instead of truncating router logits to bf16 before expert scoring (GateLinear's cuBLAS tier on SM90+). Covers GLM-5.x (glm_moe_dsa), which was trained with fp32 routing; pairs with trainer.model.moe_router_dtype="float32". Unlike upstream's full fp32 gate (vllm-project/vllm#47410, not in the pinned release), the gate weight stays bf16, so the LoRA Triton kernel dtype assert and the bf16 weight-broadcast path are unaffected. Follows the fp32_lm_head pattern: flag flows through additional_config and the patch self-gates at model construction. No-op when something else (e.g. the ROCm AITER branch) already set an out_dtype. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat: default fp32 MoE routing on (trainer + inference) Flip model.moe_router_dtype to "float32" and inference.enable_fp32_router_logits to true by default. Routing logits are no longer rounded to bf16 anywhere: custom-impl MoE trainers run fp32 gate weights/GEMM, and DeepSeek-family vLLM models emit fp32 router logits. apply_fp32_moe_router is now a silent no-op for non-MoE and HF-impl models (previously raised), since the default makes absent custom MoE routers the common case. Set moe_router_dtype = "bfloat16" / enable_fp32_router_logits = false to restore the previous numerics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: fares <fares@primeintellect.ai> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
dbe95b799a |
feat: optional per-node uv sync for multi-node RL (#2926)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: optional per-node uv sync for multi-node RL Add a SlurmConfig.per_node_venv_sync flag (default False). When enabled, the multi-node RL sbatch runs uv sync on every node via srun (one task per node, blocking) instead of only the batch node. This is needed when the venv is node-local (e.g. UV_PROJECT_ENVIRONMENT on /tmp): a single batch-node sync would leave the other nodes without a venv. The srun task re-sources .env so uv sees the node-local UV_PROJECT_ENVIRONMENT / UV_CACHE_DIR even if SLURM env propagation is disabled. With set -e, a failed sync on any node aborts the job. Default keeps the original head-only behavior for shared (NFS) venvs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: rename per_node_venv_sync to shared_fs, fix .env sourcing, extend to all multi-node templates - Rename SlurmConfig.per_node_venv_sync (default False) to SlurmConfig.shared_fs (default True) with inverted logic, as suggested in PR review - Fix .env sourcing in srun command to not fail when .env is absent (|| true guard), matching the rest of the script - Fix comment: re-sourcing .env is needed because unexported vars don't cross srun even with normal SLURM env propagation, not because propagation is disabled - Extend shared_fs to multi_node_sft.sbatch.j2 and inference.sbatch.j2 since the flag lives in shared.py config --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
b2b4f3f711 |
feat: bump vLLM 0.23.0 -> 0.24.0 (#2921)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: bump vLLM 0.23.0 -> 0.24.0 Base runtime bump. Changes: - pyproject.toml: `vllm>=0.24.0` + the x86_64/aarch64 wheel URLs to v0.24.0 (cu129 cp38-abi3); uv.lock regenerated (vllm 0.24.0 pulls humming-kernels 0.1.6, prometheus-fastapi-instrumentator 8.0.2, starlette 1.3.1; drops gguf). - weight_transfer.py: 0.24 turned `FusedMoE` into a factory returning a `MoERunner` and split its state -- the expert map now lives on `MoERunner.routed_experts` (RoutedExperts) and EPLB state on `MoERunner.router`. `isinstance(module, FusedMoE)` would raise TypeError. Rewrote `build_expert_map`/`_build_expert_source_indices` to match `MoERunner` and read both submodules. Keying by the MoERunner name still prefix-matches the nested `routed_experts.*` params in load_weights_kernel. (Only reached on the quantize_in_weight_transfer=True path.) - patches.py: verified all 7 monkeypatches still apply on 0.24; only a docstring version ref updated (is_3d_moe_weight still defaults True in 0.24). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(inference): rebase monkey_patch_no_moe_lora onto vLLM 0.24 __post_init__ 0.24 made FusedMoEConfig.intermediate_size the ctor field and intermediate_size_per_partition a -1 sentinel that __post_init__ must compute. The patch replaced __post_init__ with a verbatim-0.23 copy that never set it, leaving intermediate_size_per_partition=-1 (silent corruption of every downstream consumer) and dropping the % tp_size assert + aiter/mori/platform guards. Mirror 0.24's body verbatim, then flip is_lora_enabled off. Found in a second-pass audit of all 16 active monkeypatches (registered across patches.py, orchestrator.py, server.py, worker/__init__.py); the rest KEEP. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(inference): drop 2 LoRA reload monkeypatches for vLLM 0.24 native load_inplace 0.24's native OpenAIServingModels.load_lora_adapter reuses the existing lora_int_id on a same-name reload and repoints the path, and its worker LRUCacheWorkerLoRAManager.add_adapter force-reloads when lora_request.load_inplace is True -- exactly what monkey_patch_load_lora_adapter and monkey_patch_LRUCacheWorkerLoRAManager reimplemented by copying upstream bodies. Replace both with the native path plus a small mechanism in prime-rl's /load_lora_adapter endpoint: - set load_inplace=True on the incoming request so 0.24 doesn't reject the same-name reload and the worker re-reads the new weights during add_lora; - reset the *stored* LoRARequest's load_inplace back to False afterward, because it is a sticky field that _maybe_get_adapters hands to every generation request -- left True it would force a per-scheduler-step disk reload (the perf trap the old _apply_adapters(force_load=False) override avoided). The orchestrator awaits this endpoint before dispatching rollouts for the new policy version, so the reset lands before any generation resolves the adapter. Also refresh stale "vLLM 0.23.0" version refs in comments to 0.24.0 where the described behavior was re-verified against the 0.24 source (minimax gate dtype, V2-runner routing rationale, NemotronH layerwise-reload shim -- the latter's counting path is byte-identical in 0.24, so the shim stays needed). Requires a live LoRA weight-sync run to validate before merge: confirm the adapter picks up fresh weights each step AND that there is no per-step reload regression. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * style: ruff format (unwrap lines within 120-col limit) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(inference): simplify monkey_patch_no_moe_lora to wrap upstream __post_init__ The previous version copied vLLM 0.24's FusedMoEConfig.__post_init__ body verbatim (intermediate_size_per_partition compute, ROCm/aiter/mori guards, platform checks) just to append `is_lora_enabled = False` -- carrying a drift-prone "keep in sync with upstream" burden plus _aiter_ops/current_platform imports. `is_lora_enabled` is never read inside __post_init__ (only later during kernel selection in modular_kernel.py / oracle/unquantized.py), so flipping it after the original runs is equivalent. Wrap the original instead: it computes intermediate_size_per_partition and runs every guard itself, so nothing can drift and the -1 sentinel can never leak. Verified against the 0.24 wheel: with tp_size=2, intermediate_size_per_partition = 128 and is_lora_enabled = False. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(inference): reset load_inplace unconditionally in /load_lora_adapter Previously the sticky-flag reset ran only on success, so an ErrorResponse returned before resetting. Not triggerable on vLLM 0.24 (native load_lora_adapter stores the adapter only after add_lora succeeds, and builds a fresh request rather than mutating the stored one), but the correctness relied on that vLLM-internal invariant. Reset whatever is stored for the name regardless of outcome so a lingering load_inplace=True can never force a per-scheduler-step disk reload, independent of vLLM internals. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(inference): remap flat MoE kernel wire names to vLLM 0.24 routed_experts params vLLM 0.24 nests FusedMoE expert weights under MoERunner.routed_experts (...experts.routed_experts.w13_weight), while the trainer's convert_layer_to_vllm_kernel still emits the pre-0.24 flat names (...experts.w13_weight). load_weights_kernel's 'name not in params' gate fired before the expert-map prefix match, so the first fp8 kernel weight update raised 'Kernel weight transfer skipped N weights not found in model'. Wrap the incoming stream with upstream's remap_moe_expert_weights, the compat shim vLLM ships for exactly this transition (covers w13/w2 weights and their _scale_inv variants; leaves gate/shared_experts names untouched). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(inference): drop NemotronH mixer.D reload shim, fixed upstream in 0.24 vllm-project/vllm#44814 did land in the pinned 0.24.0 release - in reload/meta.py, which caps copied_numel at param.numel() to fix the composed_weight_loader double-count that finalized layers early and dropped Mamba mixer.D. The earlier audit diffed mamba_mixer2.py and reload/layerwise.py (byte-identical) and missed it. The capture/restore shim is now dead weight on every non-quantized weight update; remove it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(inference): LoRA/MoE patch hygiene for vLLM 0.24 - Drop monkey_patch_skip_lora_module_warnings: the per-module regex warning loop it skipped was removed upstream before 0.23, so it was a pure drift-carrier - its _load_adapter copy silently dropped 0.24's moe_ep_spec= passthrough (EP read-time expert filtering) and the lora.is_3d_lora_weight stamp (needed for enable_mixed_moe_lora_format). Stock _load_adapter now runs in workers. - Re-derive _patch_lora_key_prefix's from_local_checkpoint copy from the 0.24 original so the stock caller's moe_ep_spec= kwarg is accepted; keeps only the real payload (accept bare-suffix OR qualified expert module names) and picks up the EP remote-expert pruning + tensorizer hardening. Docstring rewritten: vllm#38522 was closed unmerged and the base_model.model. prefix case is handled upstream. - Drop the MiniMax M2 forward patch: the MoERunner already all-reduces internally (_maybe_reduce_final_output), so the patched forward's extra tensor_model_parallel_all_reduce doubled the MoE output at TP>1. Upstream's forward needs no changes; the gate rebuild + hf_to_vllm mapper stay. - Remove the dead transformers-v5 tie_word_embeddings shim (class attr exists on the pinned transformers, guard never fired) and refresh stale comments: DP coordinator upstream timeout is 120s not 30s; 0.24 routes MoE archs (DeepseekV2/Qwen2Moe/GraniteMoe) to the V2 runner by default too, making the forced V1 more load-bearing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(inference): rename transformers_v5_compat to apply_shared_vllm_patches The function is the vllm.general_plugins entry point dispatching the six patches that must run in every vLLM process; the transformers-v5 shim it was named for was removed. Entry-point target updated in pyproject.toml (vLLM swallows plugin load failures, so a stale target would silently skip all patches - uv run re-syncs metadata automatically). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(inference): restore 0.23 parser semantics + guard new 0.24 request validation vLLM 0.24 behavior changes outside this branch's original diff surface: - qwen3_coder (parser engine) now full-strips every tool parameter value where 0.23 trimmed exactly one leading/trailing newline, corrupting whitespace-significant args (str_replace old_str/new_str, indented file content). Restore single-newline trim via monkey_patch_qwen3_coder_param_newline_trim (also covers nemotron_v3, which reuses qwen3_config). - minimax_m2's engine swallows the literal </think> in CONTENT state and strips content on tool turns, breaking minimax_m2_append_think round-tripping. Drop the (CONTENT, THINK_END) transition and disable the strip. - VLLM_ENFORCE_STRICT_TOOL_CALLING default flipped to True in 0.24: structural-tag constrained decoding for required/named/strict tools would sample a distribution the trainer never sees. Default it off in setup_vllm_env. - 0.24 rejects temperature > 2.0 at request validation; mirror the bound in TrainSamplingConfig/EvalSamplingConfig so misconfigured sweeps fail at config load, not per-rollout with HTTP 400s. - Fix stale 30s -> 120s DP-coordinator timeout comment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(inference): cover plugin entry-point load, MoE kernel remap, MoE mismatch KL CI could not see three load-bearing paths of the 0.24 bump: - vLLM swallows vllm.general_plugins load failures, so a stale/misnamed entry point (renamed on this branch) silently drops every shared patch; load it exactly like vLLM does and assert the padded-input scrub applied. - The MoERunner weight-sync rewrite (flat trainer names -> nested routed_experts params via remap_moe_expert_weights, expert-map prefix slicing) is only reachable via NCCL broadcast, which no CI config uses; exercise load_weights_kernel directly on a fake module tree. - reverse_text_moe asserted exit code only; add a trainer/inference mismatch-KL bound so silent MoE weight corruption fails the job. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: address review — drop test additions and comment flourishes Per review: remove the plugin entry-point test, the weight-transfer kernel unit tests, and the reverse_text_moe mismatch-KL addition; trim the vLLM-0.24 references from the temperature docstrings (the le=2.0 bound stays). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: faresobeid <111092724+faresobeid@users.noreply.github.com> Co-authored-by: hallerite <git@hallerite.com> Co-authored-by: fares <fares@primeintellect.ai> |
||
|
|
4beb553525 |
feat: default per-env ratio to 1, drop natural-distribution mode (#2935)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
Env sampling weight (`ratio`) now defaults to 1 (equal weight per env) and no longer accepts unset/None. The None-for-all-envs mode that sampled proportional to each env's dataset size is removed, along with the all-or-none constraint — any subset of envs may set `ratio`, the rest default to 1. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
51dc60a895 |
chore: dead-code sweep across trainer, orchestrator, utils, and configs (#2932)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
cdea189e3d |
chore(configs): remove dead max_retries knob from Env/Train/EvalConfig (#2930)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
d5f218f708 |
chore(configs): remove empty *ExperimentalConfig placeholders (#2931)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
e48a53853e |
fix: weight-sync hardening + dead-code / get_max_layer_num cleanup (#2922)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* fix: correct weight-broadcast validation + prefix-cache docs - validate_shared_weight_broadcast: the chained comparison `trainer.type != orchestrator.type != inference.type` only compared adjacent pairs, so a mismatched inference weight_broadcast type (e.g. trainer/orchestrator=nccl, inference=filesystem) passed validation silently. Check trainer vs orchestrator, then inference vs both. - update_weights / load_lora_adapter docstrings claimed the server resets the prefix cache on weight update; it doesn't — the orchestrator salts the prefix cache per weight version (cache_salt, see orchestrator/envs.py). Fix the docs and drop the dead reset_prefix_cache_after_update state flag (set but never read). - heartbeat: docstring said "2s timeout"; the request uses timeout=1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: remove dead code in trainer/utils Grep-verified as unused across src/: - qwen3_moe: load_balancing_loss_func (aux-loss-free routing is used instead) - rl/loss.py: shift_logits - perf.py: _count_trainable_params - kernels/fp8_utils.py: align() - kernels/fp8_indexer.py: dead `_weight_scale = weight_scale` assignment (kernel intentionally ignores weight_scale, per its NOTE) - layers/moe.py: leftover commented-out forward variant - utils/utils.py: capitalize, to_row_format, mean_normalize - broadcast/nccl.py: import NCCL_READY_MARKER from utils.client instead of redefining the same constant Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor: consolidate get_max_layer_num into trainer/weights Seven converting_*.py modules each defined their own get_max_layer_num — six as a fragile `int(key.split(".")[2])` one-liner and afmoe as a regex variant that returned the max index (its callers compensated with `range(max_layer + 1)`). Replace all seven with the canonical, robust implementation in trainer/weights.py (handles an arbitrary layer_prefix, guards non-digit segments, already used by the NCCL broadcaster). - afmoe: the canonical returns a count (max+1), so its two callers switch from `range(max_layer + 1)` to `range(num_layers)` — behavior-identical. - No import cycle: weights.py imports neither trainer.models nor the converting modules. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor: centralize flash-attn varlen import guard afmoe and qwen3_5_moe each re-declared the identical three-way try/except import guard for flash_attn_varlen_func / _3_ / _4_ that already exists in trainer/models/layers/attn.py. Import the (None-able) module-level names from attn.py instead; each model's `_funcs` dispatch table is unchanged. Note: their attention classes are genuinely model-specific (gated output, local/global split, MRoPE, GatedDeltaNet), so they legitimately do NOT subclass the shared FlashAttention — only the optional-dependency import guard was duplicated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: break circular import from get_max_layer_num consolidation The consolidation made the converting_*.py modules import trainer/weights.py, but weights.py imports trainer/lora.py, which (via trainer/models/__init__) imports the model modules and their converting_*.py — closing a cycle: lora -> models/__init__ -> afmoe/modeling -> converting_afmoe -> weights -> lora (partially initialized) -> ImportError Move get_max_layer_num into a dependency-free leaf module trainer/conversion_utils.py (imports only torch) and point the seven converting modules + the NCCL broadcaster at it. weights.py no longer defines it (it never used it internally). Keeps the single-source dedup without the cycle. Caught by the reverse_text integration tests (trainer crashed at import). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: faresobeid <111092724+faresobeid@users.noreply.github.com> |
||
|
|
f19ba721a9 |
chore(configs): bump dist_timeout_seconds default to 3600 (#2924)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
The 600s default torch/NCCL distributed timeout was too tight for large multi-node runs — startup collectives (step-0 evals, slow first SWE batches) tripped the watchdog and SIGABRT'd the trainer. Bump the default to 3600s for both RL and SFT trainer configs. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
9f425fffcb |
feat(metrics): unify train/eval rollout metrics over the all/effective matrix (#2907)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(metrics): unify train/eval rollout metrics over the all/effective matrix Closes #2903. Replace the two divergent rollout-metric paths — the pandas-heavy MetricsBuilder (train) and the hand-rolled EvalBatchMetrics.to_wandb_dict (eval) — with one shared, pandas-free, unit-tested function `compute_rollout_metrics`, logged over the matrix: {train,eval} / {agg,<env>} / {all,effective} / <metric> / <stat> - `all` = every rollout that came back (errored + filtered included); `effective` = its non-errored, non-filtered subset (~ what actually trained). The gap between them is the filtering/error cost, now directly comparable per metric. - Train retains the full arrival window (TrainSink.arrivals_window → TrainBatch.all_rollouts) so an `all` set exists; eval already kept its full cohort. - All metrics apply to both train and eval except pass@k / pass^k (eval-only; pass^k is new) and the filter-pipeline rates (train-only — eval has no filters). - Drop pandas from this path; aggregation is plain Python (flat means/max/min/rates, group-by only for solve rates). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): rename token metrics to num_*_tokens, drop no_response, top-level is_filtered - seq_len / prompt_len / completion_len -> num_total_tokens / num_input_tokens / num_output_tokens, matching the renamed vf.Trace properties - remove the no_response metric - log is_filtered as a top-level rollout metric (was filters/is_filtered); per-filter detection rates stay under filters/<name> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(metrics): add full timing phases, reward components, is_completed - timing: add setup + finalize spans; timing/total now sums all four phases (setup + generation + finalize + scoring) instead of just generation + scoring - rewards/<name>: per-reward-component breakdown (mirrors metrics/<name>) - is_completed/mean: a finished-on-its-own-terms rate alongside is_truncated Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): rename effective_batch_size -> solved_some Names the mixed-reward-group rate consistently with its solve_none / solve_all siblings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): solve_none/solve_all -> solved_none/solved_all Consistent solved_none / solved_some / solved_all trio. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(metrics): log eval reward as avg@<k> instead of reward/mean Eval reports the mean reward under the conventional avg@<group_size> key (a single value via the new reward_label arg); train keeps the reward mean/max/min distribution. Same value, eval-friendly name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): split into compute_train_metrics / compute_eval_metrics over a shared core Replace the single flag-driven compute_rollout_metrics with two functions sharing _common_metrics: train adds the reward distribution + filter-pipeline rates; eval adds the avg@<k> score + pass@k/pass^k. Drops the include_filters / include_pass_at_k / reward_label flags and the train/eval branching from the call sites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): rename error_rate -> has_error/mean Consistent with the other per-rollout boolean rates (is_truncated/mean, is_completed/mean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): move rollout_metrics.py back into metrics.py Reclaim the conventional module name vacated by the old MetricsBuilder. Rename the source + test (rollout_metrics.py -> metrics.py, test_rollout_metrics.py -> test_metrics.py) and fix the stale compute_rollout_metrics doc references left from the train/eval split. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(metrics): rename progress/{samples,problems} -> progress/{rollouts,tasks} Also the cumulative keys: progress/total_samples -> progress/total_rollouts, progress/total_problems -> progress/total_tasks. Metric-key renames only; the internal Progress counter fields are unchanged (they're pickled in the orchestrator checkpoint). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(types): TrainBatch.rollouts = all rollouts + .effective view (symmetric with EvalBatch) TrainBatch.rollouts now holds the full arrival window (errored + filtered included), matching EvalBatch.rollouts. Both expose an `effective` property — the non-errored, non-filtered subset as a view (references, not copies), so each expensive trace is retained once. Drops the separate TrainBatch.all_rollouts field. Consumers repointed: metrics over rollouts (all) + effective; sample/distribution logging and the success-line quality metrics over effective; disk/progress/efficiency over rollouts (all). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): inline the dist spec list; make helpers public (dist_stats, rate, common_metrics) Drop the _DIST_SPECS (name, getter) table — the five distributional metrics are emitted inline in common_metrics. Rename the module helpers to clearer public names: _dist -> dist_stats, _rate -> rate, _common_metrics -> common_metrics. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): drop redundant TrainBatchMetrics fields derivable from batch.rollouts With TrainBatch.rollouts holding the full arrival window, several aggregates are redundant: - arrivals_by_env / errors_by_env — per-env arrival/error counts = grouping batch.rollouts (and errored ones) by env; derive them in log_train_batch instead. - samples_shipped — equalled len(batch.samples) and had no consumers. The sink no longer tracks the per-env counters. Kept n_trainable (shipped non-filtered count, feeds the empty-batch guard) and num_prefill/decode_tokens (cohort totals including filtered rollouts, so not a sum over samples). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): rollout-container API (TrainRollouts/EvalRollouts with .metrics, .effective) Replace the functional compute_train/eval_metrics with list-like rollout containers: - TrainRollouts / EvalRollouts own the rollouts (append/__len__/__iter__), expose .effective (clean subset, same container type — a view), .by_env (train), and .metrics. - TrainMetrics / EvalMetrics (over RolloutMetrics) expose each distributional/rate metric as a Stat (rollouts.metrics.num_input_tokens.mean()) and build the full {prefix}/{subset}/... dict via .to_wandb(); special metrics (solve rates, stop_condition, pass@k, custom/<name>) are methods. - TrainBatch.rollouts / EvalBatch.rollouts are now these containers; TrainBatchMetrics is dropped (n_trainable + prefill/decode token totals are fields on TrainBatch). solve_rates uses each group's actual size as the full-solve threshold (config-free metrics). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): derive trainable count + token totals, slim TrainBatch to {rollouts, samples} - Add Rollout.is_trainable (a nonzero advantage on some token ⇒ carries gradient) and a train-only is_trainable/mean metric; the trainable count is now derived from the rollouts, not carried as TrainBatch.n_trainable. - Drop TrainBatch.{n_trainable, num_prefill_tokens, num_decode_tokens}: prefill/decode totals derive from batch.samples (the shipped payload — excludes filtered rollouts, so the usage reporter no longer over-counts), and the empty-batch guard keys on `not batch.samples` (the precise "nothing shipped to the trainer" stall signal) instead of a zero count. - Rename TrainSink.arrivals_window → pending_rollouts (matches pending_batch / pending_groups). - Compute num_tokens / rollout / unique-example counts once in finalize_train_batch (were computed twice). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): nest timing as a sub-metric (metrics.timing.setup.mean()) Collapse the five flat timing_* Stat properties into a TimingMetrics sub-object reached via metrics.timing, so per-phase durations read as metrics.timing.setup.mean() / .total.mean(). wandb keys (timing/<phase>/<stat>, timing/total/<stat>) are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(metrics): solved_all counts only reward==1.0 groups Restore the binary "fully solved" semantics: a group is solved_all when every rollout scored exactly 1.0 (was: every rollout had a nonzero reward, which over-reported solved_all for continuous / partial-credit rewards). Config-free (no env group_size lookup); unspecified for non-binary reward ranges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): derive prefill/decode tokens from effective rollouts, not samples progress/prefill_tokens, progress/decode_tokens, and the training usage report now sum the effective rollouts' Trace.num_input_tokens / num_output_tokens (the shipped subset — its branches are exactly what `samples` concatenates) instead of summing masks over batch.samples. No metric is computed over `samples` anymore. progress/tokens stays over the full window. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(orchestrator): build the eval success line from the metrics API Replace the hand-rolled reward/turns/truncation/error/branches sums in finalize_eval_batch with effective.metrics / rollouts.metrics Stat accessors. Stat.mean() returns 0.0 for an empty set, so this also drops the per-field empty guards (and fixes a latent ZeroDivisionError on the branches mean for an empty cohort). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor: move compute_pass_metrics into orchestrator/utils.py, drop eval_utils.py compute_pass_metrics was the only thing in eval_utils.py; fold it into the existing orchestrator/utils.py and delete the one-function module. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(orchestrator): name token totals input/output (vf v1 convention) Rename the per-step token breakdown from prefill/decode to input/output to match the vf v1 Trace token naming used across the metric matrix: progress/input_tokens, progress/output_tokens, and the usage report sum r.num_input_tokens / r.num_output_tokens over the effective subset (the same props the matrix reports), rather than deriving a prefill/decode split. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): add p10/p90 stats, derive eval group size, inline timing phases - Stat gains p10/p90 (linear-interpolated percentiles); to_dict now emits mean/max/min/p10/p90. - EvalMetrics derives the avg@<k> group size from the rollouts (largest group) instead of carrying a passed int, so EvalRollouts no longer needs a group_size argument — everything is derived from the rollout list. - Drop the TimingMetrics._phase helper; inline the per-phase Stat into each phase property. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): generic StatGroup for timing/metrics/rewards; drop quoted forward refs - Extract a StatGroup base (named Stats → {prefix}/<name>/<stat> via to_dict, group[name] access); TimingMetrics (fixed phases) and a new CustomMetrics (dynamic per-rollout dict keys) both subclass it. metrics.metrics / metrics.rewards are now nested StatGroups (like metrics.timing), replacing the shared custom(attr) helper. - Drop the string-quoted forward refs (list["Rollout"], Iterator["Rollout"], "TrainRollouts", …) — the module already has `from __future__ import annotations`, so the annotations resolve unquoted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(orchestrator): build the train success line from the rollout container Drop the hand-rolled arrivals_by_env / errors_by_env dicts and per-env quality sums in log_train_batch; derive everything from batch.rollouts (.metrics for the aggregate error rate, .effective.metrics for quality, .by_env() for the per-env lines). Same output, no manual aggregation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(metrics): trim tests; drop dead EvalRollouts.append + batch_share manual dict - Tests: fold the fluent-access test into the to_wandb test, merge the two boolean-rate tests and the two train-only-metric tests, add a train_wandb() helper, drop the unused has_response field from the rollout fake. Same coverage, 222→184 lines. - Remove EvalRollouts.append (eval wraps a finished list, never appends — unlike TrainRollouts). - finalize_train_batch: build the per-env batch/<env> shares from rollouts.by_env() instead of a hand-rolled env-count dict (same as the log_train_batch cleanup). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(metrics): error-type breakdown by count; fix eval avg@k key split; small cleanups - Add an error/<type> breakdown (counts of errored rollouts by Trace error type, e.g. Cancelled / ProviderError), emitted on the `all` subset alongside has_error/mean (mirrors stop_condition's per-key breakdown, but by count to match the old cancelled_count/errored_count). - Fix eval avg@<k>: derive the group size once from the full epoch in EvalRollouts and carry it onto .effective, so `all` and `effective` share one stable avg@<k> key (was derived per-subset, so an eval error could split it into avg@4 vs avg@3). - Drop the dead is_filtered clause from EvalRollouts.effective (eval never filters); bind effective once in log_train_batch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(train_sink): preserve the rollout window across empty (no-ship) batches process_batch reset pending_rollouts unconditionally, but the orchestrator drops an empty batch (no samples) without logging it — so that window's metrics/record were lost and any overflow left in pending_batch shipped a later step unattributed. Reset the window only when the batch ships, so a no-ship batch's arrivals (and overflow) carry into the next shipped batch's window. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
16efd8afda |
feat(algo): linear length penalty (completion + context + turns) for GRPO (#2901)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat(algo): linear length penalty (completion + context + turns) for GRPO Port the length-penalty-context-turns branch onto current main's algorithm abstraction as a new `linear` LengthPenaltyConfig variant. It subtracts a single pass_rate-scaled penalty from each reward before the GRPO baseline: coef * completion tokens + context_coef * non-completion (context) tokens over the group's longest sequence, plus turns_coef * turns over the group's most turns — each normalized by the group's own max, optionally gated to correct rollouts. context_coef and turns_coef default to 0.1 (completion coef 0.25). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(algo): make linear the only length penalty (remove tokens/turns) Per review, the linear penalty replaces the existing efficiency-shaping length penalties rather than coexisting with them: - Remove TokensLengthPenaltyConfig / TurnsLengthPenaltyConfig; LengthPenaltyConfig is now just LinearLengthPenaltyConfig. - Simplify GRPOAlgorithm.score_group to None vs linear. - Remove the now-orphaned efficiency_shaping (delete algo/advantage.py) and its references in algo/__init__ and docs. - Rewrite test_advantage.py: drop the efficiency_shaping / tokens / turns cases, add linear-penalty tests (completion / context / turns terms, gating, and the equal-length reduce-to-plain-GRPO invariant). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(algo): drop gate_by_correctness; compute turns term unconditionally - Remove the gate_by_correctness option from the linear length penalty. - Always add the turns term (it contributes 0 when turns_coef=0); drops the asymmetric guard so all three terms are handled uniformly. - Remove the gating unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(algo): rename linear length-penalty fields + per-term-max normalization - Rename GRPOAlgoConfig.length_penalty -> length_pen; lp -> length_pen in grpo. - Rename coef/context_coef/turns_coef -> completion_pen/input_pen/turns_pen. - Normalize each term by its own group max: completion / max completion, input (= total - completion) / max input, turns / max turns (previously the completion and input terms shared the max-total denominator). - Drop the explanatory comments in score_group; fix stale field/doc text. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(algo): rename input_tokens -> input for naming consistency Matches the other bare locals (completion, total, turns). * docs(changelog): note length_pen rename + tokens/turns removal * chore: adopt consolidated num_ trace token properties + rename length penalty config (#2905) * fix(template): orchestrator URLs use canonical model.client path (#2899) The multinode RL sbatch template launched the orchestrator with --student.client.{base-url,admin-base-url}, but OrchestratorConfig has no `student` field — the canonical path is `model.client` (base_url / admin_base_url on ClientConfig). The orchestrator-config rename left the template stale, so every multi-node RL launch fails config parsing with "Unrecognized arguments: <inference URLs>". Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: correct env log glob to logs/envs/<split>/<env>.log (#2898) * fix: correct env log glob to logs/envs/<split>/<env>.log Since the nano-as-v1 migration each env writes a single logs/envs/{train,eval}/<env>.log file (two levels), but the launch banner still printed three-level globs (logs/envs/*/*/*.log), which match nothing. Fix the banner generator and the captured example outputs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: drop captured launch-banner output from example READMEs The "Output of the command" blocks duplicated the live launch banner (now fixed in pathing.py) and drift out of sync. Remove them; the run command stays. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: configurable env vars (#2863) * 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> * Update configs for renderer thinking retention (#2900) * chore: migrate to consolidated Trace/Branch num_ token properties Bump deps/verifiers to the property consolidation (verifiers #1894) and rename every prime-rl access of the renamed Trace/Branch properties: completion_len / output_len -> num_output_tokens prompt_len -> num_input_tokens rollout total_tokens -> num_total_tokens progress.total_tokens, Usage.total_tokens and RunStats.total_tokens are unrelated and left unchanged; num_turns is unchanged upstream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: rename length penalty config to num_*_tokens_weight + num_turns_weight Align the linear length-penalty config (from #2901) with the consolidated num_-prefixed trace property names: [orchestrator.algo.length_pen] -> [orchestrator.algo.length_penalty] completion_pen -> num_output_tokens_weight input_pen -> num_input_tokens_weight turns_pen -> num_turns_weight Updates grpo.score_group, the config class, docs, CHANGELOG, and tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: bump verifiers + research-environments to main (#2904) * chore: bump verifiers + research-environments to main - verifiers: aa95826d → 97be43bf - research-environments: 99ebd2e13 → bae0ffe5a - lock new v1 envs: lean-v1 (6 per-dataset Lean tasksets), prolog-v1 - bump verifiers floor 0.1.15.dev400 → dev404 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: lock remaining research-environments v1 envs Lock the 21 previously-unlocked RE v1 env packages into the `envs` extra + tool.uv.sources, and alphabetize both the `envs` list and the env source entries. tau3-bench-v1 is intentionally excluded: it requires tau2 @ git 58e5e1a, which conflicts with the tau2 @ 337326e pinned by the already-locked tau2-bench-v1 (uv cannot resolve two URLs for one package). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: drop rlm-swe to remove the verifiers override rlm-swe pins verifiers>=0.1.15.dev17,<0.1.15.dev156 — a stale upper bound that conflicts with the editable verifiers submodule (dev404) and with the other envs / prime-rl-configs. It was the sole reason verifiers needed a global override-dependencies entry (without it, resolution is unsatisfiable). Dropping rlm-swe lets us remove that override: verifiers now resolves to the editable submodule through tool.uv.sources alone. Also prunes rlm-swe's heavy transitive deps (modal, swebench, swe-rex, pygithub, …) from the lock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: migrate rlm_swe config dependents to r2e-gym-v1 Dropping the rlm-swe env orphaned its in-repo config dependents: - examples/glm5_llmd/rl.toml: migrate the v0 `rlm_swe` env block to the v1 `r2e-gym-v1` taskset on the rlm harness (prime runtime), mirroring configs/debug/v1/r2e_gym.toml - configs/rlm_swe/qwen35_4b.toml: remove (superseded by configs/debug/v1/r2e_gym.toml) - skills/training/start-run: point the find_spec example at r2e_gym_v1 - configs/debug/v1/r2e_gym.toml: drop the stale reference to the removed v0 config Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: re-pin deps/verifiers to merged verifiers main (#1894) The Trace/Branch num_ consolidation landed on verifiers main; point the submodule at the merge commit instead of the temporary cherry-pick pin. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: require verifiers >=0.1.15.dev405 (Trace/Branch num_ consolidation) The submodule is pinned at the consolidation commit (0.1.15.dev405); raise the floor so the renamed Trace/Branch token properties are guaranteed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> Co-authored-by: eligotts <78387377+eligotts@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> Co-authored-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> Co-authored-by: eligotts <78387377+eligotts@users.noreply.github.com> |
||
|
|
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> |
||
|
|
d507aeafc0 |
chore(configs): remove dead BaseModelConfig.is_vlm property (#2876)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
d3765e289d |
chore(deps): bump verifiers to 0.1.15.dev388 (#2870)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
7089ba1e4d |
feat: vf v1 <> nano bridge (#2742)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* feat: add vf-nano as submodule
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/vf-nano to feat/env-server (EnvServer)
Points the submodule at the vf-nano EnvServer branch so the orchestrator can
build on the env-server abstraction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: run orchestrator on a vf-nano env server (reverse-text)
Switch prime-rl's env path to vf-nano: the orchestrator spawns a vf-nano
EnvServer per env (it never loads an environment), dispatches rollouts by task
index, and trains on the returned Trace dicts (branches + renderer tokens).
- pyproject: dep verifiers -> vf-nano; drop v1/research env packages; only the
vf-nano reverse-text example; override out the transitive v1 verifiers (pulled
by the prime CLI) so it can't shadow vf-nano's `verifiers` package; add orjson
/pandas/msgspec (were transitive via verifiers).
- EnvConfig inherits vf-nano's swappable agent/runtime (+ max_turns).
- envs.py: spawn EnvServer child + EnvClient, info() for num_tasks/group-scoring,
dispatch by task_idx, adapt Trace -> RolloutOutput-shaped dict.
- trajectories.py: trace_to_samples (one sample per Trace branch) + trace_to_output.
- train_source: index sampling; client pool builds vf-nano ClientConfig; lag
monitor vendored; env-server entrypoint repointed; ~14 files retyped off
vf.RolloutOutput / vf.ClientConfig.
- configs/debug/vf_nano_reverse_text.toml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: consume vf-nano Trace natively (branches→samples, shared renderer config)
- trace_to_samples stitches each Trace branch's tokens into one TrainingSample
(prompt = branch start, then each turn's new context [masked] + generated
tokens [trained]); drop the RolloutOutput adapter — read the Trace's native
fields directly (reward, error{type,message}, timing generation/scoring,
num_turns, branches).
- envs returns the raw Trace; eval_sink / train_sink / dispatcher / metrics /
orchestrator read native Trace fields (no token_usage/completion/timing.total).
- client pool forwards the shared renderers.RendererConfig to the env server's
renderer client (so it uses qwen3, not the tool-less default fallback).
- debug config: tool_call_parser=hermes (vLLM accepts the agent's tools),
max_steps=20.
- bump deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: pass typed ClientConfig/SamplingConfig to the env client (no timeout)
- Env.run_rollout/run_group pass the vf-nano ClientConfig object and a
SamplingConfig (built from the env's sampling args) directly — no model_dump,
no per-rollout timeout forwarded to the server.
- debug config: max_steps=20.
- bump deps/vf-nano (typed env-server RPC).
* refactor: orchestrator holds a typed vf.Trace[EnvTask] (no dicts)
The env server returns a Trace minus its derived fields; the orchestrator resolves
the env's Task subclass (from config.id) and validates the wire dict into a strict
Trace[EnvTask], so the whole orchestrator works with a real, typed vf.Trace —
typed task fields included (e.g. task.answer), nothing subscriptable.
- envs.py: resolve_task_type(env_id); run_rollout/run_group validate -> Trace[EnvTask].
- trajectories/types/dispatcher/train_sink/eval_sink/metrics/filters/advantage/utils
/orchestrator: attribute access on the typed Trace (reward, error{type,message},
branches, timing.<span>.duration, num_turns, ...); derived fields recompute on the
consumer.
- Task/Trace/TimeSpan stay strict (StrictBaseModel) — no extra=ignore anywhere.
- bump deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: depend on vf-nano[serve]; bump submodule
The orchestrator spawns the env server, so request the serve extra
(zmq/msgpack) explicitly now that vf-nano keeps them out of core.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (client docstring cleanup)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: drop redundant forward-ref quotes in advantage.py
`from __future__ import annotations` already defers all annotations to strings,
so the quotes + `# noqa: F821` on the TYPE_CHECKING-only `vf.Trace` / `TrainRollout`
annotations are unnecessary (no import cycle — verifiers.nano never imports prime_rl).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: rename FinishedRollout.raw -> trace
The field holds a typed vf.Trace, so `trace` reads truer than `raw` (which
suggested an unparsed dict). Renames the field + every `.raw` access, the
`emit_rollout(trace=...)` param/kwarg, the to_dict field filter, and the
dispatcher cancel-path locals.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: simplify FinishedRollout, read straight off the typed Trace
- Drop the FinishedRollout proxy properties (error/reward/is_truncated and the
example_id field); consumers now read r.trace.{reward,is_truncated,task.idx,...}
directly. The trace is the single source of truth.
- Use vf.Trace.has_error for existence checks instead of `.error is not None`.
- Replace the prime-rl trace_* token-length utils with vf.Trace.{completion_len,
total_tokens,has_response} (now on the trace); keep trace_to_samples.
- Carry task_idx end-to-end (GroupState.task_idx, env.run_rollout/run_group(task_idx),
source dict key) instead of the example/example_id dict carrier; identity comes
off trace.task.idx.
- Mark the local-package env arrangement as a temporary/experimental TODO.
- Move the debug config to configs/debug/nano/reverse_text.toml.
- Bump deps/vf-nano (Trace/Turn accessors).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: spawn env server on an OS-assigned port, drop the startup poll
- The env server binds tcp://127.0.0.1:0 and reports its concrete address back
over a queue; the orchestrator connects to that. Removes _get_free_port and its
TOCTOU race (the OS assigns the port atomically).
- A spawned server has already bound + loaded by the time it reports its address,
so the untimed info() is enough — only poll wait_for_server_startup for an
external (config.address) server, which has no spawn handshake.
- Bump deps/vf-nano (port report + Trace/Branch token-length accessors).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: use vf.task_type instead of a local resolve_task_type
The Task-subclass introspection now lives in vf-nano (vf.task_type); drop the
prime-rl copy and build the typed Trace via vf.Trace[vf.task_type(env_id)]. Bump
deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: restore backfill_rollout_tokens for SFT (typed Trace)
SFT trains on a teacher served over the chat client, which returns no token ids,
so the trace's turns have tokens=None and trace_to_samples yields nothing. Restore
backfill: for each tokenless turn, render its prompt + assistant response with the
student chat template and split on the longest common prefix to fill TurnTokens
(masks/logprobs come from trace_to_samples). train_sink.process_rollout backfills
when any turn lacks tokens, before building samples.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: pass task_idx when building Cancelled traces on off-policy drop
drop_group's error_rollout_output calls omitted the required task_idx, so an
off-policy cancel (on_new_version) raised TypeError. Use the group's task_idx
(or -1 when the group is already gone), mirroring handle_completed_rollout.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: consume typed Trace[WireTask]; inline synthetic error traces
- envs.py: EnvClient now returns Trace[WireTask]; upgrade to this env's real Task
subclass via self.trace_type.model_validate(wire.to_wire()).
- dispatcher.py: drop the error_rollout_output helper — inline the synthetic error
Trace at each call site using vf.Error's field names (type/message/traceback); the
task-exception path carries a real traceback, cancels/empty-trajectory carry none.
- Bump deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: env-server file logging; align debug config batch/group to canonical
- Spawned env servers now route their output (logging + subprocess-runtime output)
to <output_dir>/logs/envs/<name>.log via a _run_env_server wrapper that redirects
stdout/stderr and sets up logging in the child. Previously the orchestrator-spawned
server logged nowhere.
- Debug config: batch_size 16->128, group_size 8->16, eval num_examples 8->128
(interval=1), matching configs/debug/training_modes/rl.toml.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: don't double the envs/ segment in the env-server log path
The orchestrator already passes a train/eval-split log_dir (.../logs/envs/train,
.../logs/envs/eval), so _spawn must drop the file directly under it
(<log_dir>/<name>.log) rather than re-adding an envs/ subdir — which had buried the
train/eval split under logs/envs/<kind>/envs/<name>.log.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (Error.traceback str | None)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (to_wire ordering)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: launch env servers as separate processes from the rl entrypoint
Instead of the orchestrator sidecar-spawning each env server as an mp child, the
rl launcher now spawns one `env-server` process per env (train + eval), each on a
free port, with output to logs/envs/{kind}/{name}.log and a crash monitor — same
model as inference/trainer. It sets env.address in the orchestrator config so the
orchestrator attaches (its existing external path) instead of spawning. Envs that
already set address (user-managed external server) are left alone; the orchestrator's
mp sidecar stays as the fallback for running `orchestrator` directly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: env servers use fixed configurable ports, not get_free_port
Add RLConfig.env_server_base_port (default 5000); the i-th launcher-managed env binds
base_port + i. Drops the get_free_port dependency in the launcher.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: separate train/eval env-server port blocks
Train envs bind base_port + i; eval envs bind base_port + ENV_SERVER_KIND_STRIDE + i
(stride 1000), so each kind has headroom for many envs without the blocks colliding
(was a single running index — train and eval sat adjacent).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: env-server logs + sidecar queue cleanup; train-only debug config
- env_server entrypoint: intercept vf-nano stdlib logging so the server's own logs
(EnvServer up, request failures) land in logs/envs/<kind>/<name>.log — previously
only loguru output was captured, swallowing them.
- envs.py: close the address-handoff mp.Queue after use (no resource_tracker
leaked-semaphore warning on the sidecar path).
- configs/debug/nano/reverse_text.toml: drop the eval block, mirroring
examples/reverse_text/rl.toml (train-only smoke; eval path validated separately).
- bump deps/vf-nano (serve/types docstring trim).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (BaseRequest marker, no request_type field)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: env client uses client= (was client_config=); bump vf-nano
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (drop renderers dep comment)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump vf-nano (configs/ + cli/ split, serve/ runtime-only)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: drop FinishedRollout.to_dict; serialize the Trace to disk directly
The I/O boundary (save_rollouts + monitor sample tables) now dumps the typed
vf.Trace itself (r.trace.model_dump(mode="json")) instead of a Trace+metadata
merge — the on-disk rollout is just the trace.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: track vf-nano agent->harness rename
vf-nano renamed its rollout-driver abstraction Agent -> Harness. Update the
integration: EnvConfig.agent -> harness (HarnessConfig/DefaultHarnessConfig);
env.run_rollout/run_group spawn forwards harness_config; the env-server entrypoint
passes harness_config/harness_timeout; debug config uses `harness = {...}`. Bump
deps/vf-nano to the renamed branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: track vf-nano plugin reorg (reverse-text path + bump)
vf-nano reorganized examples into examples/{tasksets,harnesses}/; point the
reverse-text editable source at examples/tasksets/reverse_text and bump deps/vf-nano.
No prime-rl code change — EnvConfig.harness (default) resolves via vf-nano's built-in
harness registry. Verified: 3-step reverse-text smoke trains (0.26 -> 0.42, 0% error).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: reuse vf.EnvConfig in the orchestrator (typed taskset/harness, drop args)
prime-rl's EnvConfig now subclasses vf.EnvConfig and resolves taskset + harness to their
specific config types by id (taskset_config_type / harness_config_type), so env-specific
fields are validated against the real config — the untyped `args` dict and the top-level
`id` are gone (id/stripped_id/resolved_name are now properties off taskset.id). Timeouts
come from vf.TimeoutConfig (timeout.rollout / timeout.scoring), superseding prime-rl's flat
timeout. The env server is spawned with the typed taskset_config (no env_id/args).
- pyproject: install the vf-nano plugin packages (default/rlm harnesses, gsm8k taskset)
as path sources; bump deps/vf-nano to the plugin-packages branch.
- configs/debug/nano/reverse_text.toml: taskset = { id = ... }, harness.id (was harness.type).
Verified: custom taskset (gsm8k.split) + harness (rlm.ref) resolve to typed configs; bad
fields are rejected; the migrated TOML loads through RLConfig.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: inherit vf's shared plugin resolution; trim dead EnvConfig fields
EnvConfig drops its own _resolve_plugins (now inherited from vf.EnvConfig's shared
validator) and the dead v1-forwarding fields: extra_env_kwargs, max_total_completion_tokens,
state_columns (no readers on the vf-nano branch). Also drop stripped_id (no hub installs ->
no @version, so id == it) — callers use .id. Bump deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: require a configured taskset per env (no reverse-text default)
EnvConfig no longer auto-defaults its taskset to reverse-text; an env with no taskset id
errors at validation. Env-list defaults are empty (eval's non-empty check still fires only
when an eval block is configured). Bump deps/vf-nano.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/vf-nano (dashboard taskset.id/harness.id fix)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/vf-nano (sampling max_tokens fix)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(env-server): require a configured env; build EnvServer from the EnvConfig
EnvServerConfig.env was a bare EnvConfig() default, which now raises (no taskset) and
crashed the env-server at import. Make env required — the orchestrator always passes a
real env config. Build the server straight from config.env (vf-nano EnvServer takes the
EnvConfig). Bump deps/vf-nano (is_truncated computed field).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(nano): reverse-text uses default harness with enable_bash=false
The model answers directly (no bash tool), so the tool_call_parser is no longer needed.
Bump deps/vf-nano (enable_bash flag).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(nano): hendrycks-sanity config on the math-env taskset
Add configs/debug/nano/hendrycks_sanity.toml (vf-nano analog of configs/debug/hendrycks_sanity):
math-env train env on the sanity dataset (R1-distill, default renderer with think parser,
single-turn no-bash), aime24 eval env. Register math-env + aime24 in the envs group + sources.
Bump deps/vf-nano (math/aime tasksets, enable_bash, SerializeAsAny + is_truncated fixes).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/vf-nano to merged main (math/aime tasksets, fixes)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: drop deps/verifiers, bump deps/vf-nano to merged main
vf-nano main (#8) adds the subprocess-runtime env passthrough (inherit host env
minus API_KEY, so UV_CACHE_DIR reaches rollout workers and lands the uv cache on
local disk) and the math-verify scoring fix (wrap gold + prediction in \boxed,
matching v1 math-env — fixes matrix/vector answers scoring 0).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(nano): hendrycks-sanity mirrors examples/hendrycks_sanity + slurm overlay
nano config is now a verbatim copy of examples/hendrycks_sanity/rl.toml with only
the env sections swapped to vf-nano taskset/harness syntax (math-env taskset,
default harness, subprocess runtime; aime24 eval). Adds a slurm overlay setting
the output dir, wandb run name, and partition.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(nano): fold wandb + slurm into hendrycks_sanity config
Move the [wandb] and [slurm] sections from the slurm overlay into the base config, so it
submits to slurm by default (run locally with --no-slurm). The overlay now only redirects
output_dir. wandb run name is vf-nano-subprocess.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(nano): fold output_dir into hendrycks_sanity config, drop slurm overlay
Everything (output_dir, wandb, slurm) now lives in the one config; remove the now-empty
slurm overlay. Run locally with --no-slurm.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(vf-v1): run on the unified verifiers package (v0 envs + v1=nano + legacy bridge)
Depend on the single verifiers package (deps/verifiers, nesting vf-nano) instead of standalone
vf-nano. EnvConfig is dual-mode: v0 envs via id+args (legacy bridge), v1 envs via taskset/harness
(native nano). The env-server spawn (standalone + mp) picks LegacyEnvServer for v0 and EnvServer
for v1; both return vf.Trace so the orchestrator is unchanged. Plugin sources repointed under
deps/verifiers; reverse-text is the v0 env, reverse-text-v1 the nano taskset.
Verified: uv run rl @ examples/reverse_text/rl.toml (v0, unchanged) trains via the bridge
(reward 0.14->0.79); vf-eval + vf-eval-v1 reverse-text both reward 1.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(v0): wire alphabet-sort (multi-turn) + bump verifiers (State scrub)
Add the v0 alphabet-sort env as an installable source; bump deps/verifiers to the State-scrub
commit. Verified the bridge on a multi-turn v0 env: alphabet-sort runs (Turns 2.0, 128/128
trainable, 0% error) alongside single-turn reverse-text.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(v0): wire wordle + add configs/wordle/rl.toml (2-GPU)
Wire the v0 wordle TextArena env (multi-turn game) as an installable source; add a 2-GPU
(1 trainer + 1 inference) wordle config. Verified through the legacy bridge: wordle trains
(Turns ~5.3, reward ~0.81, 128/128 trainable, 0% error).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/verifiers (v1 hygiene: init.py/tests/docs)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(v1): track de-vendored verifiers, rename nano -> v1
- Bump deps/verifiers to the de-vendored commit: vf-nano is now vendored as the
verifiers.v1 subpackage (no nested deps/vf-nano submodule).
- Repoint env-plugin sources from deps/verifiers/deps/vf-nano/... to
deps/verifiers/{examples,packages}/...
- Rename verifiers.nano -> verifiers.v1 across the orchestrator/utils/configs;
rename configs/debug/nano -> configs/debug/v1. "v1" is the name now (no "nano").
Verification: v0 reverse-text (legacy bridge) and v1 reverse-text-v1 (native)
both train over a 3-step smoke (reward present, 0% error).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers (eval/serve, v1 deps in base, bundled plugins)
- Bump deps/verifiers: v1 runtime deps moved to base (no `v1` extra), v1 CLIs
renamed eval/serve, shipped plugins bundled in the tasksets/harnesses umbrella
packages, verifiers/v1/harness.py (flattened harnesses subpackage).
- Depend on `verifiers` (was verifiers[v1]) and the `harnesses` umbrella package
(was standalone default/rlm).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers (Task.system_prompt); write full rollout jsonl
- Bump deps/verifiers to the system_prompt commit: Task.system_prompt + harness
APPENDS_SYSTEM_PROMPT support, reverse_text_v1 byte-identical to the v0 env (separate
system message), plus this branch's eval/serve, v1-deps-in-base, CI fixes, and the
retired semgrep policy.
- save_rollouts: drop exclude_keys={"trajectory"} for both train and eval rollouts so the
jsonl carries the full trajectory.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: drop semgrep from uv.lock (verifiers retired the policy group)
Follow-up to the deps/verifiers bump (00c7b77a removed the `policy` dependency
group); regenerates the lock to match.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: pin the env-server renderer tokenizer to the base model for LoRA runs
Wire `renderer_model_name` (the base model) into the renderer client config so
the env-server renderer builds its tokenizer from the base model instead of the
per-request LoRA adapter name, which has no published HF tokenizer and 404'd
once LoRA training set the served model name to the adapter. Mirrors the
`renderer_model_name` wiring already in `setup_clients` on main. Bumps
deps/verifiers to the matching fix.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(orchestrator): request vLLM token ids for MITO training (#2745)
On the MITO path (no renderer), set return_token_ids in the train env
sampling args so the openai_chat_completions client gets the prompt and
completion token ids back from vLLM and can carry them for training
instead of re-tokenizing the messages downstream. Scoped to
renderer is None so it never reaches the renderer /inference/v1/generate
endpoint (which forwards sampling params to vLLM verbatim).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule; restore v0 env catalog + v1 -v1 imports
- bump deps/verifiers to the feat/nano-as-v1 tip (token-parse #1585, bridge meta #1586,
taskset -v1 rename #1587, native retries #1588, runtime resource cleanup #1590)
- restore the full v0 env catalog in optional-dependencies.envs + [tool.uv.sources]
(init the research-environments submodule); the taskset -v1 rename freed the v0 names,
so v0 envs (legacy bridge) and v1 tasksets coexist
- point the v1 taskset sources at their -v1 names / _v1 paths (gsm8k-v1, math-env-v1,
aime24-v1; reverse-text-v1 already correct)
- update v1 configs to the -v1 taskset ids (hendrycks_sanity) and drop the superseded
standalone configs/debug/reverse_text_v1.toml
- relock
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule to feat/nano-as-v1 tip (textarena #1592)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule to feat/nano-as-v1 tip
Pulls in runtime resources named after the rollout id (#1596) and the
alphabet-sort-v1 taskset (#1595).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule to feat/nano-as-v1 tip
Brings in env-hub ids (#1597), v0 envs on the eval CLI (#1598), modal runtime (#1594).
* chore(v1): add v1 alphabet-sort debug config (port of examples/alphabet_sort)
* fix: forward extra_env_kwargs to v0 legacy envs; drop dead trajectory tests (#2749)
Restores main's escape hatch for v0 (legacy-bridge) envs: a legacy env's extra_env_kwargs
is auto-populated (timeout_seconds <- timeout.rollout, max_total_completion_tokens <-
max_output_tokens, max_seq_len <- seq_len) and forwarded to LegacyEnvServer at spawn, so v0
rollouts again honor the wall-clock timeout, multi-turn completion budget, and seq-len
truncation (all were silently dropped on this branch).
Also removes tests/unit/orchestrator/test_{trajectories,sft_trajectories}.py, which imported
the deleted interleave_rollout and broke test collection.
* fix: install the bundled `tasksets` package (harbor-v1, textarena-v1)
The `envs` extra wired `harnesses` and the individual `*-v1` example tasksets but
never the bundled `tasksets` package, so the integration tasksets it ships
(`harbor-v1`, `textarena-v1`) couldn't be resolved — `import_taskset("harbor-v1")`
raised ModuleNotFoundError ("tried to import 'harbor_v1'").
Add `tasksets` to the `envs` extra + a path source, and bump the verifiers
submodule to the feat/nano-as-v1 tip (#1600), where the bundled tasksets live
under the `tasksets` namespace package (`tasksets.harbor_v1`) and the loader
resolves the namespaced module.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: consume the v1 message-graph trace (#2763)
* feat: consume the v1 message-graph trace (graph-walk trace_to_samples)
Walk the new message graph (verifiers feat/trace-message-graph, PR #1606): trace_to_samples
builds one TrainingSample per branch by concatenating each branch path's node token_ids /
sampled_mask / logprobs (graph.branch_token_sequences), splitting prompt|completion at the
first sampled token — identical training tensors to the old per-turn stitching, off a trace
that is now linear (not quadratic) in turns. backfill_rollout_tokens is a no-op (training is
renderer-only; `trajectory` is now a read-only view over the graph). Bumps the verifiers
submodule to the graph-trace branch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump verifiers submodule (MessageNode.mask rename)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: wire alphabet-sort-v1 taskset
Add alphabet-sort-v1 to the `envs` extra + `[tool.uv.sources]` so
configs/debug/v1/alphabet_sort.toml resolves (it referenced an example taskset that was
never wired into prime-rl). Used to verify graph-based training-sample construction on real
RL runs — v0 (legacy bridge) and v1 (native renderer path) both train cleanly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: consume nodes/branches directly (drop Turn/trajectory readers)
`trace_to_samples` already walks the graph; the remaining readers move off the removed
Turn/trajectory API: the gibberish/repetition filters iterate per-node completions,
advantage/dispatcher use `trace.num_turns`/`trace.completion_len`, `get_model_completion_len`
is dropped (use `trace.completion_len`), and the renderer-only train_sink drops the backfill
path (also removing `backfill_rollout_tokens`). Bumps the verifiers submodule.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump verifiers submodule (merge #1605 multiplex interception)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump verifiers submodule (dead-code cleanup)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers (readme highlight + ruff format)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: enforce renderer, SFT backfill, branch-first-class logging
Training is renderer-only now. RL/OPD roll out through the renderer client
(exact sampled token ids + logprobs); SFT rolls out against a chat-completions
teacher that returns no tokens and re-renders the conversation to backfill them
(`backfill_trace`). A renderer is required for every mode (`renderer=None`
rejected) — the oai client never produces correct training tokens for the
message graph. Drops the MITO no-renderer training path.
Logging consumes `trace.branches` as the first-class unit (`branch.token_ids` /
`branch.messages`) instead of the removed `trajectory` field; `trace_to_samples`
builds one sample per branch from the same accessors. Sample loggers take the
rollout objects so env_name/advantage are available.
Add configs/v1/training_mode (rl/opd/sft + lora/external) mirroring the v0
debug configs. Fix the v0 SFT debug configs + rlm_swe to validate under the
renderer requirement.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: flat TrainingSample (token_ids + mask), required renderer
Drop the prompt/completion split from TrainingSample — it doesn't fit a
multi-turn/agentic branch, where context and model-sampled spans interleave. A
sample now carries the branch's flat `token_ids` plus per-token `mask` (True =
trainable), `logprobs`, and `temperatures` (all aligned). `prepare_sample`
passes them straight into the MicroBatch (already flat), and the packer
validates against `token_ids` length.
Make `orchestrator.renderer` a non-optional type (drop the `enforce_renderer`
validator) — training is renderer-only, so the type carries the requirement.
Bump the verifiers submodule to feat/nano-as-v1 (merged #1606 + Branch.branches
inlined).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: SFT teacher rolls out through the renderer client (drop backfill)
Training is renderer-only across every mode, so the SFT teacher now rolls out
through the renderer client too — its rollouts carry tokens directly, the same
as RL/OPD. Drops the chat-completions backfill (`backfill_trace` + the SFT path
in TrainSink) and the now-unused TrainSink renderer.
This requires a self-hosted teacher that shares the student's tokenizer (the
student trains on exactly the ids the renderer feeds the teacher); distilling
from an external chat API is no longer supported. Remove the `sft_external`
debug configs.
Validated: SFT on reverse-text-v1 trains cleanly (Trainable 128/128, eval reward
~0.1 -> ~0.82 over 20 steps) with the teacher on the renderer client, no backfill.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: drop configs/v1/training_mode README
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: consolidate rollout types into Rollout(vf.Trace)
The trace *is* the rollout: replace the FinishedRollout/TrainRollout/EvalRollout
wrappers with a prime-rl Rollout(vf.Trace[TaskT]) subclass that carries the
orchestration metadata (kind, env_name, group_id, policy_version,
off_policy_steps, samples, advantage, is_filtered, filter_results, eval_step) as
exclude=True fields — so dumping a Rollout still yields a plain trace (on-disk
results.jsonl unchanged). envs.py validates the wire trace into Rollout; the
dispatcher stamps the metadata; train vs eval is the `kind` discriminator
(replacing the isinstance check). All consumers read rollout.X directly instead
of rollout.trace.X.
Drop the monitor's SampleRollout duck-type Protocol — the loggers take the real
Rollout (TYPE_CHECKING import) and read branch.token_ids / branch.messages. Also
drop the prime monitor's _split_branch_messages and _json helpers: the
conversation is the unit (no prompt/completion split — meaningless multi-turn).
Fix a latent dispatcher bug surfaced along the way: synthetic error traces used
`error=` / `r.error = ` (a read-only computed field) — now `errors=[...]` /
`r.errors.append(...)`.
Rewrite the (long-stale, dict/`raw`-based) advantage + filters unit tests to
build real Rollouts — they now exercise the current trace-based code (previously
all failing on import/construction).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: allow verifiers + datasets in the slim-config dep check
The v1 config types (EnvConfig, Task, ...) extend `verifiers.v1`, which is a
declared, pure-pydantic dependency of prime-rl-configs (it pulls `datasets` for
the taskset/Task types but no GPU/ML deps). Drop `verifiers` and `datasets` from
the slim-install forbidden list — keep the real heavy training deps (torch,
vllm, transformers, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule to feat/nano-as-v1 tip
Picks up the v1 end-to-end eval test suite (#1609) and the v0 legacy
env-server group-scoring fix (#1612).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers submodule to feat/nano-as-v1 tip
Picks up the v0 legacy-bridge fixes: guard against non-renderer training
clients (#1613) and serve the eval split for eval-only v0 envs (#1614).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): fix stale sft.toml teacher comments
The SFT teacher rolls out through the renderer client (token-in/out) and
must share the student's tokenizer; drop the leftover oai-client / token
backfill description removed in the renderer-only refactor.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers (v0 eval chat-completions client)
Picks up verifiers#1615: the legacy bridge builds a chat-completions client
for v0 eval rollouts (renderer for training), instead of raising on the
non-renderer eval client.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): scaleswe configs + taskset registration (#2765)
- register the scaleswe-v1 taskset (pyproject envs list + uv source)
- point the existing rlm-swe config (configs/rlm_swe/qwen35_4b.toml) at the
scaleswe taskset (task_type="scaleswe", train + eval)
- add configs/debug/v1/scaleswe.toml — a per-env v1 port of that config using
the scaleswe-v1 taskset via the rlm harness on the prime runtime
Companion to verifiers feat/scaleswe-v1 (scaleswe-v1 taskset + setup/workdir hooks).
Needs the deps/verifiers submodule bumped to that branch once it lands.
* feat(v1): multimodal training through the message graph + color-codeword-v1
Consume the v1 trace's multimodal sidecar. `trace_to_samples` builds, per branch,
`mm_kwargs` (the branch's per-image renderer items concatenated on dim 0 and
EncodedTensor-encoded) and `mm_token_type_ids` (the renderer's
`mm_token_type_id_map` applied to the branch tokens); `TrainSink` threads the
mapping through. The wandb sample logger now renders the task as a Table-safe JSON
string with image data elided — an image-bearing instruction crashed wandb's
Table type inference on the nested content list.
Adds `configs/v1/multimodal_color_codeword.toml` (Qwen3-VL-4B on color-codeword-v1,
2-GPU) and registers the `color-codeword-v1` taskset; bumps the verifiers submodule
for the multimodal message-graph support.
Verified end-to-end: the VLM trains through the mm path (eval 0.69 -> 0.78,
Trainable 256/256 — mm_kwargs reach the Qwen3-VL forward); v0 `color-codeword`
eval 0.625 ~= v1 `color-codeword-v1` eval 0.69 (faithful port).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Revert "feat(v1): multimodal training through the message graph + color-codeword-v1"
This reverts commit 85b27cfc0be12b84f9b36456675b10387d01dc8a.
* feat: multimodal training through the v1 message graph + color-codeword-v1 (#2766)
* feat(v1): multimodal training through the message graph + color-codeword-v1
Consume the v1 trace's multimodal sidecar. `trace_to_samples` builds, per branch,
`mm_kwargs` (the branch's per-image renderer items concatenated on dim 0 and
EncodedTensor-encoded) and `mm_token_type_ids` (the renderer's
`mm_token_type_id_map` applied to the branch tokens); `TrainSink` threads the
mapping through. The wandb sample logger now renders the task as a Table-safe JSON
string with image data elided — an image-bearing instruction crashed wandb's
Table type inference on the nested content list.
Adds `configs/v1/multimodal_color_codeword.toml` (Qwen3-VL-4B on color-codeword-v1,
2-GPU) and registers the `color-codeword-v1` taskset; bumps the verifiers submodule
for the multimodal message-graph support.
Verified end-to-end: the VLM trains through the mm path (eval 0.69 -> 0.78,
Trainable 256/256 — mm_kwargs reach the Qwen3-VL forward); v0 `color-codeword`
eval 0.625 ~= v1 `color-codeword-v1` eval 0.69 (faithful port).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin — multimodal review-pass cleanups
Picks up the verifiers feat/v1-multimodal head: the multimodal review-pass
(capability-flag docstrings, trimmed mm comments, color-codeword-v1 config
validator + module constants) and the merged malloc_trim worker-RSS fix (#1621).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (content-part mm attribution) + config/test sync
- Bump deps/verifiers to the content-part multimodal attribution (drops the unused
placeholder offset machinery).
- Drop max_turns/seed from the color-codeword-v1 taskset args in the config — the
taskset hard-codes them as module constants now, and passing them is rejected.
- Update the mm egress unit test to assert mm_items order (the new attribution),
not placeholder offsets.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(trainer): slice mm_kwargs on truncation so tokens match embeddings
When a sample exceeds seq_len, prepare_sample truncated input_ids and
mm_token_type_ids but passed mm_kwargs through whole — leaving more image
embeddings than surviving image placeholders. Now truncation cuts to a
whole-image boundary (never splitting an image's placeholder block) and slices
mm_kwargs (pixel_values + image_grid_thw) to the images that fully survive, so
image-placeholder count == image-embedding count.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to ruff-formatted graph.py
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): remove test_trajectories_mm.py
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: thread num_workers to the env-server worker pool (#2768)
* feat(v1): thread num_workers to the env-server worker pool
Wire the verifiers env-server worker pool into prime-rl: the orchestrator's
spawned env server (envs.py) and the `env-server` CLI now serve via
verifiers' serve_env with num_workers, so requests fan out across N worker
processes instead of one event loop. num_workers was already a config field but
dropped on the floor; it's now passed through and defaults to 4.
Companion to verifiers feat/v1-env-workers; needs deps/verifiers bumped to it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): default num_workers to 4
Make the worker pool the default: num_workers defaults to 4 (was "auto"->1)
across the per-env, train, and eval configs, so training/eval env servers fan
rollouts across 4 worker processes out of the box. "auto" stays a valid value
(scales per concurrency); set num_workers=1 for the old single-process server.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): keep num_workers="auto" default on the orchestrator
Revert the orchestrator's per-env / train / eval num_workers defaults back to
"auto" (was 4) so they keep scaling 1 worker per 256 concurrent rollouts out of
the box. The standalone env server can't scale (no concurrency context — it's
driven by external clients), so its resolver collapses "auto" to a fixed 4.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to be76cbc3 (env-server worker pool)
Align the pin with #1623 (env-server worker pool: router + N workers),
which the just-merged #2768 (thread num_workers to the pool) requires;
the pin had lagged at the pre-#1623 multimodal tip.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): register r2e-gym-v1 taskset
Add r2e-gym-v1 to the base v1 taskset deps + uv sources (editable from
deps/verifiers/examples/tasksets/r2e_gym_v1) so the id resolves through
the v1 loader, matching the other -v1 tasksets.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(swe): use r2e-gym for rlm_swe configs (v0 + v1)
- v0 configs/rlm_swe/qwen35_4b.toml: restore the train env to r2e and the
eval env to swebench-verified-quick (as on main), reverting the scaleswe switch
- v1: rename configs/debug/v1/scaleswe.toml -> r2e_gym.toml, point the train env
at the r2e-gym-v1 taskset, and drop the eval block
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(swe): point rlm_swe configs at r2e-gym (content)
Apply the edits the prior rename commit missed:
- v0 rlm_swe/qwen35_4b.toml: train -> r2e, eval -> swebench-verified-quick (as on main)
- v1 debug/v1/r2e_gym.toml: taskset -> r2e-gym-v1, eval block removed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): restore env-server worker logs to the env log file (#2770)
Env servers spawn their worker pool as fresh `spawn` processes with no logging
handlers (verifiers#1626), so per-rollout logs (rollout start/done, context-exceed
warnings) were silently dropped. Pass `setup_env_server_logging` to verifiers'
`serve_env` as `log_setup`; it runs in the broker and in every worker. A worker
inherits the broker's redirected stdout/stderr, so its logs land in the same
`envs/{train,eval}/<name>.log` as before — no new files or paths.
Bumps deps/verifiers to the worker-logging fix.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 955b6cdf (dashboard token usage fallback)
Realign the pin onto origin/feat/nano-as-v1 and pick up #1627: the --rich
dashboard's token counts fall back to provider usage when the endpoint returns
no token ids (no more 0/0). The prior pin 3df34ba5 was a pre-rebase #1626
variant; 955b6cdf already contains the equivalent #1626 (env-server worker
logging) plus #1627.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 8e4ad735 (clean env-server teardown)
Picks up the serve_env SIGTERM-teardown fix: pool/in-process env servers no
longer print a spurious KeyboardInterrupt traceback into the env logs on
shutdown.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(deps): bump verifiers (renderers floor 0.1.8.dev40)
Picks up the verifiers floor bump so the renderers offset-tokenizer fix (dev40,
PRs #72/#75) can't be undercut by a pre-fix PyPI resolution. Re-locks uv.lock to
the dev40 specifier.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to db82b38a (reap subprocess tree on cancel)
Picks up #1628 (reap the whole subprocess tree when a runtime run is cancelled).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: elastic env-server pool (inherit static/elastic pool config) (#2774)
* feat(v1): elastic env-server pool (inherit pool config from verifiers)
Companion to verifiers#1629. prime-rl's EnvConfig now extends vf.EnvServerConfig, so
each env inherits the `pool` discriminated union (static{num_workers=4} |
elastic{max_workers=None, multiplex=128}, default elastic) and the orchestrator's env
servers scale workers on demand instead of pre-spawning a fixed `auto` count.
- Drop the per-env / train-group / eval-group `num_workers` fields + the auto-resolution
(ceil(max_inflight/256)); the elastic pool self-sizes from load.
- envs.py / env_server.py pass `vf.pool_serve_kwargs(env.pool)` to serve_env.
- Bump deps/verifiers to the elastic-pool branch.
Breaking: `num_workers` is replaced by `pool`. Configs set `pool = { type = "elastic",
multiplex = N }` or `{ type = "static", num_workers = N }`; the rlm_swe + r2e debug
configs are migrated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): back-compat shim mapping legacy num_workers -> pool
EnvConfig forbids extra fields, so configs still setting the removed `num_workers`
would hard-fail. Add a `model_validator(mode="before")` that maps it onto `pool`:
an int -> a fixed `static` pool, `"auto"` -> the default `elastic` pool; an explicit
`pool` always wins. Keeps existing (incl. out-of-tree) configs parsing without edits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): drop num_workers from rlm_swe + r2e configs (use default elastic pool)
The default `pool` is already elastic (multiplex 128), so an explicit `pool` here was
redundant — just remove the legacy `num_workers` and inherit the default.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to f404e97f (elastic env-server pool)
Realign the pin onto origin/feat/nano-as-v1: the prior pin d0c5bc98 was the
unsquashed #1629 feature branch, now squash-merged as f404e97f
(content-identical). Picks up #1629 (static/elastic env-server pool config).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 88e9bedd
Picks up #1631 (per-rollout setup timing as a distinct phase) and #1632
(per-call model + runtime retries).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 40a2e89f (fix trace.timing.*.duration to_wire validation)
Fixes RunRolloutResponse ValidationError 'trace.timing.setup.duration: Extra
inputs are not permitted' that crashed every rollout (#1636 drops computed
durations from to_wire).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 5dc084f5
Picks up #1638 (add --resume for evals: re-run a previous run's
missing/errored rollouts).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 472622ba
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: stop importing env modules in the orchestrator (always Rollout[WireTask]) (#2781)
* chore(v1): stop importing env modules in the orchestrator
The orchestrator built its per-env trace_type as Rollout[vf.task_type(env_id)] for v1 envs, and
vf.task_type imports the env package just to read its Task subclass for typing the wire trace.
Nothing reads typed env task fields - only task.idx and a full task.model_dump - and WireTask
(extra="allow") preserves those fields (incl. on disk). Always use Rollout[vf.WireTask], so the
orchestrator never imports an env package: the env's type and runtime both live only in the
server process.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): hoist the constant Rollout[WireTask] to a module-level ROLLOUT_TYPE
It no longer varies per env, so it doesn't belong as a per-instance attribute set in
Env.__init__ - lift it to a module constant used directly in run_rollout/run_group.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 7270e69b
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to 66c87d5b
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers to ef45f720
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (alphabet-sort host user sim, #1645)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (modal creates_per_sec 5 -> 40, #1646)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: cap v1 hendrycks-sanity scoring at 10s (#2790)
* fix(v1): cap hendrycks-sanity scoring at 10s
Without a scoring timeout (the default is no limit), a wedged math verify holds its
rollout's permit forever — sympy can spin past the in-script alarm — and at 512
concurrency that starves the pool and stalls long runs. Set timeout.scoring = 10 on the
train and eval envs so the framework cancels and the subprocess runtime kills a runaway
verify, freeing the permit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: drop inline comment on the scoring timeout
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers (eval/train client rename) + adopt config imports (#2792)
Bump deps/verifiers to feat/nano-as-v1 HEAD (8873a740), which includes verifiers#1654 — the v1
interception rework: role-named clients (EvalClient/TrainClient), route-detected wire dialects
(chat/responses/anthropic), 1:1 relay + streaming, reasoning preserved.
Adopt the renamed client config classes in prime_rl/utils/client.py:
OpenAIClientConfig -> EvalClientConfig, RendererClientConfig -> TrainClientConfig.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (subprocess cached-interpreter uv-scripts, #1660)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (codex built-in harness, #1661)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: track terminal-bench-2-v1 as a taskset dependency
It was only a manual editable install, so `uv sync` pruned it. Add it to the env dependency
group + [tool.uv.sources] (mirroring r2e-gym-v1) so it persists across syncs and is available
out of the box.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): keep multimodal tensors out of rollout dumps (#2794)
verifiers#1653 (carry mm tensors across the env-server wire) is merged and pinned, so
`MessageNode.multi_modal_data` is no longer `exclude=True` — `model_dump(mode="json")` now
serializes the base64 pixel tensors into `train_rollouts.jsonl` and the wandb sample tables,
bloating every line. They're the training `mm_kwargs` carrier, not part of the rollout
record, so exclude them at the dump boundary (train + eval paths).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): install all v1 example tasksets in prime-rl
Declare the remaining 7 verifiers v1 example tasksets (code-golf, deepwiki,
glossary, swelego, wiki-search, wikispeedia, wordle) as editable deps so uv sync
installs every example, matching the verifiers examples set. chromadb/textarena
were already present via the v0 wiki-search/wordle envs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): install the compact example harness in prime-rl
The example harness (examples/harnesses/compact) was missing from prime-rl deps,
so the documented --harness.id compact branching example failed to resolve
(ModuleNotFoundError: harness compact not found). Declare it like the example
tasksets so uv sync installs it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (v1 docs #1662 + Trace.info #1664)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): encode router-replay routed_experts into transport (#2808)
* feat(v1): encode router-replay routed_experts into transport
Pack Branch.routed_experts ([tokens, layers, top_k]) into the transport
RoutedExperts the trainer replays, realigning the token axis to len(token_ids)
as a backstop. Bumps the verifiers pin to the companion router-replay commit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (raw-bytes wire) + exclude routed_experts from disk dumps
Bumps deps/verifiers to the raw-bytes router-replay codec (RoutedExperts rename +
msgpack bin wire). routed_experts now rides the env-server wire as raw bytes, so it
can't round-trip the json disk dump — add it to ROLLOUT_DUMP_EXCLUDE alongside
multi_modal_data (both are training inputs, not part of the rollout record).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): guard router-replay vs prefix caching + bump verifiers/renderers pins
- Add disable_prefix_caching_for_router_replay validator: prefix-cache hits skip
recomputing the cached prefix, so the engine returns no routed-expert decisions for
those tokens. Router replay needs routing for every token, so force
enable_prefix_caching=False (mirrors the existing kv_cache_offload guard).
- Bump deps/verifiers: tail-pad routed_experts so the final node aligns (the engine
omits the last position's routing).
- Bump deps/renderers: _get_offset_tokenizer immune to the global fastokens patch race.
Together these make v1 MoE router replay work end-to-end (Qwen3-30B-A3B): verified
mismatch_kl drops vs no-replay (0.0005/0.0002/0.0002 vs 0.0015/0.0015/0.0005 @ steps 0/1/2).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/renderers pin (ruff format fix)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/verifiers pin (ruff format)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump deps/verifiers pin to merged feat/nano-as-v1 (router-replay #1672)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Remove disable_prefix_caching_for_router_replay validator
Drops the guard that force-disabled inference.enable_prefix_caching under router replay.
Validating whether prefix caching is actually compatible with router replay (cache hits
may carry no routed-expert decisions); re-add if the A/B shows it drops routing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(orchestrator): keep top-level advantage wiring after merge
The merge auto-resolved train_sink.py and the orchestrator's TrainSink
construction to main's per-env advantage design (#2721), but envs.py and the
configs were kept on the branch's top-level design — so TrainSink read
`train_envs.get(env_name).advantage_fn`, which TrainEnv no longer defines
(AttributeError at rollout time).
Restore the branch's top-level advantage: TrainSink takes `advantage_config`
and builds its own `self.advantage_fn` once. Verified end-to-end with a
reverse-text-v1 RL smoke (reward climbs 0.16 -> 0.40 over 6 steps).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to merged main (1b7736a8)
deps/verifiers feat/nano-as-v1 now includes origin/main merged in
(composable tasksets + sandbox/save utils). Pin moves 7a98b566 -> 1b7736a8.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump pydantic-config submodule to main (single-dash short flags)
deps/pydantic-config 896ade4 -> 99f47c6 (origin/main). Picks up #16
(single-dash short flags for single-character aliases, e.g. `eval -n -m`)
and upstreams the dict[str,str] preservation fix (#14). No uv.lock change
(editable path source).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (5fc0b295)
Picks up the py3.11 TypedDict CI fix and #1676 (prime-sandbox programs run for
the sandbox lifetime instead of the 15-min background-job default, + retry-log
wording). Pin moves 1b7736a8 -> 5fc0b295.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 3af08c9b
Includes verifiers#1677 - scaleswe-v1 resolves task images via Prime's
Artifact Registry instead of the incomplete public Docker Hub mirror.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(orchestrator): trim glibc heap back to the OS each step (#2821)
Factor the existing end-of-run malloc_trim into a `trim_process_memory()`
helper and also call it at the end of `finalize_train_batch`. Each step frees a
step's worth of rollouts / traces / transport buffers, but glibc keeps those
pages in per-arena free lists, so orchestrator RSS climbs over a long run
without ever shrinking. Trimming per step returns them to the OS.
Mirrors the per-step trim in prime-rl #2807 — the trim only; that PR's
`.raw`-based retention helpers don't apply to this branch's typed Rollout/Trace.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 7862985b
Includes verifiers#1678 - scaleswe-v1 Prime Artifact Registry is now opt-in
(`use_prime_registry`, default off), so the default Docker Hub image path works
on local docker runtimes again.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: route consistent_hash on X-Session-ID for cross-turn prefix reuse (#2822)
The vllm-router `consistent_hash` policy keys on request-id headers (default
x-request-id / x-correlation-id / x-trace-id / request-id). The v1 inference
clients send none of those per rollout, so a multi-turn rollout's turns hashed
to random DP shards and re-prefilled the growing prompt cold each turn (~40%
prefix cache hit rate on an agentic SWE run, where it should approach the
eviction-limited ceiling).
Launch the router with `--request-id-headers x-session-id` so it keys on the
per-rollout `X-Session-ID` header the v1 clients now emit (companion verifiers
change). Every turn of a rollout pins to one engine, keeping its cross-turn
prefix warm. Harmless for the random / round_robin policies, which ignore
request-id headers.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 211faecb (session-affinity routing)
Picks up verifiers #1680 (session-affinity routing header for cross-turn
prefix reuse) — the counterpart to prime-rl #2822. Pin 7862985b -> 211faecb.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 3f45f73b (scaleswe-v1 image filter)
Picks up verifiers #1679 (filter unavailable scaleswe-v1 images at load).
Pin 211faecb -> 3f45f73b.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 44da378c (r2e-gym-v1 registry opt-in)
Picks up verifiers #1681 (r2e-gym-v1 Prime Artifact Registry opt-in, default
off). Pin 3f45f73b -> 44da378c.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to a723977c (scaleswe-v1 image_url filter)
Picks up verifiers #1683 (filter on Docker Hub image_url, not the resolved
image). Pin 44da378c -> a723977c.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to 0c8d0aa1 (rootless harness install)
Picks up verifiers #1685 (harnesses install/run without root, pinned
/tmp/vf-{harness}) and #1684 (remove Claude Code harness). Pin a723977c -> 0c8d0aa1.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to d4b054e3 (skip region-limited e2e test)
Picks up verifiers #1686 (skip test_multi_turn on prime — colocated user-sim
port exposure is region-limited). Pin 0c8d0aa1 -> d4b054e3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: point verifiers env paths at the flattened environments/ dir (#2824)
* chore: point verifiers env paths at the flattened environments/ dir
Companion to verifiers #1695 (flatten examples/ into a single environments/).
Update the deps/verifiers editable source paths in pyproject.toml + uv.lock:
examples/tasksets/<x> -> environments/<x> and
examples/harnesses/compact -> environments/compact. Bump the verifiers pin to
the flatten branch (7ddc78b2) so the relocated paths resolve.
Re-pin to the merged commit once verifiers #1695 lands.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(deps): bump verifiers to 22b02e4b (flatten examples/ into environments/, #1695 merged)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): advance verifiers pin to feat/nano-as-v1 tip (Trace.state + DNS fix)
#2824 retargeted the env paths but pinned deps/verifiers at 22b02e4b (#1695,
just after the examples/->environments/ flatten), which predates the later
merges. Advance the submodule to the actual feat/nano-as-v1 tip bf30ae5f
(verifiers 0.1.15.dev298): adds Trace.state (#1711), the unconditional MCP
DNS-rebinding relax (#1715, fixes the in-prime tool 421 CI failures), and the
init scaffold (#1713).
bf30ae5f also dropped verifiers' self-referential `packages` extra, so drop
`[packages]` from the verifiers override-dependency (and refresh the stale
sources comment).
Smoke: `eval reverse-text-v1 -n 1` (subprocess, temp=0) runs clean — no errors,
not truncated, reward ~1.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (#1717 + #1719)
Advance deps/verifiers bf30ae5f -> f7fa7482:
- #1717 train-client prefix bridging + token-based message-graph branching
- #1719 default the harness runtime to subprocess
No prime-rl-side changes needed: every prime-rl v1 config already sets
harness.runtime.type explicitly (#1719's default flip is a no-op here), and the
consumed verifiers surface (serve EnvClient/serve_env/pool_serve_kwargs,
clients.config Eval/TrainClientConfig, task.TaskT, the Trace branch/token API) is
untouched by #1717. Imports resolve; reverse-text-v1 eval smoke clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (f7fa7482 -> bbfd5646)
New since the last pin: #1718/#1721 (CI + tests), #1723 (per-harness tool
disabling), #1666 (client consolidation + chat-completion header forwarding),
#1722 (warn on non-default subprocess harnesses). No prime-rl-side changes
needed: clients.config (the consumed surface) is untouched by #1666's client
refactor, #1722 only warns and exempts the default harness (what prime-rl's
subprocess configs use), and the rest is additive/CI-only. Imports resolve;
reverse-text-v1 eval smoke clean (reward 1.0).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: verifiers #1732 companion (model_dump traces, Task.prompt rename) (#2831)
* chore(v1): add prime CLI as deps/prime submodule (feat/nano-as-v1)
Tracks the companion PrimeIntellect-ai/prime#751 branch that adds verifiers v1
eval support to the prime CLI (run/view consume the v1 entrypoint + Trace format).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (bbfd5646 -> 220f21d4)
New: #1727 (per-rollout isolation for shared writable tool servers) and #1702
(trim verifiers runtime deps — modal/notebook/quest/pdf moved to extras). No
prime-rl-side changes needed: the only dropped transitive dep is pymupdf, used
solely by verifiers' experimental quest PDF tool via a lazy import behind the
quest extra (prime-rl never touches it). Imports resolve on dev307;
reverse-text-v1 eval smoke clean (reward 1.0).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: validate env-server traces via model_dump (companion to verifiers to_wire removal)
verifiers drops Trace.to_wire/from_wire and the derived computed fields (reward,
is_truncated, error, duration are plain properties now). Swap wire.to_wire() ->
wire.model_dump() when re-typing a returned Trace into ROLLOUT_TYPE; the .reward /
.is_truncated the metrics/eval code reads are the Trace properties, so they still work.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: rename vf.Task(instruction=) -> prompt= (verifiers #1732 companion)
verifiers #1732 renames Task.instruction -> Task.prompt; update the dispatcher's
error-rollout Task construction to match. Pin bump to the merged commit comes when #1732
lands.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to chore/v1-general-cleanup tip (220f21d4 -> d78d7474)
Pin #1732 (general v1 cleanup) so this companion's model_dump trace handling and the
Task.prompt rename round-trip against a verifiers that actually has them. Re-pin to the
feat/nano-as-v1 tip once #1732 merges.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (d78d7474 -> caaf0ff3)
#1732 (general v1 cleanup) merged into feat/nano-as-v1; re-pin off the chore branch onto the
integration tip. This companion's model_dump trace handling + Task.prompt rename now run
against merged verifiers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: error-rollout placeholder task uses prompt=None
An error rollout has no prompt; None is the honest value (Task.prompt is str | Messages |
None) rather than an empty string.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): drop removed enable_bash from harness configs (verifiers #1723) (#2833)
verifiers #1723 (in the current pin) removed the default harness's enable_bash
field — the default harness now exposes only the taskset's MCP tools (use an
agentic harness like mini-swe-agent for a shell). All v1 configs still set
`enable_bash = false`, which now fails config validation (Extra inputs are not
permitted). Drop it (no-bash is the default, so behavior is unchanged); no src/
code referenced it.
Verified: `uv run rl @ configs/debug/v1/reverse_text.toml` (Qwen3-0.6B, 2 steps)
runs end-to-end — orchestrator rollouts Error 0.0% (reward 0.117 -> 0.177),
trainer steps + checkpoint, 'Training finished!'.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin to feat/nano-as-v1 tip (caaf0ff3 -> cc4afd52)
New: #1733 (robust env-server teardown, no leaked tunnels/sandboxes), #1734
(general-agent solver v1 taskset, additive/opt-in), #1735 (reject unsupported
task system_prompt). No prime-rl-side changes needed: consumed serve/clients
surface unchanged, default harness supports system_prompt, new taskset not
registered. Imports resolve; reverse-text-v1 eval clean (reward ~1.0, no errors).
Note: #1733's worker teardown throws KeyboardInterrupt on SIGTERM but run_server
doesn't swallow it, so a benign KeyboardInterrupt traceback prints at env-server
shutdown (cosmetic; verifiers follow-up).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): add debug general-agent-v1 RL config + register the taskset
Add configs/debug/v1/general_agent.toml — the v1 general-agent-v1 taskset
(GeneralAgentSolverTaskset) on the default harness, with the agent and its tool
server colocated in a modal sandbox. Adapted from configs/general_agent/
rl_qwen3_4b.toml (Qwen3-4B, batch 256). Register general-agent-v1 in
[tool.uv.sources] + the envs extra so the id resolves.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): add scaleswe-v1 RL config (Qwen3.6-35B-A3B, 65k ctx)
configs/debug/v1/scaleswe.toml — the v1 scaleswe-v1 SWE taskset on the rlm
harness + modal runtime (each row injects its own Docker image into the sandbox;
no MCP toolset). Qwen3.6-35B-A3B, batch 256, 65k context, qwen3.6 renderer with
thinking. Deployment/parallelism (cp=2, infer dp=2 tp=4, 1 train + 1 infer node)
seeded from the 30B-A3B reference — tune on the cluster for the 35B / 65k
footprint. Multi-node slurm; scaleswe-v1 was already registered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (cc4afd52 -> 3c5f6586) + register swebench-verified-v1
New: #1738 (swebench-verified harbor taskset, prime prebuilt images), #1739
(don't retry program exec - fixes forked duplicate trace branches), #1736/#1737
(quest pdf sanitization, dashboard rotation). Register the new swebench-verified-v1
env (source + envs extra); no other prime-rl changes needed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(v1): add SWE-Bench-Verified online eval to the scaleswe run (prime runtime)
Mirror the v0 rlm_swe SWE-bench eval on the v1 scaleswe config: [orchestrator.eval]
interval=20, an eval env on the swebench-verified-v1 taskset via the rlm harness on
the prime runtime (use_prime_registry=true -> prime's prebuilt instance images),
rollout timeout 3600s. Train stays on modal; eval runs on prime.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(v1): use public images for the scaleswe SWE-Bench-Verified eval
A debug eval showed use_prime_registry=true fails with IMAGE_PULL_FAILED on the prime
runtime: the SWE-bench Verified sweb.eval.* instance images aren't mirrored into prime's
prod-sandbox Artifact Registry. The same prime sandbox pulls r2e-gym-v1's prime-registry
image and the public swebench/sweb.eval.* image fine, so it's a missing-mirror issue, not
credentials. Drop use_prime_registry (default false -> public Docker Hub images) so the
online eval works on the prime runtime now; flip it back on once the images are mirrored.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin + re-enable use_prime_registry for the scaleswe SWE eval
Bump deps/verifiers 3c5f6586 -> 952b2a7d, which lands the swebench-verified-v1 prime-image
path fix (PrimeIntellect-ai/verifiers#1740): the mirror keeps the swebench/ org, so
use_prime_registry=true now resolves to prod-sandbox/swebench/sweb.eval.* and pulls. Flip the
scaleswe SWE-Bench-Verified eval back to use_prime_registry=true (verified to pull on a prime
sandbox), for the fast cached mirror instead of public Docker Hub.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): cap hendrycks-sanity at 256 in-flight rollouts + 30s scoring timeout
Set orchestrator max_inflight_rollouts=256 (below the 512 batch) and bump the per-env
scoring timeout 10s -> 30s on both the train and eval envs. Guards against the subprocess
env-server stall where unbounded concurrency + a hanging math-verify hold permits until the
run wedges.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (general-agent-v1 colocated toolset fix)
Bump deps/verifiers 952b2a7d -> 56a720ca: PrimeIntellect-ai/verifiers#1741 makes the
general-agent-v1 toolset work when colocated in a sandbox (ships the task's tools.py + db.json
over /task). Env-package only - no framework/config surface, no prime-rl changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump hendrycks-sanity scoring timeout to 5min
Raise the per-env scoring timeout 30s -> 300s on both the train and eval envs - 30s was too
tight for the math-verify scoring under load.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(orch): show avg branches next to turns in step + eval log lines
Add 'Branches {mean:.1f}' alongside 'Turns' in the per-step train head, the per-env
breakdown, and the eval line - the average trace branch count per rollout (1 = linear, >1 =
compaction/subagents).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): update tmux + monitor-run skill for flattened env log paths
Env logs are now one file per env (envs/{train,eval}/{env_name}.log)
instead of nested env_server/env_worker_* files.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(v1): bump verifiers pin (retry backoff + relay retries)
Bump deps/verifiers 56a720ca -> 6647fe0a: PrimeIntellect-ai/verifiers#1744 adds exponential
backoff + jitter to the per-call client/runtime retries (so concurrent rollouts don't
re-thunder a shared endpoint) and lets harness clients retry the relay. Internal/additive -
no config schema or API change, no prime-rl edits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Fix routed SLURM inference DP rank client config (#2830)
Co-authored-by: Codex <codex@primeintellect.ai>
(cherry picked from commit
|
||
|
|
e035135126 |
feat: llm-d (EPP+Envoy) router backend (#2697)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* refactor: drop client-side DP-rank pinning for external-LB
With external-LB data parallelism each DP rank is its own API server on its
own port (the URL is the rank selector), so the client no longer needs the
hybrid-LB `X-data-parallel-rank` header to pin a rollout to an internal DP
shard. Remove the `dp_rank_count` client field + its auto-setup and the
per-rank client expansion: one client per base URL, no rank header. The
router (vllm-router or llm-d EPP) balances across the per-rank endpoints.
This also fixes llm-d routing: the EPP forwards the header to the dp=1
backend, which rejected it ("data_parallel_rank N is out of range").
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: llm-d (EPP+Envoy) router backend
Add llm-d as a second router backend alongside vllm-router, selected via
`[inference.deployment.router] type = "llm-d"`. Built on the external-LB
launch substrate — the per-rank vLLM engines launch identically; only the
router control plane differs.
- `LlmdRouterConfig`: discriminated-union member with `scorers` (base) +
per-profile `prefill_scorer_overrides`/`decode_scorer_overrides`,
`non_cached_tokens`, `decode_sidecar_port`, and a known-scorer validator.
- `launch_router` helper gains an llm-d branch: renders per-replica EPP +
Envoy + file-discovery endpoints and launches `epp` + `envoy` instead of
vllm-router. Call sites stay router-agnostic.
- pd-sidecar on each decode node (P/D) for remote-prefill orchestration + NIXL.
- Entrypoints pass the `router` config object to the templates.
- Reject `enable_return_routed_experts` with llm-d (breaks P/D, unverified
for multi-node).
- SLURM cleanup also clears stale `epp`/`envoy`/`pd-sidecar` processes.
- Presets under `templates/llmd/` + `scripts/install_llmd.sh`; docs + install skill.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(inference): mooncake-store + llm-d EPP coexistence on SLURM P/D
- per-rank VLLM_RPC_BASE_PATH: external-LB runs one engine per process (all
data_parallel_rank_local 0), so the mooncake-store lookup ipc socket collided
on a node-shared dir; key it by $port. Also avoids an absent submit-node TMPDIR.
- EPP --grpc-health-port 9003 -> 9013: 9003 collided with mooncake_master's
metrics server on the shared replica-head node, which killed the EPP.
- mooncake_master -default_kv_lease_ttl=3600000: KV blocks were expiring (5s
default) before the decode side reused them.
- envoy circuit_breakers raised to 100000 on backend + epp clusters: the default
(~1024) overflowed at high inflight concurrency -> "reset reason: overflow" 500s.
- pd-sidecar launches on every decode node (not just the replica head), else
decode nodes past the head advertise endpoints nothing serves.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Feat: dockerless llmd install
* chore(configs): add GLM-5.1 llm-d disaggregated RL config
End-to-end RL config used for the GLM-5.1-FP8 llm-d (EPP+Envoy) P/D run:
12 train nodes + 16 inference nodes (8 prefill x2 / 8 decode x2), mooncake KV
store, r2e env. Lives alongside the existing glm5 disaggregated inference preset.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(configs): move GLM-5.1 llm-d RL config to dedicated configs/glm5_llmd/
Relocate the end-to-end GLM-5.1-FP8 llm-d (EPP+Envoy) P/D RL config into its own
configs/glm5_llmd/rl.toml (out of glm5_disagg_inference) and refresh it to the
latest tuned version.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(inference): per-role prefill/decode vLLM overrides for disaggregated P/D
Add `prefill_vllm_overrides` / `decode_vllm_overrides` to the disaggregated
inference deployment config (mirrors the existing `*_env_overrides`): extra
vLLM config options merged into the per-role `--vllm-extra` JSON for prefill
vs decode ranks on SLURM. Rendered via a small `vllm_overrides_fragment` helper
into the `ROLE_EXTRA` string in the inference / multi-node-RL sbatch templates.
Needed by configs/glm5_llmd/rl.toml (sets `decode_vllm_overrides`), which
otherwise fails `extra="forbid"` validation in test_load_configs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(configs): enable prefill dual-batch-overlap in glm5_llmd config
Set prefill_vllm_overrides = {enable_dbo = true} (the inference-side perf knob
tuned during the GLM-5.1 run). Batch size / num-concurrent / node-scale knobs
left as-is — those are run-specific, not portable config.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(configs): tune glm5_llmd prefill/decode replicas (4 prefill / 1 decode)
num_prefill_replicas 2->4, num_decode_replicas 2->1 — the disaggregation split
found to perform best for GLM-5.1 (prefill is the bottleneck; one wide decode
replica maximizes decode KV/batching).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: add GLM-5 llm-d example (16-node / 131K trainer) (#2854)
* docs: add GLM-5 llm-d example (16-node / 131K trainer)
Move the glm5_llmd config from configs/ into examples/glm5_llmd/ with a
README, mirroring the other GLM-5 example. Frame llm-d as the faster
router for GLM-5 and document the placeholders users must tweak
(output_dir, slurm partition, mooncake device_name).
Tune the example for a 16-node trainer: seq_len=131072, num_train_nodes=16,
cp=4, and adamw optimizer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: reword GLM-5 llm-d example entry as one-line SLURM deploy
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: highlight GLM-5 llm-d one-line SLURM deploy in Overview
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Signed-off-by: Matej Sirovatka <54212263+S1ro1@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: faresobeid <fares@primeintellect.ai>
Co-authored-by: samsja <55492238+samsja@users.noreply.github.com>
|
||
|
|
7f77713886 |
update length penalty and add back length weighted baseline (#2702)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|
||
|
|
8dfe8734e3 |
Fix routed SLURM inference DP rank client config (#2830)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
Co-authored-by: Codex <codex@primeintellect.ai> |
||
|
|
060f25bb3a |
feat(deployment): optionally run orchestrator on an inference node (#2811)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
Adds MultiNodeDeploymentConfig.orchestrator_on_inference (default False). When False, the orchestrator launches on trainer rank 0 (unchanged behavior). When True, it launches on the last inference node (a decode node) instead — useful when trainer nodes are host-RAM-saturated (large CPU-offloaded optimizer state) and the orchestrator's rollout buffer + env workers would otherwise exhaust memory there; inference nodes keep weights/KV on GPU with ample free host RAM. The orchestrator launch is now a single top-level block in multi_node_rl.sbatch.j2 gated on a flag-selected SLURM_PROCID (NUM_INFER_NODES for trainer rank 0, or NUM_INFER_NODES-1 for the last inference node), so both placements share one code path. No effect when num_infer_nodes == 0. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
77af037537 |
IPO config (#2798)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* IPO config * fix: apply Ruff formatting in RL loss module --------- Co-authored-by: faresobeid <fares@primeintellect.ai> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> |
||
|
|
7c9c1308dc |
Register Nano V3 reasoning parser (#2767)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* fix: register nano v3 reasoning parser * chore: apply ruff formatting |
||
|
|
941019f2e3 |
[feat] multiplex trainer token export and agg to prime monitor on orch side (#2641)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
* multiplex trainer output * update skill * test: cover multi-run token exports * feat: export token metrics from orchestrator * refactor: store token export run fields on microbatch * refactor: send microbatches without payload wrapper * test: cover orchestrator token-export metric collection Adds an integration test asserting the orchestrator's per-step read path (collect_token_export_metrics) surfaces finite mismatch_kl/entropy mean/max from real multi-run exports. Complements the file-writing coverage in test_token_exports_are_run_local; reuses the existing fixture. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: defer token-export STABLE until run step fully consumed A single orchestrator run_step can span multiple trainer steps when the packer splits its samples across packs (token budget). mark_stable() ran every trainer step and marked any dir touched that step, so the orchestrator could read a run step's exports as complete from only the first pack's sequences and advance its cursor, never aggregating the remainder. Mark a run's export dir STABLE only once that run step is fully consumed — gated on the same ready_to_update signal that drives its optimizer step. Dirs for runs not yet ready carry over to a later trainer step. run_id=None (single-run export) never spans trainer steps, so it is marked immediately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: stamp token-export metrics with their trainer step Token exports lag the orchestrator step they're logged under (the trainer runs behind), so on the default W&B step axis mismatch_kl/entropy appear shifted right. Log the run step the exports actually belong to as `trainer/step` so the metrics can be plotted against a lag-corrected axis. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: fold token-export metrics into MetricsBuilder under trainer/ Move the token-export collection from the orchestrator mainline into MetricsBuilder.build, which now owns the last-logged-step cursor (seeded from the resumed step via start_step). Namespace the metrics under trainer/ (trainer/mismatch_kl/*, trainer/entropy/*) alongside trainer/step so they group in W&B and can be plotted against a lag-corrected axis. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: drop redundant max_step from token-export reader Exports always lag the orchestrator (the current step's batch is shipped just before metrics are built and trained afterward), so no stable export at or beyond the current step can exist on disk. The `step <= max_step` filter was always satisfied; the last_logged_step cursor alone drives correctness. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: return log-ready dict from token-export reader Drop the TokenExportMetricsResult dataclass that was unpacked into a dict one line later. collect_next_token_export_metrics now returns the trainer/-prefixed metrics (including trainer/step) directly, so the builder just updates the log dict and reads trainer/step back to advance its cursor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: guard token-export log update under the truthiness check Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: drop redundant run_idx guard in SinglePacker The receiver always stamps batch.run_idx from used_idxs (a key of idx_2_id), so the is-not-None/in-idx_2_id check was always true. Index directly, matching MultiPacker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: mark token-export STABLE with a barrier instead of all_gather The all_gather_object did barrier + dir-union + rank-0 write. Replace it with a plain dist.barrier() (so STABLE only lands after every rank flushed its rank_*.jsonl), then each rank touches STABLE for the dirs it wrote. touch is idempotent, so ranks sharing a (run, step) dir converge harmlessly, and the union is covered without shipping dir lists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: barrier at the call site, drop participate_in_stable_marking The barrier lived inside the exporter, so the disabled variant needed a participate_in_stable_marking flag to opt into it. Move the barrier to the single train-loop call site, gated on token export being enabled (uniform across ranks): every rank barriers together, then writers touch STABLE and disabled ranks no-op. DisabledTokenExporter is a pure no-op again and the exporter does no collectives. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: drop dist.is_initialized guard before token-export barrier train() always calls setup_torch_distributed before the training loop, so dist is initialized by the time the barrier runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: drop redundant comments around token-export barrier Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: derive token-export root from output_dir.parent root_output_dir was just output_dir.parent of self.output_dir and used in one place; drop the redundant attribute. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: skip malformed token-export records instead of aborting the step Token-export metrics are best-effort monitoring read inside MetricsBuilder.build every step. A malformed JSONL line or a loss_mask/value length mismatch raised ValueError, which would abort the orchestrator step. Guard each record, skip and count failures, and warn once per step dir; good records still aggregate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: drain trailing token-export metrics after max_steps Token exports lag the orchestrator, so the last shipped steps are finalized by the trainer after the main loop ends — and build() no longer runs to log them, dropping the tail. Add an end-of-run drain that polls for the remaining stable steps up to max_steps-1 and logs each under its own trainer/step (a local W&B step axis, leaving progress.step for the final checkpoint untouched). Gated on token export being on for the run; early-returns when build() already kept up; bounded by a timeout. Shared collection extracted to MetricsBuilder.next_token_export_metrics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * make token export a top-level trainer flag * chore: fold token export into multi-run integration config * chore: revert multi-run trainer config override * chore: remove token export unit tests * docs: document token export config migration --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
0695f9caa5 |
fix: allow sft without teacher (#2720)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s
|