Compare commits

...
Author SHA1 Message Date
samsjaandGitHub b636a8b7ec chore: bump prime-envs to latest main (#3630)
## Summary
- Bump the `deps/prime-envs` submodule from `1f1e050ab` to `1213b7336`
(latest `main`).
  - Pulls in:
-
[prime-envs#791](https://github.com/PrimeIntellect-ai/prime-envs/pull/791):
strip v0 remnants.
-
[prime-envs#795](https://github.com/PrimeIntellect-ai/prime-envs/pull/795):
restore solver network access for training environments.
-
[prime-envs#797](https://github.com/PrimeIntellect-ai/prime-envs/pull/797):
500-trace SWE cheating recall benchmark (new `trace-cheating-recall-500`
judge env).
-
[prime-envs#796](https://github.com/PrimeIntellect-ai/prime-envs/pull/796):
run MCP Atlas and Enterprise Ops Gym services in VMs.
-
[prime-envs#798](https://github.com/PrimeIntellect-ai/prime-envs/pull/798):
fair-use solver prompts for SWE and terminal training tasksets.
-
[prime-envs#805](https://github.com/PrimeIntellect-ai/prime-envs/pull/805):
keep env CI evals off the platform.
-
[prime-envs#770](https://github.com/PrimeIntellect-ai/prime-envs/pull/770):
OfficeQA Pro V2 (new `officeqa-pro-v2` env).
-
[prime-envs#808](https://github.com/PrimeIntellect-ai/prime-envs/pull/808):
complete TMax platform hosting and source references.
-
[prime-envs#814](https://github.com/PrimeIntellect-ai/prime-envs/pull/814):
ask before changing repository skills.
-
[prime-envs#815](https://github.com/PrimeIntellect-ai/prime-envs/pull/815):
support renamed Verifiers eval CLI in CI.
-
[prime-envs#822](https://github.com/PrimeIntellect-ai/prime-envs/pull/822):
remove obsolete Prime VM configuration.
- Relock `uv.lock`: new workspace members `officeqa-pro-v2` and
`trace-cheating-recall-500` (auto-discovered via
`deps/prime-envs/environments/*/*`); env package version bumps.

## Validation

- `uv sync --all-extras --all-packages --locked` passes.
- `uv run pytest tests/unit -m "not gpu"`: 616 passed, 1 skipped.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Training and evaluation behavior can shift (solver prompts, network
access, VM-hosted tool services, new benchmarks) because many SWE,
terminal, and tool-use env packages change together.
> 
> **Overview**
> Updates the **`deps/prime-envs`** submodule to the latest **`main`**
and refreshes **`uv.lock`** so the workspace picks up new and bumped
editable environment packages.
> 
> The lockfile adds two auto-discovered members—**`officeqa-pro-v2`**
(search) and **`trace-cheating-recall-500`** (judge)—and bumps patch
versions across many existing env packages (SWE stacks like
**`openswe`**, **`multiswe`**, **`swesmith-env`**; terminal **`tmax`** /
**`terminal-lego`**; tool-use **`mcp-atlas`** /
**`enterprise-ops-gym`**; plus assorted math, lean, long-context, and
reasoning envs).
> 
> Upstream **`prime-envs`** changes bundled with this bump include
stripping v0 remnants, restoring solver network access for training
envs, fair-use solver prompts for SWE/terminal tasksets, MCP Atlas and
Enterprise Ops Gym running services in VMs, TMax hosting completion,
CI/eval CLI fixes, and related housekeeping—not new logic in this repo
beyond the dependency pin and lock refresh.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
75422004f320992e134a1d188368f15637bf8193. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-22 13:19:08 -07:00
Mika SenghaasandGitHub 9aa8563eae fix(inference): extend startup readiness timeout (#3626)
## Summary
- increase the default inference readiness timeout from 30 minutes to 60
minutes
- keep the direct `check_health` default aligned with `ClientConfig`

Large models can exceed 30 minutes on a cold node while vLLM compiles
architecture-specific kernels and captures CUDA graphs. The previous
default can tear down an otherwise healthy launch just before readiness.

## Test plan
- `PYTHONPATH="$PWD/src:$PWD/packages/prime-rl-configs/src" pytest -q
tests/unit/orchestrator/test_clients.py` (10 passed)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Only increases startup wait defaults; no changes to auth, weight
updates, or runtime inference behavior once ready.
> 
> **Overview**
> Raises the default **inference pool startup wait** from 30 to **60
minutes** so cold starts (e.g. vLLM kernel compile and CUDA graph
capture on large models) are less likely to fail right before `/health`
succeeds.
> 
> The change updates `ClientConfig.wait_for_ready_timeout` in shared
config and the default `timeout` on `check_health`, keeping orchestrator
health polling aligned with the config default used by
`AdminPlane.wait_for_ready`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f9fdfe25be6d643d43e830121bf22b6a9bd036c1. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-22 11:58:23 -07:00
Mika SenghaasandGitHub a44dc3572c feat(inference): configurable vLLM router request timeout (#3620)
## Summary

- Add `VllmRouterConfig.request_timeout_secs` (**default 1800 — the
router's own built-in default**, `ge=1`): the maximum lifetime of a
routed request, including streamed completions.
- Wire it through both router launch paths — the Python entrypoint
(`--request-timeout-secs`) and the `_launch_router.sh.j2` template. When
unset, the router behaves exactly as before.
- Long agentic rollouts set it explicitly, e.g. `request_timeout_secs =
3600` for one-hour SWE eval requests.

## Note on "no timeout"

The Rust router applies the value as its HTTP client's **total request
timeout unconditionally** (`server.rs`,
`.timeout(Duration::from_secs(...))`): plain `u64`, no disable sentinel,
and `0` would be an *immediate* timeout. So "no timeout" is not
expressible — a finite configurable value with the upstream default is
the right shape.

## Validation

- `VllmRouterConfig` default (`1800`) / set (`3600`) / `ge=1` rejection
all verified; both launch paths interpolate the same field (the template
already receives the `router` config object).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Operational tuning of router HTTP client timeouts only; no auth or
data-path changes, though misconfigured values could still cut off or
hang long requests.
> 
> **Overview**
> Adds **`request_timeout_secs`** on **`VllmRouterConfig`** (default
**1800s**, minimum 1) so the maximum lifetime of a routed
request—including streamed completions—can be set from inference config
instead of relying on implicit router defaults.
> 
> Both managed router launch paths now pass
**`--request-timeout-secs`**: the local **`start_router`** entrypoint
and the SLURM **`_launch_router.sh.j2`** template read
**`router.request_timeout_secs`**. Long agentic or eval rollouts can
raise the value (e.g. via config override) without patching launch
scripts.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
adf7321a3604f2fc784ab961688a281ab6002165. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-21 16:22:12 -07:00
Mika SenghaasandGitHub 32f4f40f9e feat(orchestrator): unified taskset shuffle for train and eval sources (#3622)
## Summary

- `EnvConfig.shuffle` (`bool`, default `False`): shuffle the source's
finite taskset **once at startup** with a fixed seed
(`TASKSET_SHUFFLE_SEED = 42`).
- Defined in one place — `EnvConfig`, the shared base — so both
`TrainSourceConfig` and `EvalSourceConfig` inherit it: one knob covers
RL train envs, RL/SFT online evals, and standalone evals. Train
curricula and eval example selection both consume the shuffled order.
- Infinite tasksets reject `shuffle` at startup with a clear error.
- The eval resume allowlist now overrides `source.*.shuffle` (fixed seed
⇒ deterministic across resume).

```toml
[[train.source]]           # or [[eval.source]]
shuffle = true
```

Mirrors the existing SFT-data convention (`shuffle: bool` + fixed seed).

## Validation

- `pytest tests/unit/orchestrator/ tests/unit/eval/
tests/unit/test_configs.py` — 288 passed, 1 skipped.
- Smoke: `TrainSourceConfig(..., shuffle=True)` and
`EvalSourceConfig(..., shuffle=True)` both parse; default is `False`;
resume allowlist updated.
- **Manual eval-selection run (real `Env.start()` path, gsm8k,
`num_examples = 50` of 1319 test tasks; only the env-server network
handshake stubbed — no GPU on the validating node):**
- `shuffle = false`, run 1 → `[0, 1, 2, ..., 49]` (natural source order)
- `shuffle = true`, run 1 → `[588, 1214, 57, 906, 1252, 618, 599, 289,
...]`
- `shuffle = true`, run 2 → identical to run 1 (same 50 tasks, same
order) ✔ reproduces
  - `shuffle = false`, run 2 → identical to run 1 ✔ off is stable
- off vs on selections differ (set overlap 2/50, as expected for a
random 50-of-1319 subset) ✔

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Behavior is opt-in with a fixed seed and only affects task ordering at
startup; infinite tasksets are explicitly rejected.
> 
> **Overview**
> Adds a **`shuffle`** flag on shared **`EnvConfig`** (default
**`false`**) so train and eval sources can reorder a **finite** taskset
once at env startup instead of always taking tasks in source order.
> 
> When **`shuffle=true`**, the orchestrator materializes the taskset and
shuffles it with a fixed seed (**`TASKSET_SHUFFLE_SEED = 42`**), so the
same permutation holds for the whole run and eval example selection
stays reproducible. **Infinite** tasksets fail fast with a clear error.
> 
> Eval **resume** may override **`source.*.shuffle`** alongside other
rollout knobs. New unit tests cover default order, changed selection,
reproducibility, full-taskset selection, and the infinite-taskset
rejection.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
8358483c1144ed331f575a5e857fabe390de50c8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-21 16:20:06 -07:00
Mika SenghaasandGitHub ef07764841 feat(sft): per-row reasoning_effort renderer override (#3621)
## Summary

- A `reasoning_effort` column in the dataset overrides the `[renderer]`
config's `reasoning_effort` field **per row**, so one SFT run can mix
reasoning efforts with the configured renderer serving as the default
for rows that do not set one (or set null).
- Requires a typed renderer config that has the field: `renderer.name =
"auto"` and field-less renderers raise a clear `ValueError`. Renderer
configs are frozen, so resolved configs are cached and rows resolving to
the same config share one renderer instance.
- Doc paragraph in `docs/training.md`; dataloader and sft-dataset tests
updated.

```toml
[renderer]
name = "glm-5.3"          # typed renderer; reasoning_effort = "max" is the row default
# dataset rows may carry reasoning_effort = "low" | "high" | "max" per row
```

## Validation

- `pytest tests/unit/train/sft/` — 47/47 pass.
- E2E with the real GLM-5.3 renderer: rendered prompts carry the per-row
effort preamble (`Reasoning Effort: Low` vs `Max`), invalid efforts
rejected by the config `Literal`, `None` rows fall back to the
configured renderer, and the resolver caches one renderer per distinct
config.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Changes are confined to SFT tokenization/renderer selection with
explicit validation for auto or unsupported renderers; misconfiguration
fails at load time rather than silently wrong training.
> 
> **Overview**
> SFT can now **mix reasoning efforts in one run** via an optional
dataset **`reasoning_effort`** column that overrides the typed
`[renderer]` config per row; null/missing values keep the TOML default.
> 
> **`RendererResolver`** (in `data.py`) builds and **caches** renderers
from `renderer_config` + row overrides instead of a single shared
renderer. **`SFTDataset`** takes a per-example renderer callable;
**`setup_dataset`** / **`train.py`** pass **`renderer_config`** and the
VLM **processor** rather than constructing one renderer up front (train
and validation use the same path).
> 
> Docs in **`training.md`** describe the column, typed-renderer
requirement, and supported model families. Unit tests were updated to
pass `lambda _: renderer` into **`SFTDataset`**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3408b9918dccf06d86ab732faa94a18f6233ca31. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-21 16:20:00 -07:00
7745c669d1 feat(monitors): attach eval runs to a platform-created evaluation (#3619)
## Summary

`PrimeEvalMonitor` attaches to an existing platform evaluation when
`$PRIME_RUNS_EVAL_ID` is set, instead of always registering a new one.
This mirrors how `PrimeTrainMonitor` already attaches to `$RUN_ID`.

Why: A hosted evaluation is created by the platform before its sandbox
starts: the platform owns billing, secrets, timeouts, cancellation and
the final "did every episode reach the platform" check, and it hands the
sandbox the evaluation's id, which the monitor reads from
`$PRIME_RUNS_EVAL_ID`. Today `uv run eval --monitors.prime` inside that
sandbox would call `pr.init(kind="eval", ...)` without an id, register a
second evaluation and leave the platform's one open forever.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes platform eval registration lifecycle for hosted runs;
misconfiguration (multiple sources or multiple epochs) fails fast with
explicit errors.
> 
> **Overview**
> **Hosted eval sandboxes** can now stream to an evaluation the platform
already created instead of registering a duplicate that leaves the
platform run orphaned.
> 
> When **`PRIME_RUNS_EVAL_ID`** is set, `PrimeEvalMonitor` calls
`pr.init` with that **`id`** (same attach pattern as training’s
**`$RUN_ID`**). Init requires **exactly one** eval source, and
**`open`** rejects a second epoch so one injected id maps to one epoch.
Logs note attachment when **`run.attached`** is true.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b4af11c50eb8201cbaf1b9a903b245a1bb8ed76e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 15:23:56 -07:00
87c5456806 chore(deps): bump vLLM to 0.29.0 (#3617)
Bumps vLLM from 0.28.0 to 0.29.0 and reconciles prime-rl's runtime
monkeypatches with 0.29's reorganized entrypoint layout. Three patches
are now obsolete and removed, each backed by a merged upstream PR.

- Rebound the API server layer onto `vllm.entrypoints.launchers.*`: on
0.29 the old `openai.api_server` path is a deprecation shim, so without
this the custom routes and the `PrimeRlServingTokens` swap would
silently not install.
- Dropped `monkey_patch_fp32_lm_head`: vLLM does the fp32 lm_head
projection natively via `head_dtype`
([#48390](https://github.com/vllm-project/vllm/pull/48390), LoRA path
[#48525](https://github.com/vllm-project/vllm/pull/48525)), so
`enable_fp32_lm_head` now injects `hf_overrides = {"head_dtype":
"float32"}`.
- Dropped the `PrimeRlServingTokens.serve_tokens` `kv_transfer_params`
bridge: upstream threads the params into the engine itself as of
[#42644](https://github.com/vllm-project/vllm/pull/42644), which landed
after the 0.28.0 cut.
- Dropped `monkey_patch_qwen3_coder_param_newline_trim`: upstream
restored the single-newline trim in
[#48846](https://github.com/vllm-project/vllm/pull/48846), making the
patch a byte-for-byte no-op.
- #48390 and #48846 already shipped in 0.28.0, so 0.29's role is to make
`fp32_lm_head` *fatal* via the new positional `skip_gather`; only #42644
is genuinely unlocked by the bump.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 15:36:25 -04:00
12b4d4b050 chore: whitelist the Environments Hub index for uv installs (#3612)
## Summary

- Add an explicit `[[tool.uv.index]]` named `prime-hub` for
`https://hub.primeintellect.ai/primeintellect/simple/` with
`exclude-newer = false`. Hub wheels carry no upload time, so the repo's
7-day `exclude-newer` cooldown filtered all of them out.
- `uv pip install gsm8k --index prime-hub` and `uv add gsm8k --index
prime-hub` now resolve inside prime-rl. The index is `explicit`, so `uv
sync` never consults it and `uv lock --check` passes unchanged.

Only the named index inherits the setting: passing the same URL via
`--extra-index-url` still hits the cooldown (uv matches index config by
name). Other Hub owners need their own entry or `--no-config`.

Verified in a fresh checkout: `uv lock --check`, slim `uv sync`, then
install through `--extra-index-url` (rejected), `--index prime-hub`
(0.1.4 installed), and the per-environment install index (rejected).

Companion: PrimeIntellect-ai/prime#934 (`prime eval run` installs Hub
environments into a prime-rl sandbox; it uses `--no-config` so any owner
works).

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Dependency-index configuration only; narrows the exclude-newer bypass
to an explicit, opt-in first-party index without changing default sync
behavior.
> 
> **Overview**
> Adds a named **`prime-hub`** uv index pointing at the Environments Hub
with **`exclude-newer = false`**, so Hub wheels (which lack upload
timestamps) are no longer blocked by the repo-wide **7-day**
`exclude-newer` policy.
> 
> The index is **`explicit`**, so default **`uv sync`** / lock checks
stay unchanged; Hub packages resolve only when you opt in (e.g. **`uv
add gsm8k --index prime-hub`**). Passing the same URL via
**`--extra-index-url`** still applies the global cooldown because uv
matches index settings by configured name, not raw URL.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ac034977bbf2a54ef2977314fc87a9d2f6b1b5f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 10:51:06 -07:00
JannikStandGitHub 64a0decfaa improvement(docker): bake the dashboard extra into the cuda image (#3613)
### What & why

The prime-rl-fft chart runs a standalone read-only dashboard pod per
release (prime-rl-fft #75) that serves prime-rl's run dashboard (`uv run
dashboard`, port 7788) off the run's shared PVC. The chart image does
not include the `dashboard` extra (fastapi/uvicorn), so the pod
previously installed it at start with `uv sync --inexact` — which hangs
on some clusters, leaves the Deployment permanently unready, and times
out the whole release's helm `--wait` readiness gate after 90m, killing
every trainer/inference/orchestrator pod regardless of their own health.
The dashboard was disabled by default as a stopgap (prime-rl-fft #86).

This bakes the `dashboard` extra directly into the cuda image so the
dashboard pod serves straight from the image with no runtime install.

### Changes
- `Dockerfile.cuda`: add `--extra dashboard` to both `uv sync` calls
(third-party deps layer + first-party source layer).

### Notes
- `fastapi` + `uvicorn` are a few MB next to the ~20 GB GPU venv;
negligible size impact.
- Both syncs use `--locked` and `uv.lock` already resolves the
`dashboard` extra — no lockfile changes.
- Follow-ups (fft chart repo, separate PRs): drop the pod-start `uv sync
--inexact` command and re-enable the dashboard by default; expose it to
the platform backend over the tailnet.

### Testing
- No runtime code touched; image CI builds the image from this branch.
- `uv lock --check` equivalent verified: lock already contains the
dashboard extra deps with markers.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Build-only Dockerfile change that adds two small locked deps to the
venv; no application or runtime behavior changes in this repo.
> 
> **Overview**
> **Bakes the `dashboard` optional extra (FastAPI + Uvicorn) into the
CUDA Docker image** so Helm FFT chart dashboard pods can run `uv run
dashboard` from the image without a startup `uv sync`.
> 
> Both dependency install steps in `Dockerfile.cuda` now pass `--extra
dashboard` alongside the existing GPU/flash-attn extras, with a short
comment tying this to the chart dashboard pod. Lockfile is unchanged;
syncs stay `--locked`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
78fecdd68099796469bc2cecce1ad10142d9a76c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-21 09:27:47 -07:00
samsjaandGitHub a1822f7a0a feat: default enable_ep_weight_filter to true (#3608)
## What

- Adds a typed `inference.vllm.enable_ep_weight_filter` field defaulting
to `true`, so every vLLM server prime-rl launches now passes
`--enable-ep-weight-filter` (previously this flag only appeared as an
explicit pass-through in the GLM-5.3 advanced examples).
- Drops the now-redundant explicit `enable_ep_weight_filter = true` from
the GLM-5.3 examples (`examples/advanced/glm-5.3/swe.toml`,
`examples/advanced/glm-5.3/infer/pd-llmd.toml`).
- Asserts the default lands on the server namespace.

## Why

Under expert parallelism, vLLM's weight filter skips non-local
per-expert tensors **before** reading them from disk: each rank reads
only its own expert shard instead of the full checkpoint (experts are
~85-90% of MoE weight bytes). This cuts load I/O and startup time,
especially on shared storage.

The default is safe elsewhere — vLLM only activates the filter when the
model is MoE, `enable_expert_parallel` is on, and EPLB is off. It is a
silent no-op for dense models, fused-expert checkpoints (GPT-OSS style),
and EPLB runs. The repo pins `vllm>=0.28.0`, which has the flag.

Set `inference.vllm.enable_ep_weight_filter = false` to restore the old
behavior.

Note: #3604 relocates these GLM-5.3 examples to `configs/advanced/` and
its copies still carry the explicit line — drop it when rebasing on this
PR.

## Test plan

- `uv run pytest tests/unit/test_parsers.py tests/unit/test_configs.py`
- Verified `to_namespace()` emits `enable_ep_weight_filter=True` for a
real GLM-5.3 config, and that `--vllm.enable-ep-weight-filter false`
overrides it.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Behavior change is gated in vLLM to MoE + expert parallelism without
EPLB; dense models and other modes are no-ops, with an explicit config
escape hatch.
> 
> **Overview**
> **Expert-parallel MoE loads now opt into vLLM’s EP weight filter by
default**, via a typed `inference.vllm.enable_ep_weight_filter` field
(default `true`) that flows through `to_namespace()` to
`--enable-ep-weight-filter`. That lets each rank read only its local
expert shard at checkpoint load instead of full expert tensors, reducing
I/O and startup time when EP is on and EPLB is off.
> 
> The GLM-5.3 advanced TOML recipes **drop redundant**
`enable_ep_weight_filter = true` lines and rely on the default. A unit
test **asserts** the resolved server namespace includes
`enable_ep_weight_filter=True`. Set
`inference.vllm.enable_ep_weight_filter = false` to disable.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f26215dee423de2a19ec763106fd979183556cef. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-18 22:57:30 -07:00
samsjaandGitHub 8c2847721a chore(examples): glm-5.3 swe.toml base + swe-llmd.toml append, serve BF16 with vllm-side FP8 (#3607)
## What

Reworks the GLM-5.3 RL examples as a **base + append** pair instead of
two standalone configs, and moves both variants onto the shared
`GLM-5.3-BF16` checkpoint with vLLM-side online FP8 quantization:

- **`swe.toml`** — the base config, carrying all the params that used to
live only in `swe-llmd.toml` (r2e-gym train source under the `rlm`
harness, `deepgemm_fp8` trainer, `cp = 4` / `ep = 8`, 16 train + 16
disaggregated-P/D infer nodes) behind the default **`vllm-router`**.
Inference serves the same **`zai-org/GLM-5.3-BF16`** checkpoint the
trainer broadcasts; vLLM quantizes it to per-block FP8 online
(`quantization = "fp8_per_block"`) — no separate FP8 release checkpoint.
- **`swe-llmd.toml`** — now a small **append overlay**: llm-d router
(EPP scorer tuning), Mooncake KV offload, and run-identity swaps (run
name / W&B project / SLURM job / sandbox runtime label). Launch:

  ```bash
uv run rl @ examples/advanced/glm-5.3/swe.toml # vllm-router
uv run rl @ examples/advanced/glm-5.3/swe.toml @
examples/advanced/glm-5.3/swe-llmd.toml # llm-d + Mooncake
  ```

- **`README.md`** — documents the base/append split, the composed launch
command, and which FILL INs live where.

## Why

- Two nearly-identical 100+ line configs drifted apart; a base + `@`
overlay keeps the llm-d variant a true delta (router + KV offload) and
makes the router the only difference between runs.
- Serving `GLM-5.3-BF16` with online per-block FP8 matches the trainer's
broadcast target and removes the dependency on the official block-FP8
serving release for both variants.

## Validation

Both launch paths resolve and validate end-to-end with `rl --dry-run`
(resolved per-process configs + sbatch generation): the base launches
`vllm-router --policy sticky_least_loaded`; the composed run swaps in
the llm-d router (EPP + Envoy) and enables Mooncake KV offload. Overlay
list-replacement semantics verified — the composed run keeps exactly one
train source, with the runtime label swapped to `glm5-llmd`.

Infer pre-flight configs (`infer/pd.toml`, `infer/pd-llmd.toml`) are
untouched.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Changes are limited to example TOMLs and documentation; no runtime or
library code paths are modified.
> 
> **Overview**
> Reorganizes the GLM-5.3 RL examples so **`swe.toml` is the full base
stack** (r2e-gym / `rlm`, FP8 trainer, P/D inference behind
**`vllm-router`**, serving **`GLM-5.3-BF16`** with online block FP8) and
**`swe-llmd.toml` is a thin overlay** for llm-d router scorer tuning,
Mooncake KV offload, and sandbox runtime labels.
> 
> Most settings that previously lived only in `swe-llmd.toml` move into
`swe.toml`; the llm-d file drops trainer/orchestrator/deployment
duplication. The README is updated to describe **base vs append**
launches (`rl @ swe.toml` vs `rl @ swe.toml @ swe-llmd.toml`), moves
“FILL IN” and Mooncake tuning notes to the right file, and states that
**neither RL file ships `[ckpt]`** by default (overlay to add
checkpoints). The old **`swe.toml` train-source-less / SWE-bench-eval
plane is replaced** by this composable layout—not removed entirely.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c9d87a57a24248945b3035d1cb87dee2f8f66a1a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-18 19:48:22 -07:00
samsjaandGitHub 9dbe8b5fa0 fix: select GLM-5.3 renderer in examples (#3606)
## Summary
- configure both GLM-5.3 example runs to use the matching `glm-5.3`
renderer

Requires the GLM-5.3 renderer pinned by #3605.
2026-09-18 16:03:56 -07:00
samsjaandGitHub 819993faac chore: bump renderers for GLM-5.3 (#3605)
## Summary
- pin `deps/renderers` to the GLM-5.3 renderer implementation

Depends on PrimeIntellect-ai/renderers#156.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit 8c41fdb84cd8bbfa5f2b2fc97887da57fbf3ba40. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-18 15:40:49 -07:00
Mika SenghaasandGitHub d57c59f16a fix: do not abort on consecutive empty train batches (#3595)
## Summary

- Remove the run-level aborts on consecutive empty train batches:
- The orchestrator raised after 10 consecutive no-sample train batches.
`MAX_CONSECUTIVE_EMPTY_BATCHES` and its counter are gone; an empty batch
now logs a warning and is skipped.
- The train sink raised after 10 batch-equivalents of finalized groups
that shipped no payload. The tally now only throttles the warning
(`_warn_zero_output`); there is no abort.
- Keep both warnings, so a run with no training signal stays visible in
the logs. A dead curriculum, an all-equal reward sweep, or an
infrastructure outage now stalls the run instead of killing it.
- Update the one `docs/algorithms.md` sentence that described the abort.
## Verification

- `uv run pytest tests/unit/orchestrator -q`: 82 passed, 1 skipped. The
8 failures are pre-existing `torch`/`vllm` import errors in a no-extras
env and fail the same way on `main`.
- `ruff check` / `ruff format --check` pass on both changed files.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Behavior change is limited to error handling: runs no longer fail fast
on sustained empty training signal, which may hide config issues but
avoids killing jobs on benign stalls.
> 
> **Overview**
> **Removes run-killing guards** when training produces no shippable
data, so misconfigured curricula or transient all-zero-advantage groups
**stall with warnings** instead of crashing the orchestrator.
> 
> In **`orchestrator.py`**, the **10 consecutive empty-batch abort** is
gone: empty `TrainBatch` samples log *"skipping empty train batch"* and
return without advancing the step. **`train_sink.py`** keeps counting
zero-output finalized units but **`_warn_zero_output`** only emits
throttled warnings—no **`RuntimeError`** after 10 batch-equivalents.
> 
> **`docs/algorithms.md`** now says group-relative `group_size = 1`
empty batches are **skipped at runtime**, not aborted.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3160f47b861a2c9c6cb33fef4961336f9b6560e9. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-18 11:22:15 -07:00
Matej SirovatkaandGitHub c4a78d1134 fix: specialize FP8 indexer quantization constants (#3594)
Compiled GLM-5.3 training fails on its first forward pass because `eps`,
`fp8_min`, and `fp8_max` reach the FP8 indexer quantization kernel as
runtime FP64 scalars. Their arithmetic promotes the quantization result
to FP64, and Triton rejects the resulting conversion with `Unsupported
conversion from f64 to f8E4M3FN with rounding mode rtne`.

Mark these three fixed scalar arguments as `tl.constexpr` so Triton
specializes them at compile time.

Validation: reproduced the failure on an 8-node H200 BF16 trainer with
`torch.compile`, activation checkpointing/offloading, full CPU offload,
and SignSGD. With this patch, the first forward/backward pass and
optimizer update completed, and the trainer began broadcasting policy
v1. The 20-step verification run is still in progress. `git diff
--check` passes.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Single-line Triton signature change with no API or logic changes; only
affects compile-time specialization of fixed FP8 bounds.
> 
> **Overview**
> Fixes **compiled training crashes** on the first forward pass when the
FP8 indexer quantizes activations under `torch.compile`.
> 
> The Triton kernel `_per_token_group_quant_fp8` now treats **`eps`,
`fp8_min`, and `fp8_max` as `tl.constexpr`** instead of runtime
arguments. Previously those scalars promoted quant math to FP64, and
Triton failed converting the result to FP8 (`f64` → `f8E4M3FN`).
Specializing them at compile time keeps the quant path in types Triton
can lower correctly; callers still pass the same module-level `FP8_EPS`
/ `FP8_MIN` / `FP8_MAX` constants.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
02f155d8ffb8776346c320be42a6be1f1f5299e9. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-18 13:12:13 +02:00
34 changed files with 425 additions and 502 deletions
+3 -2
View File
@@ -94,9 +94,10 @@ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
# Third-party deps only — source edits don't bust this layer. First-party
# editables install in the source-layer sync below. No build-context bind
# mount here: .git would bust the cache every commit.
# `--extra dashboard` (fastapi/uvicorn) is baked in so the fft chart's dashboard pod needs no runtime uv sync (see PR body).
COPY --from=manifests /manifests /app
RUN --mount=type=cache,target=/usr/local/share/uv/cache \
uv sync --all-packages --extra gpu --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
uv sync --all-packages --extra gpu --extra dashboard --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
--no-install-workspace \
--no-install-package prime-rl-configs \
--no-install-package verifiers \
@@ -132,7 +133,7 @@ RUN --mount=type=cache,target=/usr/local/share/uv/cache \
&& \
sed -i "s/fallback-version = \"0.0.0\"/fallback-version = \"${RENDERERS_PRETEND_VERSION}\"/" /app/deps/renderers/pyproject.toml \
&& \
uv sync --all-packages --extra gpu --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
uv sync --all-packages --extra gpu --extra dashboard --extra flash-attn --extra flash-attn-3 --extra flash-attn-cute --extra disagg --extra quack --extra kernels --group mamba-ssm --locked --no-dev \
&& \
/app/.venv/bin/python -c 'from importlib.metadata import version; [version(name) for name in ("deep-ep", "deep-gemm", "mamba-ssm", "nixl", "prime-kernels", "quack-kernels", "vllm", "vllm-router")]'
+1 -1
+1 -1
View File
@@ -112,7 +112,7 @@ patterns = ["WARNING"]
def drop_warnings(rollout, *, patterns: list[str]) -> list[list[bool]]: ...
```
Component compatibility is validated at config time: frozen-model sampling can only feed the `ce` loss component — the `rl` and `ref_kl` components need the live policy's own sampling logprobs for importance ratios — `opd` pointed at `"policy"` is rejected as degenerate (zero KL), `sft` without a frozen source is rejected (CE on the policy's own tokens is not a distillation target). A group-relative algorithm with `group_size = 1` produces all-zero advantages; the resulting empty batch is caught at runtime (the orchestrator warns and aborts after repeated zero-trainable batches), not at config time.
Component compatibility is validated at config time: frozen-model sampling can only feed the `ce` loss component — the `rl` and `ref_kl` components need the live policy's own sampling logprobs for importance ratios — `opd` pointed at `"policy"` is rejected as degenerate (zero KL), `sft` without a frozen source is rejected (CE on the policy's own tokens is not a distillation target). A group-relative algorithm with `group_size = 1` produces all-zero advantages; the resulting empty batch is caught at runtime (the orchestrator warns and skips it), not at config time.
### Per-Env Algorithms
+1 -1
View File
@@ -287,7 +287,7 @@ On the CLI the same keys are available as `--inference.vllm.max-num-seqs 256` (o
Router replay works by capturing the expert routing decisions into a buffer. This buffer then gets sent to the trainer, which can use it instead of re-computing the routing. This lowers the trainer↔inference mismatch by an order of magnitude, resulting in more stable training.
To enable router replay, you can set `inference.vllm.enable_return_routed_experts = true`. vLLM 0.28 uses the V2 model runner for standard deployments. Disaggregated P/D remains on V1 because NIXL routed-expert stitching is V1-only.
To enable router replay, you can set `inference.vllm.enable_return_routed_experts = true`. vLLM 0.29 uses the V2 model runner for standard deployments. Disaggregated P/D remains on V1 because NIXL routed-expert stitching is V1-only.
```toml
[trainer]
+2
View File
@@ -162,6 +162,8 @@ name = "qwen3"
enable_thinking = false
```
A `reasoning_effort` column in the dataset sets the renderer's `reasoning_effort` field per row, on top of the `[renderer]` config. The column requires a typed renderer that has that field (for example `gpt-oss`, `qwen3.8`, `deepseek-v4`); rows with a null value use the configured renderer unchanged. This lets one run mix reasoning efforts, with the `[renderer]` value as the default for rows that do not set one.
If a model needs another template control, add it to that model's renderer config in `renderers` (for example a new field on the relevant `*RendererConfig`) and consume it in the renderer implementation.
**Renderer-backed tokenization.** SFT tokenization is renderer-only. The [`renderers`](algorithms.md#renderers) package owns message-to-token conversion and loss attribution end-to-end, so position-dependent chat templates (for example templates that strip past `<think>` blocks across user turns) do not corrupt the loss mask. `[renderer]` defaults to `name = "auto"`; set a typed renderer config only when you need model-specific template controls. Hand-coded renderers ship for Qwen3, Qwen3.5, GLM-5, GLM-4.5, Kimi K2/K2.5, MiniMax M2, DeepSeek V3, Nemotron 3, GPT-OSS, and VLM families such as Qwen3-VL/Qwen3.5.
+15 -16
View File
@@ -1,18 +1,18 @@
# GLM-5 family at scale
Large-scale RL and serving for the GLM-5 family — including `zai-org/GLM-5.3-BF16` for training and its `GLM-5.3` block-FP8 serving release — at 131k context: 16 trainer nodes on the custom MoE implementation (expert parallelism; the llm-d variant adds context parallelism) and P/D-disaggregated FP8 inference. The `-llmd` variants front the inference plane with the [**llm-d**](https://llm-d.ai) router (Endpoint Picker + Envoy): its `active-request-scorer` load-balances in flight — instead of reacting to delayed metrics like the default `vllm-router` — which, combined with prefix-cache affinity for grouped rollouts, keeps prefill and decode ranks evenly loaded under RL's bursty request pattern. They also offload KV to a Mooncake distributed CPU pool (1TB per node by default).
Large-scale RL and serving for the GLM-5 family — `zai-org/GLM-5.3-BF16` for training and serving alike, quantized to per-block FP8 online on the vLLM side — at 131k context: 16 trainer nodes on the custom MoE implementation (expert + context parallelism) and P/D-disaggregated FP8 inference. The [`swe-llmd.toml`](swe-llmd.toml) append fronts the same inference plane with the [**llm-d**](https://llm-d.ai) router (Endpoint Picker + Envoy): its `active-request-scorer` load-balances in flight — instead of reacting to delayed metrics like the default `vllm-router` — which, combined with prefix-cache affinity for grouped rollouts, keeps prefill and decode ranks evenly loaded under RL's bursty request pattern. It also offloads KV to a Mooncake distributed CPU pool (1TB per node by default).
| Config | What it runs | Topology |
|---|---|---|
| [`swe.toml`](swe.toml) | GLM-5 RL plane: 16 train nodes, eval on `swebench-verified` every 20 steps, default vLLM router over 2 P/D replicas (4 prefill + 4 decode nodes each). Declares **no train source** — compose yours on top with an `[[orchestrator.train.source]]` overlay. | 16 train + 16 infer nodes |
| [`swe-llmd.toml`](swe-llmd.toml) | Full-stack GLM-5.3 RL: trains on `r2e-gym` (`rlm` harness), FP8-quantized trainer (`deepgemm_fp8` MoE compute), llm-d router + Mooncake KV offload. | 16 train + 16 infer nodes |
| [`swe.toml`](swe.toml) | Base GLM-5.3 RL: trains on `r2e-gym` (`rlm` harness), FP8-quantized trainer (`deepgemm_fp8` MoE compute), serves `GLM-5.3-BF16` with online per-block FP8 quantization behind the default `vllm-router`. | 16 train + 16 infer nodes |
| [`swe-llmd.toml`](swe-llmd.toml) | Append for `swe.toml`: swaps in the llm-d router (EPP scorer tuning) + Mooncake KV offload — launch as `rl @ swe.toml @ swe-llmd.toml`. | same |
| [`infer/pd.toml`](infer/pd.toml) | Inference-only pre-flight: P/D-disaggregated `GLM-5-FP8`. | 6 infer nodes |
| [`infer/pd-llmd.toml`](infer/pd-llmd.toml) | Inference-only pre-flight: `GLM-5.2-FP8` with llm-d + Mooncake. | 16 infer nodes |
## Requirements
- A Slurm cluster with 8-GPU nodes, a shared filesystem, and at least **32 nodes** (16 trainer + 16 inference) for the RL configs. This guide assumes the shared filesystem is mounted at `/shared` — adjust to your own path. If you have fewer nodes, drop `seq_len`, lower `num_train_nodes`, and reduce `cp` (llm-d variant) accordingly.
- InfiniBand/RDMA NICs for the Mooncake KV pool (llm-d variants).
- A Slurm cluster with 8-GPU nodes, a shared filesystem, and at least **32 nodes** (16 trainer + 16 inference) for the RL configs. This guide assumes the shared filesystem is mounted at `/shared` — adjust to your own path. If you have fewer nodes, drop `seq_len`, lower `num_train_nodes`, and reduce `cp` accordingly.
- InfiniBand/RDMA NICs for the Mooncake KV pool (llm-d append).
- **Sandboxes.** Rollout and eval agents run in sandboxes, wired for [Prime Intellect Sandboxes](https://docs.primeintellect.ai/sandboxes/overview) by default. If you use those, install the `prime` CLI separately and log in:
```bash
@@ -25,9 +25,9 @@ prime login # or: prime config set-api-key <your-key>
- Environment variables, exported in the shell you launch from — the launcher passes its environment to every component:
- `HF_TOKEN` — the GLM-5 family checkpoints are gated models.
- `WANDB_API_KEY` — both RL configs log to W&B (`[monitors.wandb]`).
- `WANDB_API_KEY` — both RL variants log to W&B (`[monitors.wandb]`).
### Install llm-d (llmd variants only)
### Install llm-d (llm-d append only)
The llm-d router ships as vendored binaries (`epp`, `envoy`, `pd-sidecar`). Build them once into `third_party/llmd/bin`:
@@ -48,21 +48,20 @@ uv sync --all-extras --all-packages
## Tweak before launching
- `swe-llmd.toml` marks two `# FILL IN` values: `output_dir` (point it at your shared filesystem) and `[slurm] partition`. `swe.toml` needs `--slurm.partition <your-partition>` or `--output-dir` overrides on the command line.
- `[inference.kv_cache_offload] device_name` — the RDMA NIC list for Mooncake. Auto-detection is unreliable; set it by hand from `nvidia-smi topo -m` on your nodes.
- `[inference.kv_cache_offload.cpu] num_bytes` — 1TB per node by default; lower it if your nodes have less RAM.
- `swe-llmd.toml` ships without `[ckpt]` — add a checkpoint overlay if you want resume support.
- `swe.toml` marks two `# FILL IN` values: `output_dir` (point it at your shared filesystem) and `[slurm] partition`.
- `swe-llmd.toml` `[inference.kv_cache_offload] device_name` — the RDMA NIC list for Mooncake. Auto-detection is unreliable; set it by hand from `nvidia-smi topo -m` on your nodes.
- `swe-llmd.toml` `[inference.kv_cache_offload.cpu] num_bytes` — 1TB per node by default; lower it if your nodes have less RAM.
## Start the run
The `rl` entrypoint submits an sbatch job whenever the config has a `[slurm]` table — there is no separate launcher. From the shared checkout:
```bash
# GLM-5.3 RL with llm-d + Mooncake (recommended)
uv run rl @ examples/advanced/glm-5.3/swe-llmd.toml
# GLM-5.3 RL behind the default vllm-router
uv run rl @ examples/advanced/glm-5.3/swe.toml
# GLM-5 base plane — compose your train source onto it
uv run rl @ examples/advanced/glm-5.3/swe.toml @ my-train-source.toml
# with the llm-d router + Mooncake KV offload appended
uv run rl @ examples/advanced/glm-5.3/swe.toml @ examples/advanced/glm-5.3/swe-llmd.toml
```
The inference configs are standalone pre-flights: they serve the FP8 checkpoint through the same entrypoint the trainer uses (`/update_weights`, `/load_lora_adapter`, `/init_broadcaster` included — never call `vllm serve` directly), and are a fast way to check that this cluster can serve the model at all before committing it to a run:
@@ -98,6 +97,6 @@ Pass several output directories to track parallel experiments side by side (`uv
## Checkpoint and resume
`swe.toml` checkpoints every 100 steps (`[ckpt] interval = 100`). To resume, re-run the same command with `--resume` (latest checkpoint) or `--resume.step <N>`, a stable `--run.name`, and a `--max-steps` at least the target final step. Trainer checkpoints are DCP-sharded; export HF-format weights with `tools/convert_dcp_to_bf16.py`. See [Training](../../../docs/training.md) for the full resume and export reference.
Both RL configs ship without `[ckpt]` — add a `[ckpt]` overlay (e.g. `interval = 100`) for periodic checkpoints. To resume, re-run the same command with `--resume` (latest checkpoint) or `--resume.step <N>`, a stable `--run.name`, and a `--max-steps` at least the target final step. Trainer checkpoints are DCP-sharded; export HF-format weights with `tools/convert_dcp_to_bf16.py`. See [Training](../../../docs/training.md) for the full resume and export reference.
See [Scaling](../../../docs/scaling.md) for SLURM details and [Inference](../../../docs/inference.md) for the disaggregated-inference and router reference.
@@ -60,5 +60,4 @@ reasoning_parser = "glm45"
gpu_memory_utilization = 0.75
enable_expert_parallel = true
enable_eplb = false
enable_ep_weight_filter = true
safetensors_load_strategy = "prefetch"
+14 -123
View File
@@ -1,54 +1,25 @@
max_steps = 10000000
seq_len = 131072
output_dir = "/shared/outputs" # FILL IN: point at your shared filesystem
clean = true
# llm-d append for swe.toml: fronts the P/D-disaggregated inference plane with
# the llm-d router (Endpoint Picker + Envoy) and offloads KV to a Mooncake
# distributed CPU pool. Everything else is inherited from the base config:
#
# uv run rl @ examples/advanced/glm-5.3/swe.toml @ examples/advanced/glm-5.3/swe-llmd.toml
[run]
name = "glm5-llmd"
[log]
level = "debug"
[monitors.wandb]
project = "glm5-llmd"
name = "base"
[weight_broadcast]
type = "nccl"
port = 29502
timeout = 12000
[slurm]
job_name = "glm5-llmd"
[deployment]
type = "multi_node"
num_train_nodes = 16
gpus_per_node = 8
num_infer_replicas = 1
[inference.deployment]
type = "disaggregated"
prefill_nodes_per_replica = 2
num_prefill_replicas = 4
decode_nodes_per_replica = 8
num_decode_replicas = 1
# skip warmup for faster start in cost of some jit overhead early
# ucx needs to be set else random segfaults, vllm can't autoset before importing for some reason
[inference.deployment.prefill_env_vars]
"VLLM_ENABLE_MOE_DP_CHUNK" = "0"
"VLLM_DEEP_GEMM_WARMUP" = "skip"
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
[inference.deployment.decode_env_vars]
"VLLM_DEEP_GEMM_WARMUP" = "skip"
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
# gives the most KV cache while keeping decent throughput, KV cache increase comes in from lower deep-ep LL static buffers
[inference.deployment.prefill_vllm_overrides]
"enable_dbo" = true
[inference.deployment.decode_vllm_overrides]
"max_num_batched_tokens" = 96
"max_num_seqs" = 96
# Overlays replace arrays of tables wholesale, so the train source is spelled
# out again just to swap the sandbox runtime label.
[[orchestrator.train.source]]
name = "r2e"
env.taskset.id = "r2e-gym"
env.agent.harness.id = "rlm"
env.agent.runtime.labels = ["glm5-llmd"]
[inference.router]
type = "llm-d"
@@ -67,86 +38,6 @@ non_cached_tokens = 128 # if <128 tokens, skip prefill go to decode immediately
"kv-cache-utilization-scorer" = 4.0
"queue-scorer" = 3.0
[inference.vllm]
# The trainer uses GLM-5.3-BF16; serve the official block-FP8 release.
model = "zai-org/GLM-5.3"
dtype = "bfloat16"
quantization = "fp8_per_block"
max_model_len = 131072
tool_call_parser = "glm47"
reasoning_parser = "glm45"
gpu_memory_utilization = 0.75
enable_expert_parallel = true
enable_eplb = false
enable_ep_weight_filter = true
safetensors_load_strategy = "prefetch"
[slurm]
job_name = "glm5-llmd"
partition = "all" # FILL IN: set to your cluster's partition
[trainer]
dist_timeout_seconds = 1800
[trainer.model]
name = "zai-org/GLM-5.3-BF16"
impl = "custom"
attn = "flash_attention_2" # ignored with GLM5
fused_lm_head_token_chunk_size = 1024
cp = 4 # context parallel for the 131K seq len
ep = 8
[trainer.model.quantization]
type = "fp8"
[trainer.model.moe.compute]
type = "deepgemm_fp8"
[trainer.model.ac]
freq = 1
[trainer.model.compile]
[trainer.model.ac_offloading]
max_inflight_activations = 1
[trainer.optim]
type = "adamw"
lr = 1e-6
weight_decay = 0.0
[orchestrator]
batch_size = 256
group_size = 16
max_off_policy_steps = 8 # 16/32 can be better, 8 is more CPU stable
[orchestrator.concurrency]
initial_inflight = 256
max_inflight = 512
[orchestrator.model]
name = "zai-org/GLM-5.3"
[orchestrator.renderer]
name = "glm-5.1"
clear_thinking = false
[orchestrator.train.sampling]
temperature = 1.0
[orchestrator.train.sampling.extra_body.chat_template_kwargs]
clear_thinking = false
[[orchestrator.train.source]]
name = "r2e"
env.taskset.id = "r2e-gym"
env.agent.harness.id = "rlm"
env.agent.runtime.labels = ["glm5-llmd"]
[inference]
# <0.80 because glm5 layers are too large for 0.85
use_deep_gemm = true
enable_fp32_lm_head = true
[inference.kv_cache_offload]
type = "mooncake"
# Auto Detection is funky, do it yourself from nvidia-smi topo -m
+84 -33
View File
@@ -1,13 +1,24 @@
seq_len = 131072
# Base GLM-5.3 RL config: P/D-disaggregated FP8 inference behind the default
# vllm-router. Serves the same GLM-5.3-BF16 checkpoint the trainer broadcasts,
# quantized to per-block FP8 online on the vLLM side. Append swe-llmd.toml to
# front the same plane with the llm-d router + Mooncake KV offload:
#
# uv run rl @ examples/advanced/glm-5.3/swe.toml @ examples/advanced/glm-5.3/swe-llmd.toml
[model]
name = "zai-org/GLM-5.3-BF16"
max_steps = 10000000
seq_len = 131072
output_dir = "/shared/outputs" # FILL IN: point at your shared filesystem
clean = true
[run]
name = "glm5"
[log]
level = "debug"
[monitors.wandb]
project = "glm5-pd-disag"
project = "glm5"
name = "base"
[weight_broadcast]
type = "nccl"
@@ -18,36 +29,71 @@ timeout = 12000
type = "multi_node"
num_train_nodes = 16
gpus_per_node = 8
num_infer_replicas = 2
num_infer_replicas = 1
[inference.deployment]
type = "disaggregated"
prefill_nodes_per_replica = 4
decode_nodes_per_replica = 4
prefill_nodes_per_replica = 2
num_prefill_replicas = 4
decode_nodes_per_replica = 8
num_decode_replicas = 1
# skip warmup for faster start in cost of some jit overhead early
# ucx needs to be set else random segfaults, vllm can't autoset before importing for some reason
[inference.deployment.prefill_env_vars]
"VLLM_ENABLE_MOE_DP_CHUNK" = "0"
"VLLM_DEEP_GEMM_WARMUP" = "skip"
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
[inference.deployment.decode_env_vars]
"VLLM_DEEP_GEMM_WARMUP" = "skip"
"UCX_RCACHE_MAX_UNRELEASED" = "1024"
# gives the most KV cache while keeping decent throughput, KV cache increase comes in from lower deep-ep LL static buffers
[inference.deployment.prefill_vllm_overrides]
"enable_dbo" = true
[inference.deployment.decode_vllm_overrides]
"max_num_batched_tokens" = 96
"max_num_seqs" = 96
[inference.router]
type = "vllm-router"
[inference.vllm]
# Serve the shared BF16 checkpoint above with online per-block FP8 quantization.
# Serve the same GLM-5.3-BF16 checkpoint the trainer broadcasts; vLLM quantizes
# it to per-block FP8 online.
model = "zai-org/GLM-5.3-BF16"
dtype = "bfloat16"
quantization = "fp8_per_block"
max_model_len = 131072
tool_call_parser = "glm47"
gpu_memory_utilization = 0.80
reasoning_parser = "glm45"
gpu_memory_utilization = 0.75
enable_expert_parallel = true
enable_eplb = false
safetensors_load_strategy = "prefetch"
[slurm]
job_name = "glm5-pd-disag"
[ckpt]
interval = 100
job_name = "glm5"
partition = "all" # FILL IN: set to your cluster's partition
[trainer]
dist_timeout_seconds = 7200
dist_timeout_seconds = 1800
[trainer.model]
name = "zai-org/GLM-5.3-BF16"
impl = "custom"
attn = "flash_attention_2" # dsa is skipping flash attn anyway
fused_lm_head_token_chunk_size = 2048
attn = "flash_attention_2" # ignored with GLM5
fused_lm_head_token_chunk_size = 1024
cp = 4 # context parallel for the 131K seq len
ep = 8
[trainer.model.quantization]
type = "fp8"
[trainer.model.moe.compute]
type = "deepgemm_fp8"
[trainer.model.ac]
freq = 1
@@ -56,35 +102,40 @@ freq = 1
[trainer.model.ac_offloading]
max_inflight_activations = 1
[trainer.ckpt]
skip_optimizer = true
[trainer.optim]
type = "adamw"
lr = 1e-6
weight_decay = 0.1
weight_decay = 0.0
[orchestrator]
batch_size = 4096
batch_size = 256
group_size = 16
max_off_policy_steps = 16
max_off_policy_steps = 8 # 16/32 can be better, 8 is more CPU stable
[orchestrator.concurrency]
initial_inflight = 4096
max_inflight = 8192
initial_inflight = 256
max_inflight = 512
[orchestrator.model]
name = "zai-org/GLM-5.3-BF16"
[orchestrator.renderer]
name = "glm-5.1"
name = "glm-5.3"
clear_thinking = false
[orchestrator.eval]
interval = 20
[orchestrator.train.sampling]
temperature = 1.0
[[orchestrator.eval.source]]
name = "swe-bench-verified"
env.taskset.id = "swebench-verified"
env.agent.harness.id = "bash"
env.agent.runtime.labels = ["glm5-pd-disag", "swe-bench-verified"]
[orchestrator.train.sampling.extra_body.chat_template_kwargs]
clear_thinking = false
[[orchestrator.train.source]]
name = "r2e"
env.taskset.id = "r2e-gym"
env.agent.harness.id = "rlm"
env.agent.runtime.labels = ["glm5"]
[inference]
# we need <0.85 bc glm5 layers are too large for 0.85
# <0.80 because glm5 layers are too large for 0.85
use_deep_gemm = true
enable_fp32_lm_head = true
@@ -132,6 +132,12 @@ class VllmConfig(BaseConfig):
enable_eplb: bool = False
"""Enable expert parallel load balancer (EPLB)."""
enable_ep_weight_filter: bool = True
"""Skip non-local expert weights at load time under expert parallelism, so each
rank reads only its own expert shard from disk. No-op for non-MoE models, when
expert parallelism is disabled, or under EPLB (redundant expert slots need all
logical expert weights)."""
enable_dbo: bool = False
"""Enable dual batch overlap (DBO)."""
@@ -305,6 +311,9 @@ class VllmRouterConfig(BaseConfig):
type: Literal["vllm-router"] = "vllm-router"
request_timeout_secs: int = Field(1800, ge=1)
"""Maximum lifetime of a routed request, including streamed completions."""
policy: str = "sticky_least_loaded"
"""Routing policy. Defaults to session-affine least-loaded routing; alternatives include ``consistent_hash`` and ``round_robin``."""
@@ -464,7 +473,7 @@ class InferenceConfig(BaseConfig):
"""Return per-token sampling masks (``sampling_mask``) on ``/inference/v1/generate`` responses via vLLM's native ``--return-sampling-mask`` (>= 0.28). The ``rl`` entrypoint enables this field for truncated policy sampling. Standalone inference must set it explicitly because no orchestrator sampling config is available. The field persists into per-node configs and selects the V2 model runner before vLLM starts. Capture is engine-wide: vLLM rejects requests with ``temperature <= 0`` or without ``top_k > 0`` while it is on."""
enable_fp32_lm_head: bool = True
"""Run the lm_head projection in fp32 via a native bf16×bf16 → fp32 GEMM (``torch.mm`` with ``out_dtype=torch.float32``). Stabilizes logprob precision under FP8/bf16 inference, matching SGLang's ``--enable-fp32-lm-head``. Implemented as a monkey-patch over vLLM's LogitsProcessor, activated by setting ``additional_config["fp32_lm_head"] = True`` on the vLLM config."""
"""Run the lm_head projection in fp32 via a native bf16×bf16 → fp32 GEMM (``torch.mm`` with ``out_dtype=torch.float32``). Stabilizes logprob precision under FP8/bf16 inference, matching SGLang's ``--enable-fp32-lm-head``. Implemented natively by vLLM's LogitsProcessor, which reads ``head_dtype`` off the HF config, so this flag injects ``hf_overrides = {"head_dtype": "float32"}``."""
enable_fp32_router_logits: bool = True
"""Emit fp32 MoE router logits: the bf16×bf16 gate GEMM writes its fp32 accumulator out unrounded instead of truncating logits to bf16 before expert scoring. Matches fp32-routed checkpoints (e.g. GLM-5.x, trained with Megatron ``--moe-router-dtype fp32``); pairs with ``trainer.model.moe_router_dtype = "float32"``. Implemented natively by vLLM, which reads ``moe_router_dtype`` off the HF config — this flag injects ``hf_overrides = {"moe_router_dtype": "float32"}`` (GLM-5.x gets fp32 routing regardless)."""
@@ -638,6 +647,13 @@ class InferenceConfig(BaseConfig):
hf_overrides.setdefault("moe_router_dtype", "float32")
namespace.hf_overrides = hf_overrides
# vLLM's LogitsProcessor reads `head_dtype` off the HF config to pick the
# lm_head projection dtype (fp32 runs as a native bf16xbf16 -> fp32 GEMM).
if self.enable_fp32_lm_head:
hf_overrides = getattr(namespace, "hf_overrides", None) or {}
hf_overrides.setdefault("head_dtype", "float32")
namespace.hf_overrides = hf_overrides
if self.enable_return_sampling_mask:
namespace.return_sampling_mask = True
@@ -645,12 +661,4 @@ class InferenceConfig(BaseConfig):
if kv_transfer_config is not None:
namespace.kv_transfer_config = kv_transfer_config
# Pass prime-rl-specific flags through vLLM's additional_config dict;
# workers read these via get_current_vllm_config().additional_config.
additional_config = getattr(namespace, "additional_config", None) or {}
if self.enable_fp32_lm_head:
additional_config["fp32_lm_head"] = True
if additional_config:
namespace.additional_config = additional_config
return namespace
@@ -166,6 +166,9 @@ class EnvConfig(BaseConfig):
name: str | None = None
"""Display name for this environment in logs, metrics, and buffer keys. Defaults to the taskset id. Must be unique across all envs in the same group."""
shuffle: bool = False
"""Shuffle the source's finite taskset once with a fixed seed. The shuffled order is fixed for the whole run; infinite tasksets cannot be shuffled."""
@model_validator(mode="before")
@classmethod
def _resolve_env(cls, data):
@@ -171,7 +171,7 @@ class DynamoConfig(BaseConfig):
class ClientConfig(BaseConfig):
wait_for_ready_timeout: int = 1800
wait_for_ready_timeout: int = 3600
"""Seconds to wait at startup for the inference pool to become ready."""
base_url: str = "http://localhost:8000/v1"
+12 -6
View File
@@ -56,7 +56,7 @@ gpu = [
"torchvision ; sys_platform == 'linux'",
"torchaudio ; sys_platform == 'linux'",
"torchdata>=0.11.0 ; sys_platform == 'linux'",
"vllm>=0.28.0 ; sys_platform == 'linux'",
"vllm>=0.29.0 ; sys_platform == 'linux'",
"mooncake-transfer-engine>=0.3.10.post2 ; sys_platform == 'linux'",
"ring-flash-attn>=0.1.8 ; sys_platform == 'linux'",
"torchtitan ; sys_platform == 'linux'",
@@ -146,7 +146,7 @@ override-dependencies = [
# Shared by vLLM, TileLang, and the pinned FlashAttention 4 runtime.
"apache-tvm-ffi==0.1.11",
"nvidia-cudnn-cu13>=9.15 ; sys_platform == 'linux'",
# vLLM 0.28.0 requires quack-kernels 0.6.4. It requires this exact CUTLASS version.
# vLLM 0.29.0 requires quack-kernels 0.6.4. It requires this exact CUTLASS version.
# Keep this pin aligned with quack-kernels and the flash-attn-4 revision below.
"nvidia-cutlass-dsl==4.6.2",
"transformers==5.6.2",
@@ -224,8 +224,6 @@ requires-dist = [
# verifiers pins harbor==0.21.0, published minutes inside the rolling window;
# bounded cutoff mirroring the one in deps/verifiers/pyproject.toml
harbor = "2026-08-11T00:00:00Z"
# we want latest vllm, remove next patch
vllm = false
tokenspeed-mla = false
fastokens = false
flash_attn_3 = false
@@ -273,8 +271,8 @@ vllm-router = [
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_aarch64.whl", marker = "platform_machine == 'aarch64'" },
]
vllm = [
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl", marker = "platform_machine == 'x86_64'" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl", marker = "platform_machine == 'aarch64'" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl", marker = "platform_machine == 'x86_64'" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl", marker = "platform_machine == 'aarch64'" },
]
deep-ep = [
{ url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.1/deep_ep-1.2.1+29d31c0-cp312-cp312-linux_x86_64.whl", marker = "platform_machine == 'x86_64'" },
@@ -310,6 +308,14 @@ name = "pytorch-cu130-test"
url = "https://download.pytorch.org/whl/test/cu130"
explicit = true
# Environments Hub wheels carry no upload time, so the exclude-newer cooldown
# would reject every one of them. The Hub is first-party: skip the cutoff there.
[[tool.uv.index]]
name = "prime-hub"
url = "https://hub.primeintellect.ai/primeintellect/simple/"
explicit = true
exclude-newer = false
[tool.ruff.lint]
select = ["F", "I"]
+2
View File
@@ -181,6 +181,8 @@ def start_router(config: InferenceConfig) -> subprocess.Popen:
str(config.vllm.data_parallel_size_local or config.vllm.data_parallel_size),
"--request-id-headers",
"x-session-id",
"--request-timeout-secs",
str(config.router.request_timeout_secs),
"--worker-startup-timeout-secs",
"4200",
"--prometheus-port",
+1
View File
@@ -40,6 +40,7 @@ RESUMABLE = (
"log",
"monitors",
"source.*.num_examples",
"source.*.shuffle",
"source.*.group_size",
"source.*.serve",
)
+2 -114
View File
@@ -15,7 +15,6 @@ def apply_shared_vllm_patches():
_patch_lora_key_prefix()
_patch_qwen35_moe_lora_format()
monkey_patch_nano_v3_reasoning_parser()
monkey_patch_qwen3_coder_param_newline_trim()
monkey_patch_minimax_m2_think_end_passthrough()
monkey_patch_return_routed_experts_with_nixl_connector()
monkey_patch_kv_xfer_finished_tolerate_freed()
@@ -248,57 +247,6 @@ def monkey_patch_nano_v3_reasoning_parser():
ReasoningParserManager.register_module("nano_v3", module=NanoV3ReasoningParser)
def monkey_patch_qwen3_coder_param_newline_trim():
"""Restore vLLM 0.23's single-newline trim for qwen3_coder tool parameters.
vLLM 0.24's parser engine applies a full ``.strip()`` to every parameter
value in ``_qwen3_arg_converter``; 0.23's ``Qwen3CoderToolParser`` trimmed
exactly one leading and one trailing newline. A full strip corrupts
whitespace-significant string parameters (str_replace-style
``old_str``/``new_str``, file content with an indented first line, values
with intentional trailing newlines), silently changing tool execution and
rewards for agentic runs. Copy of ``_qwen3_arg_converter`` with only the
trim changed. Also covers ``nemotron_v3``, which reuses ``qwen3_config``.
"""
import json
from vllm.parser import qwen3
def _trim_one_newline(value: str) -> str:
if value.startswith("\n"):
value = value[1:]
if value.endswith("\n"):
value = value[:-1]
return value
def _patched_arg_converter(raw_args: str, partial: bool) -> str:
params: dict[str, object] = {}
for match in qwen3._PARAM_RE.finditer(raw_args):
name = match.group(1)
value = match.group(2)
## START PATCHED CODE (upstream: value.strip())
params[name] = _trim_one_newline(value)
## END PATCHED CODE
if partial:
remaining = qwen3._PARAM_RE.sub("", raw_args)
m = qwen3._PARTIAL_PARAM_RE.search(remaining)
if m:
name = m.group(1)
value = m.group(2)
if name:
## START PATCHED CODE (upstream: value.strip())
params[name] = _trim_one_newline(value)
## END PATCHED CODE
return json.dumps(params, ensure_ascii=False)
qwen3._qwen3_arg_converter = _patched_arg_converter
# qwen3_config captures the converter when first built; drop any cached configs.
qwen3.qwen3_config.cache_clear()
def monkey_patch_minimax_m2_think_end_passthrough():
"""Keep the literal ``</think>`` in MiniMax-M2 content on tool-calling turns.
@@ -757,68 +705,6 @@ def monkey_patch_no_moe_lora():
FusedMoEConfig.__post_init__ = _patched__post_init__
def monkey_patch_fp32_lm_head():
"""Run the lm_head projection in fp32, via a native bf16xbf16 -> fp32 GEMM.
Uses ``torch.mm(..., out_dtype=torch.float32)`` (PyTorch >= 2.10) so the
matmul accumulates and emits fp32 directly without zero-padding the bf16
operands or maintaining a separate fp32 weight copy. This avoids the
epilogue truncation to bf16 that `F.linear(bf16, bf16)` does, which is
where lm_head precision actually leaks before the sampler's softmax.
Activated by setting ``additional_config["fp32_lm_head"] = True`` on the
vLLM namespace; the launcher does this when ``inference.enable_fp32_lm_head``
is set. The flag is captured once on ``LogitsProcessor.__init__`` (where
vLLM guarantees a ``set_current_vllm_config()`` context) and stored on the
instance — reading it from ``_get_logits`` during serving doesn't work
because vLLM doesn't keep the context set during forwards.
Tracks vllm-project/vllm#24567 (which uses the operand-upcast approach).
Per @Jackmin801 on PR #2438, native ``out_dtype=fp32`` mm is more efficient
and just as correct.
"""
import torch
from vllm.config import get_current_vllm_config
from vllm.logger import init_logger
from vllm.model_executor.layers.logits_processor import LogitsProcessor
logger = init_logger(__name__)
_original_init = LogitsProcessor.__init__
_original_get_logits = LogitsProcessor._get_logits
def _patched_init(self, *args, **kwargs):
_original_init(self, *args, **kwargs)
vllm_config = get_current_vllm_config()
additional_config = vllm_config.additional_config or {}
self._fp32_lm_head_enabled = additional_config.get("fp32_lm_head", False)
if self._fp32_lm_head_enabled:
logger.warning("fp32 lm_head ENABLED for this LogitsProcessor instance.")
def _patched_get_logits(self, hidden_states, lm_head, embedding_bias):
if not getattr(self, "_fp32_lm_head_enabled", False):
return _original_get_logits(self, hidden_states, lm_head, embedding_bias)
# Native bf16xbf16 -> fp32 GEMM. torch.mm requires 2D inputs; vLLM v1's
# generative path passes 2D [num_tokens, hidden_size] hidden_states, but
# flatten defensively in case some future caller passes 3D.
flat = hidden_states.reshape(-1, hidden_states.shape[-1])
logits = torch.mm(flat, lm_head.weight.t(), out_dtype=torch.float32)
if embedding_bias is not None:
logits = logits + embedding_bias.to(torch.float32)
if hidden_states.dim() > 2:
logits = logits.reshape(*hidden_states.shape[:-1], -1)
logits = self._gather_logits(logits)
if logits is not None:
logits = logits[..., : self.org_vocab_size]
return logits
LogitsProcessor.__init__ = _patched_init
LogitsProcessor._get_logits = _patched_get_logits
logger.info("Installed fp32 lm_head patch (native out_dtype=fp32 mm).")
def monkey_patch_dp_coordinator_startup_timeout():
"""Raise the DP coordinator startup timeout from vLLM's hard-coded 120s.
@@ -935,6 +821,8 @@ def monkey_patch_deepseek_v4_per_layer_rope():
Note that nothing in vLLM's DeepSeek V4 calls the module's `forward`; every consumer reads
`cos_sin_cache` and hands it to a fused kernel. The class choice is therefore about the
cache's dtype and row count, not about which channels the module would rotate.
Remove this patch once the pin includes vllm-project/vllm#54815, which ships in 0.29.1.
"""
from vllm.models.deepseek_v4.common import rope as dsv4_rope
+10 -10
View File
@@ -6,10 +6,10 @@ from fastapi import APIRouter, Request
from fastapi.responses import JSONResponse
from starlette.datastructures import State
from vllm.engine.protocol import EngineClient
from vllm.entrypoints.openai.api_server import init_app_state
from vllm.entrypoints.openai.cli_args import make_arg_parser, validate_parsed_serve_args
from vllm.entrypoints.openai.engine.protocol import ErrorResponse
from vllm.entrypoints.launchers.api_server.app_state import init_app_state
from vllm.entrypoints.launchers.cli_args import make_arg_parser, validate_parsed_serve_args
from vllm.entrypoints.openai.models.serving import OpenAIServingModels
from vllm.entrypoints.serve.engine.protocol import ErrorResponse
from vllm.entrypoints.serve.lora.protocol import LoadLoRAAdapterRequest
from vllm.logger import init_logger
from vllm.utils.argparse_utils import FlexibleArgumentParser
@@ -26,7 +26,7 @@ from prime_rl.inference.patches import (
)
# NOTE: Monkeypatch TokenizeParams to fix overly conservative validation
# Still needed in vLLM 0.28 — upstream rejects prompt_len > max_model_len - max_tokens
# Still needed in vLLM 0.29 — upstream rejects prompt_len > max_model_len - max_tokens
monkey_patch_tokenize_params_validation()
# NOTE: Register Nano V3 reasoning parser so configs can use
# `reasoning_parser = "nano_v3"` without a vLLM plugin file.
@@ -42,7 +42,7 @@ monkey_patch_strip_routed_experts_from_chat()
# weights concurrently (multi-node disaggregated deployments).
monkey_patch_dp_coordinator_startup_timeout()
logger = init_logger("vllm.entrypoints.openai.api_server")
logger = init_logger("vllm.entrypoints.launchers.api_server.entry")
# Create our own router for custom endpoints
router = APIRouter()
@@ -176,9 +176,9 @@ async def custom_init_app_state(
state.serving_tokens = prime_serving
import vllm.entrypoints.openai.api_server
import vllm.entrypoints.launchers.api_server.entry
import vllm.v1.utils
from vllm.entrypoints.openai.api_server import build_app as _original_build_app
from vllm.entrypoints.launchers.app import build_app as _original_build_app
from vllm.v1.utils import run_api_server_worker_proc as _original_run_api_server_worker_proc
@@ -201,8 +201,8 @@ def custom_run_api_server_worker_proc(listen_address, sock, args, client_config=
_original_run_api_server_worker_proc(listen_address, sock, args, client_config, **uvicorn_kwargs)
vllm.entrypoints.openai.api_server.init_app_state = custom_init_app_state
vllm.entrypoints.openai.api_server.build_app = custom_build_app
vllm.entrypoints.launchers.api_server.entry.init_app_state = custom_init_app_state
vllm.entrypoints.launchers.api_server.entry.build_app = custom_build_app
vllm.v1.utils.run_api_server_worker_proc = custom_run_api_server_worker_proc
@@ -213,7 +213,7 @@ def server(config: InferenceConfig):
import os
from vllm.entrypoints.cli.serve import run_headless, run_multi_api_server
from vllm.entrypoints.openai.api_server import run_server
from vllm.entrypoints.launchers.api_server.entry import run_server
# Signal worker processes to disable LoRA on MoE layers when LoRA targets don't include experts
lora_target_modules = config.vllm.lora_target_modules
+8 -37
View File
@@ -4,19 +4,11 @@ vLLM ships a generic tokens-in / tokens-out handler at
``vllm.entrypoints.scale_out.token_in_token_out.serving.ServingTokens`` that covers
prefix-cache salting, lora dispatch, multimodal features, prompt logprobs,
priority, ``data_parallel_rank`` header routing, server-side ``max_tokens``
defaulting and ``usage`` reporting. We subclass it for the bits still missing
from the upstream handler:
1. Compact ``routed_experts`` export — when the engine emits routing
decisions, surface them as ``{data, shape, start, dtype}`` base64 raw-byte
objects (the form the PD router can merge and the renderers parse) instead
of upstream's single ``.npy`` base64 string.
2. ``kv_transfer_params`` bridging — upstream ``ServingTokens.serve_tokens``
parses ``request.kv_transfer_params`` but never threads it into the engine,
so PD disagg never fires on ``/inference/v1/generate``. Fixed upstream by
https://github.com/vllm-project/vllm/pull/42644, which missed the 0.28.0
cut — drop the bridge once we pin a release that includes it.
defaulting and ``usage`` reporting. We subclass it for the one bit still
missing from the upstream handler: compact ``routed_experts`` export — when the
engine emits routing decisions, surface them as ``{data, shape, start, dtype}``
base64 raw-byte objects (the form the PD router can merge and the renderers
parse) instead of upstream's single ``.npy`` base64 string.
Everything else (request/response schema, sampling params, error handling)
delegates to upstream so we track future vLLM changes for free.
@@ -27,17 +19,14 @@ from __future__ import annotations
from collections.abc import AsyncGenerator
from typing import Any
from fastapi import Request
from vllm.entrypoints.openai.engine.protocol import (
ErrorResponse,
RequestResponseMetadata,
)
from vllm.entrypoints.generate.base.protocol import RequestResponseMetadata
from vllm.entrypoints.scale_out.token_in_token_out.protocol import (
GenerateRequest,
GenerateResponse,
GenerateResponseChoice,
)
from vllm.entrypoints.scale_out.token_in_token_out.serving import ServingTokens
from vllm.entrypoints.serve.engine.protocol import ErrorResponse
from vllm.outputs import RequestOutput
from prime_rl.inference.vllm.routed_experts import RoutedExpertsCapture
@@ -67,25 +56,7 @@ class _GenerateRoutedExpertsCapture(RoutedExpertsCapture):
class PrimeRlServingTokens(ServingTokens):
"""ServingTokens + compact routed experts + PD kv_transfer_params bridging."""
async def serve_tokens(
self,
request: GenerateRequest,
raw_request: Request | None = None,
) -> GenerateResponse | ErrorResponse | AsyncGenerator[str, None]:
# Upstream parses ``request.kv_transfer_params`` but never threads it
# into the engine, so decode receives an empty NIXL handshake and
# re-prefills the prompt locally (~100x slower under concurrency).
# Bridge it through ``sampling_params.extra_args`` so the engine's KV
# connector picks the params up. Fixed upstream by vllm#42644 (merged
# after 0.28.0) — drop once we pin a release that includes it.
if request.kv_transfer_params is not None:
extra = request.sampling_params.extra_args or {}
extra["kv_transfer_params"] = request.kv_transfer_params
request.sampling_params.extra_args = extra
return await super().serve_tokens(request, raw_request)
"""ServingTokens + compact routed experts."""
async def serve_tokens_full_generator( # type: ignore[override]
self,
@@ -2,7 +2,6 @@ import logging
import os
from prime_rl.inference.patches import (
monkey_patch_fp32_lm_head,
monkey_patch_minimax_m2_for_lora,
monkey_patch_no_moe_lora,
)
@@ -17,6 +16,3 @@ if os.environ.get("PRIME_NO_MOE_LORA") == "1":
monkey_patch_no_moe_lora()
else:
logger.info("PRIME_NO_MOE_LORA=0: no patch applied")
# Install fp32 lm_head patch; self-gates on additional_config["fp32_lm_head"] at call time
monkey_patch_fp32_lm_head()
+22 -1
View File
@@ -19,6 +19,7 @@ if TYPE_CHECKING:
import verifiers.v1 as vf
BASE_URL_VAR = "PRIME_API_BASE"
EVAL_ID_VAR = "PRIME_RUNS_EVAL_ID"
# How long finish() and the SDK's atexit crash hook let queued uploads drain. The SDK
# default (300 s) is sized for eval sample batches; a crashed training process should
# not linger that long, and a clean finish rarely has more than the last step queued.
@@ -160,6 +161,12 @@ class PrimeEvalMonitor(Monitor):
# episodes do not retry the platform on every arrival
self.runs: dict[tuple[str, int], pr.Run | None] = {}
self._lock = asyncio.Lock()
self.evaluation_id = os.getenv(EVAL_ID_VAR)
if self.evaluation_id and len(self.sources) != 1:
raise ValueError(
f"${EVAL_ID_VAR} names one platform evaluation, so the run needs "
f"exactly one eval source (got {len(self.sources)})"
)
if self.mode == "online":
self.logger.info("Streaming eval epochs to the Prime platform")
if output_dir is not None:
@@ -172,6 +179,19 @@ class PrimeEvalMonitor(Monitor):
def open(self, env_name: str, step: int, expected: int | None) -> pr.Run:
"""Open the platform evaluation of one epoch. Blocking: runs in a worker thread."""
if self.evaluation_id:
# A hosted launch pre-created the platform evaluation and injected its id -
# attach instead of registering a duplicate. The backend owns its failure
# marking then; a clean finish still completes it.
if self.runs:
raise RuntimeError(f"${EVAL_ID_VAR} holds one epoch, and it already took one")
return pr.init(
kind="eval",
mode=self.mode,
base_url=_base_url(),
id=self.evaluation_id,
finish_timeout=FINISH_TIMEOUT,
)
source = self.sources[env_name]
name = self.config.name if len(self.sources) == 1 else f"{self.config.name}--{env_name}"
return pr.init(
@@ -206,7 +226,8 @@ class PrimeEvalMonitor(Monitor):
return None
self.runs[key] = run
if run.url:
self.logger.info(f"Streaming {env_name} (Step {step}) evaluation - {run.url}")
attached = f" (attached via ${EVAL_ID_VAR})" if run.attached else ""
self.logger.info(f"Streaming {env_name} (Step {step}) evaluation - {run.url}{attached}")
if self.output_dir is not None:
record = read_platform_record(self.output_dir) or {
"kind": "eval",
+1 -1
View File
@@ -333,7 +333,7 @@ async def check_health(
admin_clients: list[AsyncClient],
interval: int = 1,
log_interval: int = 30,
timeout: int = 1800,
timeout: int = 3600,
quiet: bool = False,
) -> None:
"""Wait until every client's /health responds. With ``quiet``, the periodic
+10
View File
@@ -20,6 +20,7 @@ keeps the env's task-specific fields as extras (``WireTaskData`` allows them).
from __future__ import annotations
import asyncio
import random
import time
from collections.abc import Callable, Iterator, Sequence
from itertools import islice
@@ -40,6 +41,11 @@ from prime_rl.utils.pathing import env_address_file
# before serving.
ENV_SERVER_STARTUP_TIMEOUT = 600.0
# Fixed seed for shuffle=True sources: the finite taskset is shuffled once at
# startup and the shuffled order is fixed for the whole run (train curricula and
# eval selection both consume it).
TASKSET_SHUFFLE_SEED = 42
async def wait_for_address(path: Path, timeout: float) -> str:
"""The address a launcher-managed env server published, polling for the file the
@@ -98,11 +104,15 @@ class Env:
await self.env_client.wait_for_server_startup(timeout=ENV_SERVER_STARTUP_TIMEOUT)
taskset = vf.load_taskset(self.config.env.taskset)
if type(taskset).INFINITE:
if self.config.shuffle:
raise ValueError(f"Env {self.name} has an infinite taskset — cannot shuffle it")
self.tasks = iter(taskset)
self.num_tasks = None
else:
# Materialize off the event loop — iterating may pull a dataset.
materialized = await asyncio.to_thread(lambda: list(taskset))
if self.config.shuffle:
random.Random(TASKSET_SHUFFLE_SEED).shuffle(materialized)
self.tasks = iter(materialized)
self.num_tasks = len(materialized)
num_tasks = self.num_tasks if self.num_tasks is not None else "infinite"
+1 -15
View File
@@ -89,9 +89,6 @@ monkey_patch_chat_completion_logprobs()
# shutdown wedges (env-server ZMQ recv, vLLM admin aclose, etc)
SHUTDOWN_TIMEOUT_S = 300
# Abort after this many consecutive train batches contain no samples.
MAX_CONSECUTIVE_EMPTY_BATCHES = 10
# Maximum batches the orchestrator may run ahead of the trainer. The
# dispatcher is paused via ``update_dispatch_gate`` once this is exceeded;
# resumed when the watcher advances ``policy.version``.
@@ -111,7 +108,6 @@ class Orchestrator:
stopped: asyncio.Event
draining: bool
last_batch_at: float | None
consecutive_empty_batches: int
eval_triggered_at: dict[tuple[str, int], float]
ckpt_manager: CheckpointManager
component_tasks: list[asyncio.Task]
@@ -161,7 +157,6 @@ class Orchestrator:
self.last_batch_at = None
# Trigger timestamps so eval success logs can report epoch duration
self.eval_triggered_at = {}
self.consecutive_empty_batches = 0
self.gate_closed_at = None
# Pulsed after inference applies a policy so held work can re-check it.
self.version_advanced = asyncio.Event()
@@ -597,19 +592,10 @@ class Orchestrator:
return
if not batch.samples:
self.consecutive_empty_batches += 1
get_logger().warning(
f"Step {step}: empty train batch after {len(batch.episodes)} finalized episodes "
f"(consecutive empty batches: "
f"{self.consecutive_empty_batches}/{MAX_CONSECUTIVE_EMPTY_BATCHES})"
f"Step {step}: skipping empty train batch after {len(batch.episodes)} finalized episodes"
)
if self.consecutive_empty_batches >= MAX_CONSECUTIVE_EMPTY_BATCHES:
raise RuntimeError(
f"{self.consecutive_empty_batches} consecutive empty train batches — "
"check algorithm credit and task difficulty."
)
return
self.consecutive_empty_batches = 0
effective = batch.cohort.effective
n_trainable = sum(is_trainable(record.trace) for record in effective.records)
if effective.num_traces and n_trainable / effective.num_traces <= 0.1:
+9 -14
View File
@@ -25,8 +25,6 @@ from prime_rl.orchestrator.utils import episode_env_name, episode_group_id, min_
from prime_rl.transports.batch import TrainingSample
from prime_rl.utils.logger import get_logger
MAX_CONSECUTIVE_ZERO_OUTPUT_BATCH_EQUIVALENTS = 10
def payload_tokens(samples: list[TrainingSample], trace: vf.Trace | None = None) -> int:
"""Token cost of one trainer-bound trace."""
@@ -315,9 +313,9 @@ class TrainSink:
self._drop_stale(samples_by_trace)
# A group's traces share one dispatch version, so the insertion sweep
# voids all or none of them. A fully-voided group shipped nothing —
# advance the zero-output budget instead of resetting it, or a stalled
# advance the zero-output tally instead of resetting it, or a stalled
# trainer plus a tight bound could void groups forever without ever
# tripping the abort.
# surfacing the warning.
if not any(trace_id in self.pending_batch for trace_id in samples_by_trace):
self._record_zero_output(group, [], n_owed)
return
@@ -333,7 +331,7 @@ class TrainSink:
def _record_zero_output(self, group: list[vf.Episode], survivors: list[vf.Trace], n_owed: int) -> None:
"""``n_owed`` counts the group's full episode budget (arrived +
cancelled), so dropped groups advance the zero-output budget at the
cancelled), so dropped groups advance the zero-output tally at the
same rate as fully-delivered ones."""
if self.batch_size is not None:
returned_traces = sum(len(episode.traces) for episode in group)
@@ -342,9 +340,12 @@ class TrainSink:
survivor_tokens = sum(trace.num_total_tokens for trace in survivors)
episode_tokens = sum(episode.num_total_tokens for episode in group)
self.zero_output_units += survivor_tokens or episode_tokens or self.config.seq_len * n_owed
self._check_zero_output_budget()
self._warn_zero_output()
def _check_zero_output_budget(self) -> None:
def _warn_zero_output(self) -> None:
"""Warn once per batch-equivalent of finalized units that shipped no
payload, so a run that produces no training signal stays visible in the
logs without aborting."""
target = self.batch_size if self.batch_size is not None else self.token_batch_size
assert target is not None
windows = self.zero_output_units // target
@@ -353,14 +354,8 @@ class TrainSink:
self.reported_zero_output_windows = windows
get_logger().warning(
f"No admitted train payload after {self.zero_output_units} finalized units "
f"(consecutive zero-output batch equivalents: "
f"{windows}/{MAX_CONSECUTIVE_ZERO_OUTPUT_BATCH_EQUIVALENTS})"
f"({windows} zero-output batch equivalents)"
)
if windows >= MAX_CONSECUTIVE_ZERO_OUTPUT_BATCH_EQUIVALENTS:
raise RuntimeError(
f"{windows} consecutive zero-output batch equivalents — "
"check the curriculum admission policy, task difficulty, and staleness drops."
)
def process_batch(self) -> TrainBatch:
items = list(self.pending_batch.items())
@@ -73,6 +73,7 @@ LLMD_EOF
echo "Starting $tag on $LOCAL_IP:$port" | tee "$log"
local -a cmd=(vllm-router --policy "$policy" --host 0.0.0.0 --port "$port"
--request-id-headers x-session-id
--request-timeout-secs {{ router.request_timeout_secs }}
--prometheus-port "$((port + 21000))"
--worker-startup-timeout-secs 4200 --log-level debug)
if [ "$mode" = pd ]; then
@@ -22,9 +22,9 @@ def _per_token_group_quant_fp8(
group_size,
y_num_columns,
y_row_stride,
eps,
fp8_min,
fp8_max,
eps: tl.constexpr,
fp8_min: tl.constexpr,
fp8_max: tl.constexpr,
use_ue8m0: tl.constexpr,
BLOCK: tl.constexpr,
):
+55 -11
View File
@@ -1,13 +1,14 @@
import json
import uuid
from collections import defaultdict
from typing import Any, Literal, TypedDict, cast
from typing import Any, Callable, Literal, TypedDict, cast
import numpy as np
import torch
from datasets import Dataset, interleave_datasets, load_dataset
from jaxtyping import Bool, Int
from renderers.base import MultiModalData, PlaceholderRange, Renderer, build_training_sample
from renderers import AutoRendererConfig, RendererConfig
from renderers.base import MultiModalData, PlaceholderRange, Renderer, build_training_sample, create_renderer
from torch import Tensor
from torch.distributed.checkpoint.stateful import Stateful
from torch.utils.data import IterableDataset, get_worker_info
@@ -204,13 +205,53 @@ def _truncate_mm_data(mm: MultiModalData, cut: int) -> MultiModalData:
return MultiModalData(mm_hashes=new_hashes, mm_placeholders=new_placeholders, mm_items=new_items)
def with_reasoning_effort(config: RendererConfig, reasoning_effort: Any) -> RendererConfig:
"""Copy ``config`` with its ``reasoning_effort`` field set, validated by the config class."""
if isinstance(config, AutoRendererConfig):
raise ValueError(
"A reasoning_effort column requires a typed renderer config (e.g. [renderer] name = 'qwen3.8'), "
"not renderer.name = 'auto'"
)
if "reasoning_effort" not in type(config).model_fields:
raise ValueError(f"Renderer {config.name!r} has no reasoning_effort field, but a row sets {reasoning_effort!r}")
return type(config).model_validate({**config.model_dump(), "reasoning_effort": reasoning_effort})
class RendererResolver:
"""Picks the renderer for a dataset row.
A ``reasoning_effort`` column overrides the configured renderer's field of
the same name per row. Renderer configs are frozen, so renderers are cached
per config and rows that resolve to the same config share one instance.
"""
def __init__(self, tokenizer: PreTrainedTokenizer, config: RendererConfig, processor: Any | None = None):
self.tokenizer = tokenizer
self.config = config
self.processor = processor
self.renderers: dict[RendererConfig, Renderer] = {}
def __call__(self, example: dict) -> Renderer:
config = self.config
reasoning_effort = example.get("reasoning_effort")
if reasoning_effort is not None:
config = with_reasoning_effort(config, reasoning_effort)
renderer = self.renderers.get(config)
if renderer is None:
renderer = create_renderer(self.tokenizer, config)
if self.processor is not None and hasattr(renderer, "_processor"):
renderer._processor = self.processor
self.renderers[config] = renderer
return renderer
class SFTDataset(StatefulIterableDataset):
"""A dataset wrapping a HF SFT dataset with prompt/completion or raw messages format."""
def __init__(
self,
dataset: Dataset,
renderer: Renderer,
renderers: Callable[[dict], Renderer],
shuffle: bool = True,
seed: int = 0,
seq_len: int = 128,
@@ -224,7 +265,7 @@ class SFTDataset(StatefulIterableDataset):
self.logger = get_logger()
self.dataset = dataset
self.num_examples = len(self.dataset)
self.renderer = renderer
self.renderers = renderers
self.shuffle = shuffle
self.seed = seed
self.seq_len = seq_len
@@ -311,8 +352,9 @@ class SFTDataset(StatefulIterableDataset):
# body-only path: the message content is trained, not the role
# scaffolding (e.g. <|im_start|>assistant) the harness emits.
content_sft_roles = {role for role in ("user", "system", "tool") if getattr(self.loss_mask_config, role)}
renderer = self.renderers(example)
sample = build_training_sample(
self.renderer,
renderer,
messages,
role_to_mask=role_to_mask,
tools=tools,
@@ -352,7 +394,7 @@ class SFTDataset(StatefulIterableDataset):
if mm.mm_items:
mm = _truncate_mm_data(mm, cut)
if was_mm_truncated and not set(self.renderer.get_stop_token_ids()) & set(target_ids):
if was_mm_truncated and not set(renderer.get_stop_token_ids()) & set(target_ids):
return None
if sum(loss_mask[: self.seq_len]) == 0:
@@ -365,7 +407,7 @@ class SFTDataset(StatefulIterableDataset):
f"input_ids, loss_mask and target_ids must have the same length, but got {len(input_ids)=}, {len(loss_mask)=}, {len(target_ids)=}"
)
assert sum(loss_mask) > 0, "There are no tokens in this sample that contribute to the loss"
assert set(self.renderer.get_stop_token_ids()) & set(target_ids), (
assert set(renderer.get_stop_token_ids()) & set(target_ids), (
"A renderer stop token must be present in target_ids"
)
@@ -650,7 +692,8 @@ def setup_dataset(
*,
max_epochs: int | None = None,
raw_dataset: Dataset | None = None,
renderer: Renderer | None = None,
renderer_config: RendererConfig | None = None,
processor: Any | None = None,
multimodal: bool = False,
) -> StatefulIterableDataset:
if config.type == "fake":
@@ -663,13 +706,14 @@ def setup_dataset(
non_dp_size=non_dp_size,
)
elif config.type == "sft":
if renderer is None:
raise ValueError("SFT data requires a renderer.")
if renderer_config is None:
raise ValueError("SFT data requires a renderer config.")
if raw_dataset is None:
raw_dataset = load_sft_dataset(config)
renderers = RendererResolver(tokenizer, renderer_config, processor=processor)
return SFTDataset(
raw_dataset,
renderer,
renderers,
shuffle=config.shuffle,
seed=config.seed,
seq_len=config.seq_len,
+11 -14
View File
@@ -6,7 +6,6 @@ import asyncio
from contextlib import nullcontext
from datetime import timedelta
from renderers.base import create_renderer
from torch.nn import CrossEntropyLoss
# Import environment before any other imports
@@ -154,16 +153,6 @@ def train(config: SFTConfig):
if config.model.vlm is not None and processor is None:
raise ValueError(f"[model.vlm] is set but no multimodal processor could be loaded for {config.model.name!r}")
# Fake data never renders messages, so a model without a hand-coded renderer
# can still be used to benchmark step time / memory. Validation data is
# always real, so it needs the renderer even when training data is fake.
renderer = None
if config.data.type != "fake" or config.val is not None:
renderer = create_renderer(tokenizer, config.renderer)
if processor is not None and hasattr(renderer, "_processor"):
renderer._processor = processor
logger.debug(f"Initialized {type(renderer).__name__} for {config.tokenizer.name}")
# Set up the optimizer
logger.info(f"Initializing optimizer ({config.optim})")
optimizer, gradient_manager = setup_optimizer(
@@ -192,12 +181,19 @@ def train(config: SFTConfig):
# Set up the dataset and dataloader
logger.info(f"Initializing data ({config.data})")
multimodal = config.model.vlm is not None
dataset = setup_dataset(tokenizer, config.data, config.model.cp, renderer=renderer, multimodal=multimodal)
dataset = setup_dataset(
tokenizer,
config.data,
config.model.cp,
renderer_config=config.renderer,
processor=processor,
multimodal=multimodal,
)
dataloader = setup_dataloader(dataset, config.data)
val_raw_dataset = None
if config.val is not None:
logger.info(f"Loading validation dataset ({config.val.data.name})")
logger.info(f"Loading validation dataset ({config.val.data})")
val_raw_dataset = load_sft_dataset(config.val.data)
# Optionally, resume training from a checkpoint
@@ -360,7 +356,8 @@ def train(config: SFTConfig):
config.model.cp,
max_epochs=1,
raw_dataset=val_raw_dataset,
renderer=renderer,
renderer_config=config.renderer,
processor=processor,
multimodal=multimodal,
)
val_dataloader = setup_dataloader(val_dataset, config.val.data)
+6 -8
View File
@@ -4,7 +4,8 @@ The full happy-path is owned upstream by vLLM's
``vllm/entrypoints/serve/disagg`` test suite. We only cover the prime-RL
deltas here:
* ``serialize_routed_experts`` round-trips a compact raw-byte payload.
* The subclass attaches its overrides without monkey-patching the parent.
* The subclass overrides ``serve_tokens_full_generator`` without
monkey-patching the parent.
* ``post_process`` swaps in the compact routed_experts while preserving
the rest of the upstream response (``usage`` included).
"""
@@ -13,8 +14,8 @@ from __future__ import annotations
import numpy as np
import pybase64
from vllm.entrypoints.openai.engine.protocol import UsageInfo
from vllm.entrypoints.scale_out.token_in_token_out.protocol import GenerateResponse, GenerateResponseChoice
from vllm.entrypoints.serve.engine.protocol import UsageInfo
from prime_rl.inference.vllm.routed_experts import serialize_routed_experts
from prime_rl.inference.vllm.serving_tokens import (
@@ -35,12 +36,9 @@ async def _empty_request_outputs():
yield
def test_subclass_only_overrides_serve_tokens():
assert PrimeRlServingTokens.serve_tokens is not PrimeRlServingTokens.__mro__[1].serve_tokens
assert (
PrimeRlServingTokens.serve_tokens_full_generator
is not PrimeRlServingTokens.__mro__[1].serve_tokens_full_generator
)
def test_subclass_overrides_serve_tokens_full_generator():
upstream = PrimeRlServingTokens.__mro__[1]
assert PrimeRlServingTokens.serve_tokens_full_generator is not upstream.serve_tokens_full_generator
def test_serialize_routed_experts_uses_compact_raw_payload():
+1
View File
@@ -140,6 +140,7 @@ def test_to_namespace_resolves_parsers():
assert ns.tool_call_parser == "deepseek_v32"
assert ns.reasoning_parser == "deepseek_r1"
assert ns.enable_auto_tool_choice is True
assert ns.enable_ep_weight_filter is True
def test_to_namespace_none_strips_parser_attrs_from_namespace():
+1 -1
View File
@@ -181,7 +181,7 @@ def test_dataloader_shards_across_ranks_and_workers(
)
dataset = SFTDataset(
raw_dataset,
dummy_renderer,
lambda _: dummy_renderer,
shuffle=False,
seq_len=config.seq_len,
non_dp_size=non_dp_size,
+18 -18
View File
@@ -51,7 +51,7 @@ def test_drop_null_fields_preserves_tool_call_arguments(arguments):
def test_init_sft_dataset(build_dummy_dataset, dummy_renderer):
"""Tests basic initialization."""
dataset = build_dummy_dataset("a", 1)
sft_dataset = SFTDataset(dataset, dummy_renderer)
sft_dataset = SFTDataset(dataset, lambda _: dummy_renderer)
assert sft_dataset is not None
@@ -59,7 +59,7 @@ def test_raise_error_if_no_prompt_and_completion(build_dummy_dataset):
"""Tests that an error is raised if no supported SFT message fields are provided."""
dataset = Dataset.from_list([{"text": "a0"}])
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B")
sft_dataset = SFTDataset(dataset, create_renderer(tokenizer))
sft_dataset = SFTDataset(dataset, lambda _: create_renderer(tokenizer))
with pytest.raises(ValueError):
next(iter(sft_dataset))
@@ -70,7 +70,7 @@ def test_sft_first_exhausted(build_dummy_dataset, dummy_renderer, max_epochs: in
b = build_dummy_dataset("b", 2)
ds = [a, b]
dataset = interleave_datasets(ds, stopping_strategy="first_exhausted")
dataset = SFTDataset(dataset, dummy_renderer, shuffle=False, max_epochs=max_epochs)
dataset = SFTDataset(dataset, lambda _: dummy_renderer, shuffle=False, max_epochs=max_epochs)
num_samples = 0
sampling_order = []
for x in dataset:
@@ -86,7 +86,7 @@ def test_sft_all_exhausted(build_dummy_dataset, dummy_renderer, max_epochs: int)
b = build_dummy_dataset("b", 2)
ds = [a, b]
dataset = interleave_datasets(ds, stopping_strategy="all_exhausted")
dataset = SFTDataset(dataset, dummy_renderer, shuffle=False, max_epochs=max_epochs)
dataset = SFTDataset(dataset, lambda _: dummy_renderer, shuffle=False, max_epochs=max_epochs)
num_samples = 0
sampling_order = []
for x in dataset:
@@ -120,7 +120,7 @@ def test_sft_all_exhausted_with_probs(build_dummy_dataset, dummy_renderer, probs
b = build_dummy_dataset("b", int(10e3))
ds = [a, b]
dataset = interleave_datasets(ds, stopping_strategy="all_exhausted", probabilities=probs)
dataset = SFTDataset(dataset, dummy_renderer, shuffle=False, max_epochs=1)
dataset = SFTDataset(dataset, lambda _: dummy_renderer, shuffle=False, max_epochs=1)
num_samples = 0
sampling_freq = []
for x in dataset:
@@ -140,7 +140,7 @@ def test_sft_all_exhausted_with_probs(build_dummy_dataset, dummy_renderer, probs
def test_sft_dataset_state(build_dummy_dataset, dummy_renderer):
"""Tests the state of the dataset within and across epochs."""
dataset = build_dummy_dataset("", 4)
dataset = SFTDataset(dataset, dummy_renderer, shuffle=False, max_epochs=2)
dataset = SFTDataset(dataset, lambda _: dummy_renderer, shuffle=False, max_epochs=2)
dataiter = iter(dataset)
# Initial state
@@ -166,7 +166,7 @@ def test_sft_dataset_state_resume(build_dummy_dataset, dummy_renderer):
"""Tests resuming the dataset from checkpoint in between epochs."""
dataset = SFTDataset(
build_dummy_dataset("", 4),
dummy_renderer,
lambda _: dummy_renderer,
shuffle=False,
max_epochs=2,
)
@@ -186,7 +186,7 @@ def test_sft_dataset_state_resume(build_dummy_dataset, dummy_renderer):
del dataset
dataset = SFTDataset(
build_dummy_dataset("", 4),
dummy_renderer,
lambda _: dummy_renderer,
shuffle=False,
max_epochs=2,
)
@@ -204,7 +204,7 @@ def test_sft_dataset_state_resume(build_dummy_dataset, dummy_renderer):
del dataset
dataset = SFTDataset(
build_dummy_dataset("", 4),
dummy_renderer,
lambda _: dummy_renderer,
shuffle=False,
max_epochs=2,
)
@@ -235,7 +235,7 @@ def test_multiturn_loss_mask():
]
)
tokenizer = AutoTokenizer.from_pretrained("PrimeIntellect/Qwen3-0.6B") # Properly handles multi-turn think
dataset = SFTDataset(dataset, create_renderer(tokenizer), max_examples=1)
dataset = SFTDataset(dataset, lambda _: create_renderer(tokenizer), max_examples=1)
sample = next(iter(dataset))
print_sample(sample["input_ids"], sample["loss_mask"], tokenizer)
@@ -298,7 +298,7 @@ def test_multiturn_loss_mask_with_tools():
dataset = Dataset.from_list([tool_example])
tokenizer = AutoTokenizer.from_pretrained("PrimeIntellect/Qwen3-0.6B") # Properly handles multi-turn think
dataset = SFTDataset(dataset, create_renderer(tokenizer), max_examples=1)
dataset = SFTDataset(dataset, lambda _: create_renderer(tokenizer), max_examples=1)
sample = next(iter(dataset))
print_sample(sample["input_ids"], sample["loss_mask"], tokenizer)
@@ -325,12 +325,12 @@ def test_messages_rows_are_equivalent_to_empty_prompt_completion():
tokenizer = AutoTokenizer.from_pretrained("PrimeIntellect/Qwen3-0.6B")
messages_dataset = SFTDataset(
Dataset.from_list([{"messages": messages}]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
split_dataset = SFTDataset(
Dataset.from_list([{"prompt": [], "completion": messages}]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
@@ -351,12 +351,12 @@ def test_messages_take_precedence_over_prompt_and_completion():
messages_dataset = SFTDataset(
Dataset.from_list([row]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
expected_dataset = SFTDataset(
Dataset.from_list([{"prompt": [], "completion": row["messages"]}]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
@@ -372,12 +372,12 @@ def test_null_messages_falls_back_to_prompt_and_completion():
mixed_row_dataset = SFTDataset(
Dataset.from_list([{"messages": None, "prompt": prompt, "completion": completion}]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
expected_dataset = SFTDataset(
Dataset.from_list([{"prompt": prompt, "completion": completion}]),
create_renderer(tokenizer),
lambda _: create_renderer(tokenizer),
max_examples=1,
)
@@ -399,7 +399,7 @@ def test_vlm_truncation_does_not_append_trainable_eos(monkeypatch, dummy_rendere
)
monkeypatch.setattr(sft_data, "build_training_sample", fake_build_training_sample)
dataset = SFTDataset(Dataset.from_list([]), dummy_renderer, seq_len=2, multimodal=True)
dataset = SFTDataset(Dataset.from_list([]), lambda _: dummy_renderer, seq_len=2, multimodal=True)
assert dataset._process({"messages": [{"role": "assistant", "content": "ignored"}]}) is None
Generated
+108 -56
View File
@@ -36,7 +36,6 @@ renderers = false
tokenspeed-mla = false
torchao = false
verifiers = false
vllm = false
vllm-router = false
[manifest]
@@ -94,6 +93,7 @@ members = [
"multiswe",
"nl2repobench",
"numina",
"officeqa-pro-v2",
"oolong-pairs",
"oolong-real",
"oolong-synth",
@@ -127,6 +127,7 @@ members = [
"terminal-bench-2",
"terminal-lego",
"tmax",
"trace-cheating-recall-500",
"triviaqa",
"unscramble",
"uuid-ctf",
@@ -1404,7 +1405,7 @@ requires-dist = [{ name = "verifiers", specifier = ">=0.3.1" }]
[[package]]
name = "deepseek-prover"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/lean/deepseek_prover" }
dependencies = [
{ name = "verifiers" },
@@ -1612,7 +1613,7 @@ wheels = [
[[package]]
name = "enterprise-ops-gym"
version = "0.2.0"
version = "0.2.1"
source = { editable = "deps/prime-envs/environments/tool_use/enterprise_ops_gym" }
dependencies = [
{ name = "datasets" },
@@ -1900,7 +1901,7 @@ dependencies = [
[[package]]
name = "flashinfer-python"
version = "0.6.16.post3"
version = "0.6.18"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "apache-tvm-ffi" },
@@ -1920,9 +1921,9 @@ dependencies = [
{ name = "torch", version = "2.13.0+cu130", source = { registry = "https://download.pytorch.org/whl/cu130" } },
{ name = "tqdm" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c2/46/17045cb47b7b93fcb4e5303e398e6b129b86239930ac0875942a83d8b962/flashinfer_python-0.6.16.post3.tar.gz", hash = "sha256:9b146cfcc1454c80f3f99444db48013b3eadaeb32f2a399bd76c9471ecb72f04", size = 11076656, upload-time = "2026-08-08T01:14:16.408Z" }
sdist = { url = "https://files.pythonhosted.org/packages/3e/72/12066c5f42a49e7eabe6ec445ac73c59785480bba1b763bd7e0a512f13c1/flashinfer_python-0.6.18.tar.gz", hash = "sha256:70a2074d78cb17ed39c98e5ed47f626c6e8bb29015cf028c49cbf8f2629405a1", size = 13286160, upload-time = "2026-08-29T02:09:18.376Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/9d/dc/5367cb601fc9190cc75b4c141f5f7e9a224d1c26a1e983151823e02a25b3/flashinfer_python-0.6.16.post3-py3-none-any.whl", hash = "sha256:caf686b9b079abe1c9d65ab505698bd325e8072de40afd822f2c74f2ac3bc601", size = 15836034, upload-time = "2026-08-08T01:14:13.709Z" },
{ url = "https://files.pythonhosted.org/packages/31/7d/3dae45fc293cd5f16cefe4dcf59683d964ca8faf2303ed7fff54f4bca490/flashinfer_python-0.6.18-py3-none-any.whl", hash = "sha256:d5d26edb48f8def0bf28b2c94415aef7f0754e2cd9e3cb3d6e7081262d068aad", size = 18347767, upload-time = "2026-08-29T02:09:15.868Z" },
]
[[package]]
@@ -1949,7 +1950,7 @@ wheels = [
[[package]]
name = "forth-lang"
version = "0.2.0"
version = "0.2.1"
source = { editable = "deps/prime-envs/environments/code/forth_lang" }
dependencies = [
{ name = "verifiers" },
@@ -2083,7 +2084,7 @@ wheels = [
[[package]]
name = "goedel-pset"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/lean/goedel_pset" }
dependencies = [
{ name = "verifiers" },
@@ -2540,7 +2541,7 @@ wheels = [
[[package]]
name = "i3-code"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/code/i3_code" }
dependencies = [
{ name = "orjson" },
@@ -2555,7 +2556,7 @@ requires-dist = [
[[package]]
name = "i3-logic"
version = "0.2.0"
version = "0.2.1"
source = { editable = "deps/prime-envs/environments/reasoning/i3_logic" }
dependencies = [
{ name = "markdown" },
@@ -2572,7 +2573,7 @@ requires-dist = [
[[package]]
name = "i3-math"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/math/i3_math" }
dependencies = [
{ name = "verifiers" },
@@ -2583,7 +2584,7 @@ requires-dist = [{ name = "verifiers", specifier = ">=0.3.1" }]
[[package]]
name = "i3-science"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/science/i3_science" }
dependencies = [
{ name = "verifiers" },
@@ -2722,6 +2723,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
]
[[package]]
name = "instanttensor"
version = "0.2.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "torch", version = "2.13.0+cu130", source = { registry = "https://download.pytorch.org/whl/cu130" } },
]
sdist = { url = "https://files.pythonhosted.org/packages/27/8e/b209471a5a73a7ef1dad7365e05adf4c95b20fadc16fc9aea10ceaba1fc8/instanttensor-0.2.0.tar.gz", hash = "sha256:acafa964f9ba6d2e342d8ffcb7e68bacc6d59d60e2fda222dc1333045cd50c9c", size = 3112592, upload-time = "2026-09-13T19:10:18.043Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/77/10/23c738a0b3568a4dadd7604ffe1f47612969b74db1e6708b074625b83838/instanttensor-0.2.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eefde9b121cd3a2699bd079a19cba5c0a74f23cc1fa2dd8e186a12910f89408e", size = 6089973, upload-time = "2026-09-13T19:10:00.355Z" },
{ url = "https://files.pythonhosted.org/packages/f8/02/90a64c81360d473d07f36dde68eb47d043bf442a24c9c91232643f8c0928/instanttensor-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:879e8b524b391ed916b8412ef82c3ab40d933ad8d038f40b340d0bd58b7894d3", size = 6178704, upload-time = "2026-09-13T19:10:03.313Z" },
]
[[package]]
name = "interegular"
version = "0.3.3"
@@ -2989,7 +3003,7 @@ wheels = [
[[package]]
name = "kimina"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/lean/kimina" }
dependencies = [
{ name = "verifiers" },
@@ -3254,7 +3268,7 @@ dependencies = [
[[package]]
name = "longcot-env"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/long_context/longcot_env" }
dependencies = [
{ name = "longcot" },
@@ -3284,7 +3298,7 @@ requires-dist = [
[[package]]
name = "longpdfs"
version = "0.0.1"
version = "0.0.2"
source = { editable = "deps/prime-envs/environments/long_context/longpdfs" }
dependencies = [
{ name = "verifiers" },
@@ -3358,7 +3372,7 @@ wheels = [
[[package]]
name = "math-env"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/math/math_env" }
dependencies = [
{ name = "verifiers" },
@@ -3451,7 +3465,7 @@ wheels = [
[[package]]
name = "mcp-atlas"
version = "0.4.0"
version = "0.4.1"
source = { editable = "deps/prime-envs/environments/tool_use/mcp_atlas" }
dependencies = [
{ name = "datasets" },
@@ -3574,7 +3588,7 @@ wheels = [
[[package]]
name = "mmk12"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/multimodal/mmk12" }
dependencies = [
{ name = "pillow" },
@@ -3827,7 +3841,7 @@ wheels = [
[[package]]
name = "multiswe"
version = "0.1.2"
version = "0.1.4"
source = { editable = "deps/prime-envs/environments/swe/multiswe" }
dependencies = [
{ name = "multi-swe-bench" },
@@ -3992,7 +4006,7 @@ wheels = [
[[package]]
name = "numina"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/lean/numina" }
dependencies = [
{ name = "verifiers" },
@@ -4315,6 +4329,22 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/be/9c/92789c596b8df838baa98fa71844d84283302f7604ed565dafe5a6b5041a/oauthlib-3.3.1-py3-none-any.whl", hash = "sha256:88119c938d2b8fb88561af5f6ee0eec8cc8d552b7bb1f712743136eb7523b7a1", size = 160065, upload-time = "2025-06-19T22:48:06.508Z" },
]
[[package]]
name = "officeqa-pro-v2"
version = "0.1.0"
source = { editable = "deps/prime-envs/environments/search/officeqa_pro_v2" }
dependencies = [
{ name = "huggingface-hub", version = "1.16.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux'" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
[package.metadata]
requires-dist = [
{ name = "huggingface-hub", specifier = ">=0.34.0" },
{ name = "verifiers", specifier = ">=0.3.1" },
]
[[package]]
name = "onnxruntime"
version = "1.28.0"
@@ -4435,7 +4465,7 @@ requires-dist = [{ name = "verifiers", specifier = ">=0.3.1" }]
[[package]]
name = "openswe"
version = "0.1.3"
version = "0.1.5"
source = { editable = "deps/prime-envs/environments/swe/openswe" }
dependencies = [
{ name = "huggingface-hub", version = "1.16.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux'" },
@@ -4693,7 +4723,7 @@ wheels = [
[[package]]
name = "patterned-needle-in-haystack"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/long_context/patterned_needle_in_haystack" }
dependencies = [
{ name = "nltk" },
@@ -4980,8 +5010,8 @@ all = [
{ name = "torchdata", marker = "sys_platform == 'linux'" },
{ name = "torchtitan", marker = "sys_platform == 'linux'" },
{ name = "torchvision", marker = "sys_platform == 'linux'" },
{ name = "vllm", version = "0.28.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.28.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.29.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.29.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm-router", version = "0.2.1", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm-router", version = "0.2.1", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
@@ -5030,8 +5060,8 @@ gpu = [
{ name = "torchdata", marker = "sys_platform == 'linux'" },
{ name = "torchtitan", marker = "sys_platform == 'linux'" },
{ name = "torchvision", marker = "sys_platform == 'linux'" },
{ name = "vllm", version = "0.28.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.28.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.29.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.29.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
]
kernels = [
{ name = "prime-kernels", version = "0.1.0+cu130torch2.13.0", source = { url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.1/prime_kernels-0.1.0+cu130torch2.13.0-cp312-cp312-linux_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
@@ -5127,9 +5157,9 @@ requires-dist = [
{ name = "uvicorn", marker = "extra == 'dashboard'", specifier = ">=0.30" },
{ name = "uvloop", specifier = ">=0.21.0" },
{ name = "verifiers", extras = ["harbor"], editable = "deps/verifiers" },
{ name = "vllm", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'gpu'", url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl" },
{ name = "vllm", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'gpu'", specifier = ">=0.28.0" },
{ name = "vllm", marker = "platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'gpu'", url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl" },
{ name = "vllm", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'gpu'", url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl" },
{ name = "vllm", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'gpu'", specifier = ">=0.29.0" },
{ name = "vllm", marker = "platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'gpu'", url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl" },
{ name = "vllm-router", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_aarch64.whl" },
{ name = "vllm-router", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'disagg'" },
{ name = "vllm-router", marker = "platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_x86_64.whl" },
@@ -5277,7 +5307,7 @@ requires-dist = [
[[package]]
name = "prolog"
version = "0.5.0"
version = "0.5.1"
source = { editable = "deps/prime-envs/environments/reasoning/prolog" }
dependencies = [
{ name = "verifiers" },
@@ -5922,7 +5952,7 @@ wheels = [
[[package]]
name = "r2e-gym"
version = "0.1.2"
version = "0.1.4"
source = { editable = "deps/prime-envs/environments/swe/r2e_gym" }
dependencies = [
{ name = "verifiers" },
@@ -6220,7 +6250,7 @@ wheels = [
[[package]]
name = "scaleswe"
version = "0.1.2"
version = "0.1.4"
source = { editable = "deps/prime-envs/environments/swe/scaleswe" }
dependencies = [
{ name = "verifiers" },
@@ -6750,7 +6780,7 @@ requires-dist = [{ name = "verifiers", extras = ["harbor"], specifier = ">=0.3.1
[[package]]
name = "swelego"
version = "0.1.2"
version = "0.1.4"
source = { editable = "deps/prime-envs/environments/swe/swelego" }
dependencies = [
{ name = "verifiers" },
@@ -6761,7 +6791,7 @@ requires-dist = [{ name = "verifiers", specifier = ">=0.3.1" }]
[[package]]
name = "swerebench-v2"
version = "0.1.2"
version = "0.1.4"
source = { editable = "deps/prime-envs/environments/swe/swerebench_v2" }
dependencies = [
{ name = "verifiers" },
@@ -6777,7 +6807,7 @@ source = { git = "https://github.com/SWE-bench/SWE-smith.git?rev=9b74ac0#9b74ac0
[[package]]
name = "swesmith-env"
version = "0.1.3"
version = "0.1.5"
source = { editable = "deps/prime-envs/environments/swe/swesmith_env" }
dependencies = [
{ name = "swebench" },
@@ -6934,7 +6964,7 @@ requires-dist = [{ name = "verifiers", extras = ["harbor"], specifier = ">=0.3.1
[[package]]
name = "terminal-lego"
version = "0.1.1"
version = "0.1.2"
source = { editable = "deps/prime-envs/environments/terminal/terminal_lego" }
dependencies = [
{ name = "huggingface-hub", version = "1.16.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux'" },
@@ -7046,7 +7076,7 @@ wheels = [
[[package]]
name = "tmax"
version = "0.1.0"
version = "0.1.2"
source = { editable = "deps/prime-envs/environments/terminal/tmax" }
dependencies = [
{ name = "verifiers", extra = ["harbor"] },
@@ -7355,6 +7385,24 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/16/e1/3079a9ff9b8e11b846c6ac5c8b5bfb7ff225eee721825310c91b3b50304f/tqdm-4.67.3-py3-none-any.whl", hash = "sha256:ee1e4c0e59148062281c49d80b25b67771a127c85fc9676d3be5f243206826bf", size = 78374, upload-time = "2026-02-03T17:35:50.982Z" },
]
[[package]]
name = "trace-cheating-recall-500"
version = "0.1.0"
source = { editable = "deps/prime-envs/environments/judges/trace_cheating_recall_500" }
dependencies = [
{ name = "huggingface-hub", version = "1.16.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux'" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "orjson" },
{ name = "verifiers" },
]
[package.metadata]
requires-dist = [
{ name = "huggingface-hub", specifier = ">=0.34.0" },
{ name = "orjson", specifier = ">=3.10.0" },
{ name = "verifiers", specifier = ">=0.3.1" },
]
[[package]]
name = "traitlets"
version = "5.15.0"
@@ -7568,7 +7616,7 @@ wheels = [
[[package]]
name = "unscramble"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/reasoning/unscramble" }
dependencies = [
{ name = "verifiers" },
@@ -7588,7 +7636,7 @@ wheels = [
[[package]]
name = "uuid-ctf"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/reasoning/uuid_ctf" }
dependencies = [
{ name = "verifiers" },
@@ -7636,7 +7684,7 @@ wheels = [
[[package]]
name = "verbatim-copy"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/long_context/verbatim_copy" }
dependencies = [
{ name = "faker" },
@@ -7756,7 +7804,7 @@ examples = [
[[package]]
name = "virl39k"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/multimodal/virl39k" }
dependencies = [
{ name = "huggingface-hub", version = "1.16.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux'" },
@@ -7787,8 +7835,8 @@ wheels = [
[[package]]
name = "vllm"
version = "0.28.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl" }
version = "0.29.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
@@ -7810,6 +7858,7 @@ dependencies = [
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" } },
{ name = "humming-kernels", extra = ["cu13"] },
{ name = "ijson" },
{ name = "instanttensor" },
{ name = "jsonschema" },
{ name = "lark" },
{ name = "llguidance" },
@@ -7869,7 +7918,7 @@ dependencies = [
{ name = "xgrammar" },
]
wheels = [
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:817b8181f7f61b4a62dc1d5d9ab39f2bfb60a6cb86c29879a78a147b85756787" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e6b0dfc2b6fd307315e9b34b73cd2bfe7b6b08958eda721828e61732bba426b0" },
]
[package.metadata]
@@ -7878,7 +7927,7 @@ requires-dist = [
{ name = "anthropic", specifier = ">=0.71.0" },
{ name = "apache-tvm-ffi", specifier = "==0.1.11" },
{ name = "av", marker = "extra == 'audio'" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.2.4" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.2.6" },
{ name = "blake3" },
{ name = "cachetools" },
{ name = "cbor2" },
@@ -7891,11 +7940,12 @@ requires-dist = [
{ name = "fastsafetensors", specifier = ">=0.3.3" },
{ name = "fastsafetensors", marker = "extra == 'fastsafetensors'", specifier = ">=0.3.3" },
{ name = "filelock", specifier = ">=3.16.1" },
{ name = "flashinfer-python", specifier = "==0.6.16.post3" },
{ name = "flashinfer-python", specifier = "==0.6.18" },
{ name = "helion", marker = "extra == 'helion'", specifier = "==1.4.0" },
{ name = "huggingface-hub", specifier = ">=1.27.0" },
{ name = "huggingface-hub", specifier = ">=1.28.0" },
{ name = "humming-kernels", extras = ["cu13"], specifier = "==0.1.12" },
{ name = "ijson" },
{ name = "instanttensor", specifier = ">=0.1.9" },
{ name = "instanttensor", marker = "extra == 'instanttensor'", specifier = ">=0.1.9" },
{ name = "jsonschema", specifier = ">=4.23.0" },
{ name = "lark", specifier = "==1.2.2" },
@@ -7967,7 +8017,7 @@ requires-dist = [
{ name = "torchcodec", specifier = ">=0.14" },
{ name = "torchvision", specifier = "==0.28.0" },
{ name = "tqdm" },
{ name = "transformers", specifier = ">=5.5.3" },
{ name = "transformers", specifier = ">=5.10.4" },
{ name = "typing-extensions", specifier = ">=4.10" },
{ name = "vllm-gguf-plugin", marker = "extra == 'extra-quant'", specifier = ">=0.0.2" },
{ name = "watchfiles" },
@@ -7978,8 +8028,8 @@ provides-extras = ["zen", "bench", "tensorizer", "fastsafetensors", "instanttens
[[package]]
name = "vllm"
version = "0.28.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl" }
version = "0.29.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl" }
resolution-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
]
@@ -8001,6 +8051,7 @@ dependencies = [
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" } },
{ name = "humming-kernels", extra = ["cu13"] },
{ name = "ijson" },
{ name = "instanttensor" },
{ name = "jsonschema" },
{ name = "lark" },
{ name = "llguidance" },
@@ -8060,7 +8111,7 @@ dependencies = [
{ name = "xgrammar" },
]
wheels = [
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.28.0/vllm-0.28.0-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:addb0ffdaafd8155d75e9b3f5ddb3da28fdee9e8a7097ede91f7db2e9e1a3889" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.29.0/vllm-0.29.0-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:09d48617fc2be9c6cdcd5db480651ab0d84817b257204f2cc2e3ecbb70bbb635" },
]
[package.metadata]
@@ -8069,7 +8120,7 @@ requires-dist = [
{ name = "anthropic", specifier = ">=0.71.0" },
{ name = "apache-tvm-ffi", specifier = "==0.1.11" },
{ name = "av", marker = "extra == 'audio'" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.2.4" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.2.6" },
{ name = "blake3" },
{ name = "cachetools" },
{ name = "cbor2" },
@@ -8082,11 +8133,12 @@ requires-dist = [
{ name = "fastsafetensors", specifier = ">=0.3.3" },
{ name = "fastsafetensors", marker = "extra == 'fastsafetensors'", specifier = ">=0.3.3" },
{ name = "filelock", specifier = ">=3.16.1" },
{ name = "flashinfer-python", specifier = "==0.6.16.post3" },
{ name = "flashinfer-python", specifier = "==0.6.18" },
{ name = "helion", marker = "extra == 'helion'", specifier = "==1.4.0" },
{ name = "huggingface-hub", specifier = ">=1.27.0" },
{ name = "huggingface-hub", specifier = ">=1.28.0" },
{ name = "humming-kernels", extras = ["cu13"], specifier = "==0.1.12" },
{ name = "ijson" },
{ name = "instanttensor", specifier = ">=0.1.9" },
{ name = "instanttensor", marker = "extra == 'instanttensor'", specifier = ">=0.1.9" },
{ name = "jsonschema", specifier = ">=4.23.0" },
{ name = "lark", specifier = "==1.2.2" },
@@ -8158,7 +8210,7 @@ requires-dist = [
{ name = "torchcodec", specifier = ">=0.14" },
{ name = "torchvision", specifier = "==0.28.0" },
{ name = "tqdm" },
{ name = "transformers", specifier = ">=5.5.3" },
{ name = "transformers", specifier = ">=5.10.4" },
{ name = "typing-extensions", specifier = ">=4.10" },
{ name = "vllm-gguf-plugin", marker = "extra == 'extra-quant'", specifier = ">=0.0.2" },
{ name = "watchfiles" },
@@ -8422,7 +8474,7 @@ requires-dist = [
[[package]]
name = "wikispeedia"
version = "0.1.0"
version = "0.1.1"
source = { editable = "deps/prime-envs/environments/reasoning/wikispeedia" }
dependencies = [
{ name = "verifiers" },