Compare commits

...
Author SHA1 Message Date
1b929ec184 feat: depend on the prime CLI instead of prime-sandboxes (#3717)
## Summary

- Replace `prime-sandboxes>=0.3.2` with `prime>=0.8.0` in the core
dependencies. `prime` 0.8.0 drops its `verifiers==0.2.0` pin
([prime#940](https://github.com/PrimeIntellect-ai/prime/pull/940)).
`prime-sandboxes` now comes in transitively and stays locked at 0.3.2.
- Remove the separate `uv pip install 'prime>=0.7'` step and its
`verifiers` override from `Dockerfile.cuda`. `uv sync` now installs the
CLI into `/app/.venv` at the locked version.
- Remove the same replay step from the `PRIME_RL_REF` source overlay in
`scripts/docker-entrypoint.sh`.
- Remove `uv tool install prime` from `scripts/install.sh`. `uv sync`
installs the CLI into the project venv.
- Lock changes: add `prime` 0.8.0, `prime-evals` 0.2.4 and
`gitignore-parser` 0.1.13. Bump `prime-traces` 0.0.4 → 0.0.7.

## Verification

- `uv lock` resolves. `uv sync --all-packages --locked` succeeds.
- `uv run --no-sync prime --version` prints `Prime CLI version: 0.8.0`.
- `verifiers` still imports from the editable `deps/verifiers`.
`prime_rl.configs.orchestrator` imports.

I did not build the image.

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes how the Prime CLI and sandbox stack are installed in Docker
and dev venvs; wrong resolution could still break editable `verifiers`
imports, though the explicit override path is gone.
> 
> **Overview**
> **Switches the project’s direct dependency from `prime-sandboxes` to
the `prime` CLI (`>=0.8.0`)**, so the CLI is installed via `uv sync` at
the locked version instead of a separate install path. `prime-sandboxes`
remains available transitively through `prime`.
> 
> **Removes the Docker/runtime workaround** that ran `uv pip install
'prime>=0.7'` with a `verifiers` overrides file after sync (in
`Dockerfile.cuda` and `scripts/docker-entrypoint.sh`). That existed
because older CLI versions pinned `verifiers==0.2.0` and could replace
the editable `deps/verifiers` wheel; `prime` 0.8.0 drops that pin.
> 
> **Simplifies local setup** by dropping `uv tool install prime` from
`scripts/install.sh`—developers use `uv run prime` from the project
venv.
> 
> Lockfile updates add `prime` 0.8.0 and its new deps (`prime-evals`,
`gitignore-parser`) and bump `prime-traces` to 0.0.7.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
696ae027e29ff470d9f7d40a0d82e3797704f2a1. 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 Opus 5.5 <noreply@anthropic.com>
2026-09-28 19:39:40 -07:00
d72e7e8b1e feat: bump vllm to 0.30.0 (#3716)
## Summary

- Bump vLLM to
[v0.30.0](https://github.com/vllm-project/vllm/releases/tag/v0.30.0).
- Bump the `nvidia-cutlass-dsl` override to 4.7.1. vLLM 0.30.0 and its
quack-kernels 0.6.5 require it.
- Set `--enable-scale-out` on the inference server. vLLM 0.30.0 no
longer registers `/inference/v1/generate` on `vllm serve` without it,
and the orchestrator generates through that endpoint. Set
`inference.vllm.enable_scale_out = false` to opt out.
- Remove two DeepSeek V4 patches that upstream now covers:
- `monkey_patch_deepseek_v4_per_layer_rope`: fixed by
vllm-project/vllm#54815. The reference RoPE test now checks upstream
directly.
- `monkey_patch_deepseek_v4_bf16_o_proj`: upstream
`deep_gemm_fp8_o_proj` has a bf16 path since vllm-project/vllm#56228.

The other patches in `prime_rl/inference/patches.py` stay: their
upstream code is unchanged, or the upstream fix is not released yet.

## Relevant upstream changes

- vllm-project/vllm#54901: MRV2 compacts sampling masks on the GPU. This
fixes an about 2x RL step-time regression with `--return-sampling-mask`.
- vllm-project/vllm#53187: `/inference/v1/generate` returns prompt
metadata. This unblocks #3710.
- vllm-project/vllm#52957: pause and sleep no longer run 32 dummy
forwards per DP rank.
- vllm-project/vllm#56706: fixes stale QK-norm weights after a weight
refit.
- vllm-project/vllm#51485: sleep mode releases NCCL communicator memory.
- vllm-project/vllm#54646: MRV2 CUDA graph capture freezes gc (engine
init 28.9s → 8.2s on H200).
- vllm-project/vllm#54518: NIXL no longer asserts when it cleans up a
failed transfer twice.
- vllm-project/vllm#55548: rsLoRA scaling in MoE expert packing.

## Verification

Ran 5-step RL smoke runs on SLURM (H200) against this branch:

- `configs/basic/reverse-text/rl.toml`, single-node (1 trainer GPU + 1
inference GPU): 5/5 steps, no errors.
- `configs/basic/reverse-text/rl.toml`, multi-node (1 trainer node + 1
inference node): 5/5 steps, no errors.
- `examples/advanced/glm-4.5-air/swe.toml` (2 trainer nodes, 4 × TP8/EP
inference replicas, router replay), with `batch_size = 32`, `group_size
= 8`, and no eval, checkpoint, or wandb. Ran the same config on `main`
(vLLM 0.29.0) for comparison:

| | main (vLLM 0.29.0) | this branch (vLLM 0.30.0) |
|---|---|---|
| Steps completed | 5/5 | 5/5 |
| Tracebacks | 0 | 0 |
| Mismatch KL | 1e-4 – 2e-4 | 1e-4 – 2e-4 |
| Grad norm | 0.33 – 0.87 | 0.26 – 0.44 |
| Reward (steps 1–5) | 0.28, 0.31, 0.13, 0.34, 0.34 | 0.34, 0.34, 0.38,
0.25, 0.41 |
| Trainer peak memory | 110 – 112 GiB | 110 – 113 GiB |

Both runs have a few `scaleswe` harness-setup failures (`uv python find
--script` is unsupported by the sandbox image's uv). This is a verifiers
runtime issue and is independent of the vLLM version.

Unit tests: `tests/unit/inference` and `tests/unit/test_configs.py` pass
(212 tests).

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **High Risk**
> Major inference-engine upgrade touches RL generation, router replay,
and DeepSeek V4 serving; remaining monkey patches and new scale-out
default can change runtime behavior across deployments.
> 
> **Overview**
> **Bumps the GPU inference stack from vLLM 0.29.0 to 0.30.0**,
including lockfile updates for CUTLASS DSL 4.7.1, quack-kernels 0.6.5,
FlashInfer 0.6.18.post1, and huggingface-hub 1.32.0 on Linux.
> 
> **Inference defaults:** vLLM args now turn on **`enable_scale_out`**
when not overridden, so `/inference/v1/generate` stays available for the
orchestrator under 0.30 (opt out with `inference.vllm.enable_scale_out =
false`).
> 
> **Patch cleanup:** Removes
**`monkey_patch_deepseek_v4_per_layer_rope`** and
**`monkey_patch_deepseek_v4_bf16_o_proj`** because upstream 0.30 covers
those paths; DeepSeek V4 RoPE unit tests assert against stock
`build_deepseek_v4_rope` instead of the old monkey patches.
> 
> **Docs:** Router-replay text no longer pins “vLLM 0.29”; it states
standard deployments use the V2 runner.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3c6229d9b08a7f32f74d5cab1dfd1fbb83c43482. 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 Opus 5.5 <noreply@anthropic.com>
2026-09-28 18:45:39 -07:00
2662c9ace1 feat: select taskset tasks per train and eval source (#3703)
## Summary

- Give every train and eval source a `select` block (`EnvConfig.select`,
a `vf.SelectConfig`): `include`/`exclude` by task `idx`, `ids`, `keys`
or `names`, then `shuffle`, `skip` and `limit`. The orchestrator loads
each source's tasks with `vf.load_taskset(...).select(source.select)`.
prime-rl no longer shuffles or slices tasksets itself, so it picks the
same tasks as `vf-eval` for the same selection.
  ```toml
  [[orchestrator.train.source]]
  env.taskset.id = "gsm8k"
  select.exclude.idx = [":100"]   # hold out the first 100 tasks

  [[orchestrator.eval.source]]
  env.taskset.id = "gsm8k"
  select.include.idx = [":100"]
  ```
- Every source group (`[orchestrator.train]`, `[orchestrator.eval]`, SFT
`[eval]`, the top level of `uv run eval`) takes a shared `select` block.
The same before-validator that layers the group `env` block layers it
under each source, field by field, and a field that the source sets
wins. A source's `include` or `exclude` replaces the group's whole
block. A source `select` that does not validate keeps its own block, so
its error surfaces. For example, this evaluates 128 tasks of each
taskset:
  ```toml
  [orchestrator.eval.select]
  limit = 128
  ```
- Only `uv run eval` has the `-n`/`-s` short flags
(`select.limit`/`select.shuffle`), through `vf.SelectCLIConfig`. The
`rl`, `orchestrator` and `sft` CLIs have several `select` blocks, so
they get no short flags.
- The dashboard derives the expected episode count from `select.limit`,
per source and for vf-shaped configs.
- Migrate the configs, examples and docs from `num_examples` to
`select.limit`. Group-level blocks use `[... .select]` tables.
- Update the eval docs and skill: resume no longer checks the config
(#3690), and a resume matches landed episodes to the new `select` by
`task.key`.
- Update the `configs` skill (`[select]`, `-s`). Update the eval skill:
the `select` shorthands, and common patterns (a random subset, tasks by
position or name, dropping broken tasks, contiguous and random
train/test splits via `include`/`exclude` and `skip`).
- Pin `deps/verifiers` to its main, which merged
PrimeIntellect-ai/verifiers#2695 (`Taskset.select`, `vf.SelectConfig`).
Raise the `verifiers` minimum to `0.3.2.dev152`, its first release, in
both `pyproject.toml` files, so the slim `prime-rl-configs` install gets
it.

Companion PRs: PrimeIntellect-ai/verifiers#2695 (merged),
PrimeIntellect-ai/prime-envs#852 (independent; `compile_statements`
stops calling `head()`).

## Breaking

- `EnvConfig.shuffle` is removed. Use `select.shuffle`.
- `EvalSourceConfig.num_examples` and the group-level `num_examples` are
removed. Use `select.limit` on the source or on the eval block.
- The shuffle seed changes from 42 to verifiers' default 0
(`select.seed`). Existing `shuffle = true` configs pick other tasks, so
eval numbers before and after this change are not comparable.
- Default task keys change for tasksets that never set `idx` (see
verifiers#2695). An interrupted eval of such a taskset cannot resume
across this change.

## Verification

- The slim-install CI check, run locally: the `prime-rl-configs` wheel
installed outside the workspace resolves `verifiers 0.3.2.dev152`, and
the workflow's import script passes.
- `uv run pytest tests/unit/test_configs.py tests/unit/eval
tests/unit/orchestrator tests/unit/test_dashboard_timeline.py`: 296
passed (2 vLLM-only tests deselected; `vllm` is not installed on the
test box). `test_load_configs` loads every migrated TOML.
- Real configs and CLI calls against a local mock OpenAI server (no
inference spend). The mock counted the model calls, and the selected
task `idx` matched an independent oracle:
- `uv run eval @ configs/debug/eval/single-turn.toml`: tasks 0–7 × 2, 16
calls.
- `uv run eval @ configs/debug/eval/resume.toml`: first run 16 calls.
`--resume --select.limit 10` restored 16 episodes and ran only tasks 8–9
(4 calls). `--resume --select.include.idx 0:5` kept the landed episodes
of tasks 0–4 and made no model calls.
- `uv run eval gsm8k -n 4 -s --select.exclude.idx '[0]'`: the oracle's 4
tasks, 4 calls.
- A two-source TOML that splits gsm8k into `[:50]` and the rest under a
group `select` default: both sources match the oracle, 5 calls.
- Config checks: train and eval group `select` defaults reach every
source, a source's own fields win, and the resolved `OrchestratorConfig`
re-validates to the same values. `uv run rl -h`, `orchestrator -h` and
`sft -h` list no `-n`/`-s`; `uv run eval -h` does.
- `uv run rl --dry-run` on `configs/debug/algo/grpo.toml`,
`examples/basic/reverse-text/rl.toml` and
`configs/debug/multi-env/rl.toml`, and `uv run sft --dry-run` on
`examples/basic/reverse-text/sft.toml`: group eval limits (128, 64, 32)
resolve onto each source, a per-source `select.limit = 256` is kept, and
train sources default to all tasks.

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking config renames and verifiers-driven
selection/shuffle/task-key semantics affect every train/eval run and
eval resume comparability across the upgrade, though runtime logic is
largely delegated to verifiers.
> 
> **Overview**
> Replaces **`num_examples`** and per-source **`shuffle`** with
verifiers' **`select`** block on every train/eval source (and
group-level `[select]` / `[orchestrator.eval.select]` /
`[eval.select]`). **`select.limit`** caps how many tasks run;
**`include`/`exclude`**, **`shuffle`**, **`skip`**, and **`seed`**
follow verifiers' ordering so prime-rl matches **`vf-eval`** for the
same selection.
> 
> The orchestrator now loads tasks with
**`vf.load_taskset(...).select(source.select)`** instead of client-side
shuffle (seed 42) and **`islice`**. Group config merging layers shared
**`select`** onto each source like **`env`**. **`uv run eval`** maps
**`-n`/`-s`** to **`select.limit`/`select.shuffle`**; eval resume no
longer validates config against the interrupted run—landed episodes are
matched by **`task.key`** to the new **`select`**.
> 
> All example/debug/CI TOMLs, docs, and skills are migrated.
**`verifiers`** minimum is raised to **`0.3.2.dev152`**. The dashboard
expects **`select.limit`** when estimating episode counts.
> 
> **Breaking:** rename configs from **`num_examples`** →
**`select.limit`**, **`shuffle`** → **`select.shuffle`**; default
shuffle seed and task keys may differ from pre-change runs
(resume/comparability implications).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f30798a0a6d20e3a474cb58a6dd48a8a85eb6ace. 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 Opus 5.5 <noreply@anthropic.com>
2026-09-28 15:39:41 -07:00
NeoandGitHub cde3bcd546 Add new chunked loss impl based on torchtitan (#3673)
Port of torchtitan based chunked loss, which greatly imporves perf on
hopper for smaller models:

<html>
<head>

</head>
<body>
<html>
<head>

</head>
<body>

Model | Old chunked head | New chunked head | Gain
-- | -- | -- | --
Qwen3-30B-A3B, 8×H200, no AC, chunk 1024 | 6.71s | 6.20s | −7.6% step
time (+8.2% throughput)
Qwen3-235B-A22B, 4×8 H200, full AC, chunk 2048 | 14.09s | 14.00s | −0.6%
step time


</body>
</html>


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes core LM-head autograd and SFT loss computation; RL/temperature
paths are mostly untouched but shared head code affects all training
modes using injected heads.
> 
> **Overview**
> Adds a **torchtitan-style chunked summed cross-entropy** path on the
fused LM head when `labels` are passed **without** `temperature`, so SFT
no longer fakes unit temperature and negates logprobs (or materializes
full logits on the vanilla path).
> 
> **`FusedOutputLinear`** now branches: no temperature →
`_ChunkedCrossEntropySumFn` returns scalar `loss` and folds
softmax-minus-one-hot grads into hidden/weight during forward (one token
chunk’s full-vocab logits at a time; backward only scales by the
upstream scalar). With temperature, behavior stays on the existing
logprob/entropy path.
> 
> **Vanilla and Gemma** heads mirror the same contract
(`cross_entropy_sum` or Gemma’s chunked logprob sum). SFT **`train.py`**
is unified to masked `IGNORE_INDEX` labels and `out["loss"]`. Config
docs now describe SFT fused-head behavior instead of claiming it is
disabled.
> 
> New unit tests check loss and gradients across fused/vanilla/Gemma
heads and chunk sizes, plus that temperature still uses logprobs.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c4d2601e4cc55d6a921d80a33d19eb2e1407a230. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-09-29 00:33:18 +02:00
Xuan-Phi NguyenandGitHub f962e9c104 feat(rl): add PPO and CISPO loss options (#3697)
## Motivation

The trainer exposes IPO and IcePop but has no built-in PPO or CISPO loss
for controlled math-RL comparisons. PPO clips the token importance-ratio
surrogate; CISPO clips a **detached** importance weight multiplying the
current log probability, so an out-of-band ratio still has a policy
gradient. Both need to operate on the trainer's existing eligible-token
masks and optional per-token weights.

## Design

- Add `PPOLossConfig` / `PPOLoss` with a sign-aware clipped surrogate
(`ratio_low=.8`, `ratio_high=1.2` by default). A separate
`max_importance_ratio=1e4` bounds the otherwise unbounded side while
preserving its capped gradient; metrics report clipped and capped
fractions.
- Add `CISPOLossConfig` / `CISPOLoss`:
`-stop_gradient(clip(p_trainer/p_inference, low, high)) * advantage *
log p_trainer` on eligible tokens. The default lower bound `0` disables
lower clipping; the default upper bound is `5`. Metrics report the
clipped fraction.
- Register both as explicit `trainer.loss.type` choices. Existing loss
defaults and model precision fields are unchanged. #3696 is merged into
main and supplies the stable ratio arithmetic used by the new losses.

## Validation completed

- On the pre-restack head, the GPU loss and config suite had **213
passed**, covering PPO/CISPO values, advantage signs, clipping
gradients, masks, and config validation. Focused rerun after metric
cleanup: **4 passed**. Ruff check/format and SLURM dry run passed.
- At the current #3697 head, 192 config tests, a CPU PPO/CISPO
forward/backward smoke check, and Ruff check/format passed. Four focused
PPO/CISPO GPU tensor tests passed on GPU 7 of
`prime-nebius-puku-h200-gpu-059`, covering clipping, gradients, extreme
ratios, and masks. No full model test was run.
- One-node CISPO smoke job `1575` completed two optimizer updates with
finite loss, entropy, and mismatch KL; orchestrator reward was `0.3125`
then `0.4062` on 32 trainable traces per step, with no episode errors.
It was intentionally stopped after that validation: [W&B
run](https://wandb.ai/primeintellect/qwen30b-math/runs/0c0bb28ed7734551b600cbe52253d7f5).

## Ongoing experiment and private TOML provenance

CISPO job on math qwen3-30b-3a is pending validation. The long-run
reward and stability outcome remains pending.
2026-09-28 13:34:56 -07:00
57 changed files with 765 additions and 519 deletions
-16
View File
@@ -137,22 +137,6 @@ RUN --mount=type=cache,target=/usr/local/share/uv/cache \
&& \
/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")]'
# Needed for private environments hub auth.
#
# FIXME(prime#940): workaround, remove once the prime CLI drops verifiers as
# a dependency (https://github.com/PrimeIntellect-ai/prime/pull/940). The CLI
# pins verifiers==0.2.0, which replaced the editable verifiers synced above
# with the PyPI wheel and left prime-rl's own entrypoints unable to import;
# the --overrides file ignores that one requirement. When removing it, drop
# the overrides file and the --overrides flag, keep the import assertion, and
# make the same change in scripts/docker-entrypoint.sh, which replays this
# step for the runtime source overlay.
RUN --mount=type=cache,target=/usr/local/share/uv/cache \
printf 'verifiers\n' > /tmp/prime-cli-overrides.txt \
&& VIRTUAL_ENV=/app/.venv uv pip install --overrides /tmp/prime-cli-overrides.txt 'prime>=0.7' \
&& rm /tmp/prime-cli-overrides.txt \
&& /app/.venv/bin/python -c 'import pathlib, verifiers; assert pathlib.Path(verifiers.__file__).is_relative_to("/app/deps/verifiers"), verifiers.__file__'
# Build NIXL from source against the UCX 1.19 baked above. The PyPI nixl wheel
# ships its own UCX which segfaults on prefill→decode KV transfer (#2883);
# rebuilding against our UCX is the documented fix. The rename is required: an
+3 -1
View File
@@ -22,7 +22,9 @@ lr = 2e-5
[eval]
interval = 25
num_examples = 32
[eval.select]
limit = 32
[eval.sampling]
max_completion_tokens = 1024
+3 -1
View File
@@ -1,8 +1,10 @@
# CI eval smoke: gsm8k with the null harness in a local subprocess runtime against
# Prime Inference — the eval path end to end without a GPU or sandbox.
num_examples = 4
dashboard = false
[select]
limit = 4
[sampling]
max_completion_tokens = 8192
@@ -48,7 +48,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 16
[orchestrator.eval.select]
limit = 16
[orchestrator.eval.sampling]
max_completion_tokens = 128
@@ -54,7 +54,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 16
[orchestrator.eval.select]
limit = 16
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -29,7 +29,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -29,7 +29,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -48,7 +48,9 @@ algo.teacher.base_url = "http://localhost:8001/v1"
[orchestrator.eval]
interval = 5
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -41,7 +41,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -41,7 +41,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -31,7 +31,9 @@ env.player1.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 16
[orchestrator.eval.select]
limit = 16
[orchestrator.eval.sampling]
max_completion_tokens = 512
+3 -1
View File
@@ -37,7 +37,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -46,7 +46,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+3 -1
View File
@@ -46,7 +46,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 1
num_examples = 128
[orchestrator.eval.select]
limit = 128
[orchestrator.eval.sampling]
max_completion_tokens = 128
+1 -1
View File
@@ -117,7 +117,7 @@ interval = 20
[[orchestrator.eval.source]]
name = "swebench-verified"
num_examples = 100
select.limit = 100
env.taskset.id = "swebench-verified"
env.agent.harness.id = "bash"
env.agent.runtime.labels = ["debug-concurrency"]
+2 -1
View File
@@ -5,7 +5,8 @@
#
# uv run eval @ configs/debug/eval/multi-env.toml
num_examples = 16
[select]
limit = 16
[[source]]
name = "tb2-bash"
+2 -1
View File
@@ -4,7 +4,8 @@
#
# uv run eval @ configs/debug/eval/multi-turn.toml
num_examples = 16
[select]
limit = 16
[[source]]
env.taskset.id = "terminal-bench-2"
+3 -1
View File
@@ -7,9 +7,11 @@
# <Ctrl-C partway>
# uv run eval @ configs/debug/eval/resume.toml --run.name resume-debug --resume
num_examples = 8
group_size = 2
[select]
limit = 8
[concurrency]
min_inflight = 2
max_inflight = 2
+3 -1
View File
@@ -3,9 +3,11 @@
#
# uv run eval @ configs/debug/eval/single-turn.toml
num_examples = 8
group_size = 2
[select]
limit = 8
[sampling]
max_completion_tokens = 8192
+3 -1
View File
@@ -31,7 +31,9 @@ env.agent.runtime.type = "subprocess"
[orchestrator.eval]
interval = 5
num_examples = 64
[orchestrator.eval.select]
limit = 64
[orchestrator.eval.sampling]
max_completion_tokens = 128
+1 -1
+7
View File
@@ -180,6 +180,13 @@ retries.include = ["ProviderError", "SandboxError"]
timeout.episode = 7200
```
Each source also takes a `select` block that picks which tasks of its taskset run: `include`/`exclude` by task `idx`/`ids`/`keys`/`names`, then `shuffle`, `skip` and `limit`, in that order. A group's `select` block works like its `env` block: every source inherits it field by field, and a source's own fields win. A source's `include` or `exclude` replaces the group's whole block. To evaluate 128 tasks of each taskset:
```toml
[orchestrator.eval.select]
limit = 128
```
`ratio` is a training-source field: it defaults to `1` (equal weight per env), and values are relative weights normalized to probabilities across envs. Eval sources of a training run carry `interval` instead, the step interval at which they fire (inherited from the group-level `interval` when unset); a standalone eval has neither.
Everything environment lives under the `env` block (verifiers' `[env]` shape): `env.taskset` configures the v1 taskset, and each agent is a field on the env — `env.agent.harness` selects how the single-agent env's tasks are run, and per-run caps are per-agent (`env.agent.max_turns`, `env.agent.timeout`, `env.agent.max_output_tokens`). A multi-agent env declares its own seats (`env.<role>.*`).
+10 -5
View File
@@ -32,19 +32,21 @@ uv run inference --vllm.model Qwen/Qwen3-4B
uv run eval gsm8k -n 32 -r 4 -m Qwen/Qwen3-4B --client.base_url http://localhost:8000/v1
```
Single-source shorthands: `<taskset-id>` names the run's only source, `--env.<field> <value>` sets a field of that source's env block (`--env.agent.harness.id bash`, `--env.taskset.tasks '["fix-git"]'`), `-n`/`-r` set `num_examples`/`group_size`, `-m` the model, and `-c N` pins the concurrency band (`concurrency.min_inflight = max_inflight = N`). `<taskset-id>` cannot be combined with a TOML that defines `[[source]]` blocks; next to one, `--env.<field>` sets the shared [env block](#configuration) instead. `uv run eval -h` lists them.
Single-source shorthands: `<taskset-id>` names the run's only source, `--env.<field> <value>` sets a field of that source's env block (`--env.agent.harness.id bash`, `--env.taskset.tasks '["fix-git"]'`), `-n`/`-s`/`-r` set `select.limit`/`select.shuffle`/`group_size`, `-m` the model, and `-c N` pins the concurrency band (`concurrency.min_inflight = max_inflight = N`). `<taskset-id>` cannot be combined with a TOML that defines `[[source]]` blocks; next to one, `--env.<field>` sets the shared [env block](#configuration) instead. `uv run eval -h` lists them.
Against a local vLLM deployment, set `min_inflight < max_inflight` in `[concurrency]` to dynamically adjust the number of concurrent episodes for maximum throughput. An external API exposes no vLLM `/metrics` to adapt to, so pin the concurrency there (`-c N`, i.e. `min_inflight = max_inflight`).
## Configuration
Multi-source runs use a TOML (`EvalConfig` in `packages/prime-rl-configs/src/prime_rl/configs/eval.py`). The eval block is flattened to the top level — `[[source]]`, `[client]`, `[concurrency]`, `[sampling]`, `num_examples`, `group_size` — and each source takes the same `env` block as `[[orchestrator.eval.source]]`:
Multi-source runs use a TOML (`EvalConfig` in `packages/prime-rl-configs/src/prime_rl/configs/eval.py`). The eval block is flattened to the top level — `[[source]]`, `[client]`, `[concurrency]`, `[sampling]`, `[select]`, `group_size` — and each source takes the same `env` block as `[[orchestrator.eval.source]]`:
```toml
model = "Qwen/Qwen3-4B"
num_examples = 32
group_size = 4
[select] # every source inherits these
limit = 32
[client]
base_url = "http://localhost:8000/v1"
@@ -67,9 +69,12 @@ env.agent.harness.id = "bash"
env.taskset.id = "aime25"
env.agent.harness.id = "null"
env.agent.runtime.type = "subprocess"
select.include.idx = ["0:30"]
```
Per-source `num_examples`, `group_size` and `sampling` override the top-level defaults. The top-level `[env]` block holds the env knobs that every source inherits (see [Environments](configuration.md#environments)); a source's own `env` values win.
Per-source `group_size` and `sampling` override the top-level defaults. The top-level `[env]` block holds the env knobs that every source inherits (see [Environments](configuration.md#environments)); a source's own `env` values win.
Each field a source sets in its `select` overrides the same field of the top-level `[select]`. `select` picks which tasks of the taskset run: `include`/`exclude` by task `idx`/`ids`/`keys`/`names`, then `shuffle`, `skip` and `limit` (see verifiers' [Selecting tasks](../deps/verifiers/docs/v1/tasksets.md#selecting-tasks)). Train sources take the same `select`.
Every source's env server is spawned by the eval process unless the source sets `serve.address`, in which case the server is externally managed. A spawned server binds an OS-assigned loopback port and publishes it to `configs/attempt_N/resolved/envs/eval/<name>.address`, which the eval process reads, so concurrent runs on one host never collide on a port.
@@ -85,7 +90,7 @@ uv run eval @ eval.toml --run.name my-eval --resume
The previous attempt's `monitors/file` is kept as `monitors/file.attempt_N`; the resumed attempt writes a fresh one. Nothing is deleted, and a resume reads every attempt's stream.
A landed episode counts toward the task with its `task.key`, so `num_examples` and `group_size` may change between the two launches: kept episodes are matched to the new selection and the rest is owed. The model, the sampling and each source's env must match the config the landed episodes were measured with (kept beside them in `monitors/file/eval.json`); a resume that changes them stops with the differing config paths. Rollouts that complete a task's landed group join that group, so pass@k and the dashboard see one group per task. Use `--clean` to start over instead.
A landed episode counts toward the task with its `task.key`, so `select` and `group_size` may change between the two launches: kept episodes are matched to the new selection and the rest is owed. The resumed config is not checked against the interrupted one: any of it may be overridden, so keep the model, the sampling and each source's env the same when the landed episodes must stay comparable. Rollouts that complete a task's landed group join that group, so pass@k and the dashboard see one group per task. Use `--clean` to start over instead.
## Monitors
+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.29 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`. Standard deployments use the V2 model runner. Disaggregated P/D remains on V1 because NIXL routed-expert stitching is V1-only.
```toml
[trainer]
+4 -2
View File
@@ -184,12 +184,14 @@ Multi-GPU and multi-node use torchrun under the hood (the `sft` entrypoint manag
### Online Evals
`uv run sft` can evaluate the model on rollout-based envs as it trains, reusing the RL orchestrator's eval machinery. Configure an `[eval]` block — the same shape as `[orchestrator.eval]`: multiple `[[eval.source]]` envs with per-source `interval` / `num_examples` / `group_size` / sampling overrides — plus an `[inference]` block for the vLLM server:
`uv run sft` can evaluate the model on rollout-based envs as it trains, reusing the RL orchestrator's eval machinery. Configure an `[eval]` block — the same shape as `[orchestrator.eval]`: multiple `[[eval.source]]` envs with per-source `interval` / `select` / `group_size` / sampling overrides — plus an `[inference]` block for the vLLM server:
```toml
[eval]
interval = 25
num_examples = 32
[eval.select]
limit = 32
[[eval.source]]
name = "reverse-text"
+1 -1
View File
@@ -148,7 +148,7 @@ interval = 20
[[orchestrator.eval.source]]
name = "browsecomp"
num_examples = 500 # full set is 1266; cap eval at 500
select.limit = 500 # full set is 1266; cap eval at 500
env.agent.harness.id = "rlm"
env.agent.harness.skills = ["search"]
env.agent.harness.forward_env = ["SERPER_API_KEY"]
+3 -1
View File
@@ -5,9 +5,11 @@
# uv run eval @ examples/basic/alphabet-sort/eval.toml
model = "Qwen/Qwen3-4B-Instruct-2507"
num_examples = 20
group_size = 3
[select]
limit = 20
[client]
base_url = "http://localhost:8000/v1"
+3 -1
View File
@@ -5,9 +5,11 @@
# uv run eval @ examples/basic/reverse-text/eval.toml
model = "Qwen/Qwen3-0.6B"
num_examples = 20
group_size = 3
[select]
limit = 20
[client]
base_url = "http://localhost:8000/v1"
+1 -1
View File
@@ -29,7 +29,7 @@ max_completion_tokens = 128
[[orchestrator.eval.source]]
name = "reverse-text-eval"
num_examples = 256
select.limit = 256
env.taskset.id = "reverse-text"
env.agent.harness.id = "null"
env.agent.runtime.type = "subprocess"
+3 -1
View File
@@ -15,7 +15,9 @@ lr = 2e-5
[eval]
interval = 25
num_examples = 32
[eval.select]
limit = 32
[eval.sampling]
max_completion_tokens = 1024
+3 -1
View File
@@ -5,9 +5,11 @@
# uv run eval @ examples/basic/wiki-search/eval.toml
model = "Qwen/Qwen3-4B-Instruct-2507"
num_examples = 20
group_size = 3
[select]
limit = 20
[client]
base_url = "http://localhost:8000/v1"
+3 -1
View File
@@ -5,9 +5,11 @@
# uv run eval @ examples/basic/wordle/eval.toml
model = "Qwen/Qwen3-1.7B"
num_examples = 20
group_size = 3
[select]
limit = 20
[client]
base_url = "http://localhost:8000/v1"
+1 -1
View File
@@ -10,7 +10,7 @@ dependencies = [
"renderers>=0.1.11",
"tomli>=2.2.1",
"tomli-w>=1.2.0",
"verifiers>=0.3.2.dev143",
"verifiers>=0.3.2.dev152",
]
[build-system]
@@ -1,6 +1,7 @@
import uuid
from pathlib import Path
import verifiers.v1 as vf
from pydantic import AliasChoices, Field, model_validator
from prime_rl.configs.monitors import EvalMonitorsConfig, MonitorsConfig
@@ -57,14 +58,15 @@ class EvalConfig(ServedEvalConfig):
client: ClientConfig = ClientConfig(base_url=PRIME_INFERENCE_URL, api_key_var="PRIME_API_KEY")
"""Client of the inference server. Defaults to Prime Inference."""
select: vf.SelectCLIConfig = vf.SelectCLIConfig()
"""Task selection that every source inherits (``-n`` sets ``limit``, ``-s`` sets
``shuffle``). Each field a source sets on its own ``select`` wins over this one."""
concurrency: ConcurrencyConfig = ConcurrencyConfig(min_inflight=128, max_inflight=128)
"""In-flight episodes, pinned at 128 (``-c N`` repins). External APIs expose no vLLM
``/metrics`` to adapt to; against a vLLM server set ``min_inflight < max_inflight`` to
let the band adapt to KV usage like the orchestrator's."""
num_examples: int = Field(-1, validation_alias=AliasChoices("num_examples", "n"))
"""Default eval examples per environment. ``-1`` uses all. Can be overridden per env."""
group_size: int = Field(1, ge=1, validation_alias=AliasChoices("group_size", "r"))
"""Default rollouts per example. Can be overridden per env."""
@@ -87,9 +89,7 @@ class EvalConfig(ServedEvalConfig):
resume: bool = False
"""Continue the interrupted run named by ``run.name`` from its trace stream: the
landed episodes rejoin the epoch and only the rollouts still owed run. The model,
sampling and env config must match the interrupted run; ``num_examples`` and
``group_size`` may change."""
landed episodes rejoin the epoch and only the rollouts still owed run."""
log: LogConfig = LogConfig()
@@ -640,6 +640,11 @@ class InferenceConfig(BaseConfig):
if "enable_prompt_tokens_details" not in extra_fields:
namespace.enable_prompt_tokens_details = True
# The orchestrator generates through /inference/v1/generate, a scale-out
# endpoint that vLLM registers only with `--enable-scale-out`.
if "enable_scale_out" not in extra_fields:
namespace.enable_scale_out = True
# vLLM's DeepseekV2-family (and transformers-backend MoE) gates read
# `moe_router_dtype` off the HF config to pick the router logits dtype.
if self.enable_fp32_router_logits:
@@ -166,8 +166,8 @@ 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."""
select: vf.SelectConfig = vf.SelectConfig()
"""Which of the taskset's tasks this source uses: ``include``/``exclude`` by ``idx``, ``ids``, ``keys`` or ``names``, then ``shuffle``, ``skip`` and ``limit``, applied in that order."""
@model_validator(mode="before")
@classmethod
@@ -194,22 +194,51 @@ class EnvConfig(BaseConfig):
return self
def merge_group_env(data: Any) -> Any:
"""Shared ``mode="before"`` body for source groups: layer the group's ``env`` block
under the ``env`` block of each raw source."""
if not isinstance(data, dict) or data.get("env") is None:
def merge_group_defaults(data: Any) -> Any:
"""Shared ``mode="before"`` body for source groups: layer the group's ``env`` and
``select`` blocks under those of each raw source. A source's own values win; a
source's ``include`` or ``exclude`` replaces the group's whole block."""
if not isinstance(data, dict):
return data
try:
shared = vf.SharedEnvConfig.model_validate(data["env"])
except ValidationError:
return data # the ``env`` field reports the errors once, not once per source
data["source"] = [
{**source, "env": vf.merge_env_defaults(shared, source.get("env"))} if isinstance(source, dict) else source
for source in data.get("source") or []
]
sources = data.get("source") or []
if data.get("env") is not None:
try:
shared = vf.SharedEnvConfig.model_validate(data["env"])
except ValidationError:
shared = None # the ``env`` field reports the errors once, not once per source
if shared is not None:
sources = [
{**source, "env": vf.merge_env_defaults(shared, source.get("env"))}
if isinstance(source, dict)
else source
for source in sources
]
if data.get("select") is not None:
group = select_fields(data["select"], vf.SelectCLIConfig)
if group is not None:
sources = [
{**source, "select": group | own}
if isinstance(source, dict)
and (own := select_fields(source.get("select"), vf.SelectConfig)) is not None
else source
for source in sources
]
if sources:
data["source"] = sources
return data
def select_fields(raw: Any, select_type: type[vf.SelectConfig]) -> dict | None:
"""The fields a raw ``select`` block sets, under their canonical names; None when
the block is invalid, which leaves it to report its own errors."""
if raw is None:
return {}
try:
return select_type.model_validate(raw).model_dump(exclude_unset=True)
except ValidationError:
return None
class StandardSamplerConfig(BaseConfig):
type: Literal["standard"] = "standard"
@@ -306,9 +335,6 @@ class EvalSourceConfig(EnvConfig):
sampling: EvalSamplingConfig = EvalSamplingConfig()
"""Per-env sampling overrides. Unset fields inherit from the group-level eval sampling config."""
num_examples: int = -1
"""Eval examples to sample from the dataset. ``-1`` uses all available examples."""
group_size: int = Field(1, ge=1)
"""Rollouts generated per example. Used for pass@k estimation (e.g. ``group_size=8`` enables pass@1 through pass@8)."""
@@ -331,10 +357,14 @@ class TrainConfig(BaseConfig):
sampling: TrainSamplingConfig = TrainSamplingConfig()
"""Shared training sampling configuration."""
select: vf.SelectConfig = vf.SelectConfig()
"""Task selection that every training source inherits. Each field a source sets on
its own ``select`` wins over this one."""
@model_validator(mode="before")
@classmethod
def resolve_group_env(cls, data):
return merge_group_env(data)
def resolve_group_defaults(cls, data):
return merge_group_defaults(data)
@model_validator(mode="after")
def resolve_env_defaults(self):
@@ -373,21 +403,23 @@ class EvalSourcesConfig(BaseConfig):
sampling: EvalSamplingConfig = Field(default_factory=EvalSamplingConfig)
"""Shared eval sampling configuration; can differ from training sampling."""
num_examples: int = -1
"""Default eval examples per environment. ``-1`` uses all. Can be overridden per env."""
select: vf.SelectConfig = vf.SelectConfig()
"""Task selection that every eval source inherits, e.g. ``limit = 128`` to evaluate
128 tasks of each taskset. Each field a source sets on its own ``select`` wins over
this one."""
group_size: int = Field(1, ge=1)
"""Default rollouts per example. Can be overridden per env."""
@model_validator(mode="before")
@classmethod
def resolve_group_env(cls, data):
return merge_group_env(data)
def resolve_group_defaults(cls, data):
return merge_group_defaults(data)
@model_validator(mode="after")
def resolve_env_defaults(self):
"""Resolve per-env overrides: inherit group-level sampling, num_examples and
group_size (the worker ``pool`` is configured per env, default elastic)."""
"""Resolve per-env overrides: inherit group-level sampling and group_size (the
worker ``pool`` is configured per env, default elastic)."""
group_sampling = self.sampling.model_dump()
for source in self.source:
if "sampling" not in source.model_fields_set:
@@ -395,8 +427,6 @@ class EvalSourcesConfig(BaseConfig):
else:
merged = group_sampling | source.sampling.model_dump(exclude_unset=True)
source.sampling = EvalSamplingConfig(**merged)
if "num_examples" not in source.model_fields_set:
source.num_examples = self.num_examples
if "group_size" not in source.model_fields_set:
source.group_size = self.group_size
return self
@@ -345,7 +345,7 @@ class ModelConfig(BaseModelConfig):
"""Debugging knobs for the model and distributed training."""
fused_lm_head_token_chunk_size: int | Literal["disabled"] = 8192
"""Flattened token chunk size for the fused LM head. ``int >= 1`` sets the tokens per LM-head chunk explicitly; ``disabled`` uses the vanilla LM head. SFT training silently disables this (not supported yet)."""
"""Flattened token chunk size for the fused LM head. ``int >= 1`` sets the tokens per LM-head chunk explicitly; ``disabled`` uses the vanilla LM head. In SFT the fused head computes the summed cross-entropy and its gradients chunk by chunk, holding one chunk's full-vocab logits at a time."""
@model_validator(mode="after")
def trust_remote_code_only_with_hf(self):
@@ -603,6 +603,41 @@ class IcePopLossConfig(BaseConfig):
return self
class PPOLossConfig(BaseConfig):
type: Literal["ppo"] = "ppo"
ratio_low: float = Field(0.8, gt=0, le=1, allow_inf_nan=False)
"""Lower ratio bound for the clipped surrogate."""
ratio_high: float = Field(1.2, ge=1, allow_inf_nan=False)
"""Upper ratio bound for the clipped surrogate."""
max_importance_ratio: float = Field(1e4, ge=1, allow_inf_nan=False)
"""Cap the unbounded side of the surrogate while preserving its gradient."""
adv_tau: float = Field(1.0, ge=0)
"""Temperature for the advantage term."""
@model_validator(mode="after")
def validate_max_importance_ratio(self):
if self.max_importance_ratio < self.ratio_high:
raise ValueError("max_importance_ratio must be at least ratio_high")
return self
class CISPOLossConfig(BaseConfig):
type: Literal["cispo"] = "cispo"
ratio_low: float = Field(0.0, ge=0, le=1, allow_inf_nan=False)
"""Lower bound for the detached importance weight; zero disables lower clipping."""
ratio_high: float = Field(5.0, ge=1, allow_inf_nan=False)
"""Upper bound for the detached importance weight."""
adv_tau: float = Field(1.0, ge=0)
"""Temperature for the advantage term."""
class CustomLossConfig(BaseConfig):
type: Literal["custom"] = "custom"
@@ -613,7 +648,9 @@ class CustomLossConfig(BaseConfig):
"""Kwargs forwarded to the loss function."""
LossConfig: TypeAlias = Annotated[IPOLossConfig | IcePopLossConfig | CustomLossConfig, Field(discriminator="type")]
LossConfig: TypeAlias = Annotated[
IPOLossConfig | IcePopLossConfig | PPOLossConfig | CISPOLossConfig | CustomLossConfig, Field(discriminator="type")
]
class FakeDataLoaderConfig(BaseConfig):
+10 -10
View File
@@ -16,7 +16,7 @@ dependencies = [
"transformers==5.6.2",
"wandb>=0.26.1",
"wandb-workspaces>=0.4.3",
"prime-sandboxes>=0.3.2",
"prime>=0.8.0",
"prime-runs[train]>=0.1.3",
"pyzmq>=27.1.0",
"aiolimiter>=1.2.1",
@@ -29,7 +29,7 @@ dependencies = [
"rich>=14.0.0",
"setproctitle>=1.3.0",
"uvloop>=0.21.0",
"verifiers[harbor]>=0.3.2.dev143",
"verifiers[harbor]>=0.3.2.dev152",
"renderers[multimodal]>=0.1.12.dev2",
"pybase64>=1.4.2",
"orjson>=3.10",
@@ -56,7 +56,7 @@ gpu = [
"torchvision ; sys_platform == 'linux'",
"torchaudio ; sys_platform == 'linux'",
"torchdata>=0.11.0 ; sys_platform == 'linux'",
"vllm>=0.29.0 ; sys_platform == 'linux'",
"vllm>=0.30.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,9 +146,9 @@ 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.29.0 requires quack-kernels 0.6.4. It requires this exact CUTLASS version.
# vLLM 0.30.0 requires this exact CUTLASS DSL version and quack-kernels 0.6.5.
# Keep this pin aligned with quack-kernels and the flash-attn-4 revision below.
"nvidia-cutlass-dsl==4.6.2",
"nvidia-cutlass-dsl==4.7.1",
"transformers==5.6.2",
"torch>=2.13.0",
"openenv-core",
@@ -217,10 +217,10 @@ requires-dist = ["nixl-cu13==0.10.1"]
# so resolve that variant without installing both runtime packages.
[[tool.uv.dependency-metadata]]
name = "nvidia-cutlass-dsl"
version = "4.6.2"
version = "4.7.1"
requires-dist = [
"nvidia-cutlass-dsl-libs-base==4.6.2",
"nvidia-cutlass-dsl-libs-cu13==4.6.2",
"nvidia-cutlass-dsl-libs-base==4.7.1",
"nvidia-cutlass-dsl-libs-cu13==4.7.1",
]
[tool.uv.exclude-newer-package]
@@ -274,8 +274,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.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'" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_x86_64.whl", marker = "platform_machine == 'x86_64'" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.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'" },
+1 -16
View File
@@ -58,7 +58,7 @@ if [ -n "$PRIME_RL_REF" ]; then
# submodules' git metadata so the fallback is what gets used. The
# shallow clones carry no tags, so hatch-vcs would otherwise stamp
# them 0.0.1.dev1 and every `verifiers>=…` floor in the tree would be
# unmet, letting the CLI install below swap the editable for a wheel.
# unmet.
if [ -f "$DEST/scripts/docker-editable-pretend-versions.sh" ]; then
eval "$(bash "$DEST/scripts/docker-editable-pretend-versions.sh" --shell "$DEST")"
rm -f "$DEST/deps/verifiers/.git" "$DEST/deps/renderers/.git"
@@ -115,21 +115,6 @@ HEAVY_PINS_PY
--extra gpu --extra dashboard --extra flash-attn --extra flash-attn-3 \
--extra flash-attn-cute --extra disagg --extra quack --extra kernels \
--group mamba-ssm )
# Replay the image's post-sync step (Dockerfile.cuda; keep the two in
# sync): the prime CLI pulls prime-traces / prime-sandboxes / openai
# past the lock's pins, and the --locked sync above just rolled them
# back, which leaves `prime env install` unable to import.
#
# FIXME(prime#940): workaround, remove once the prime CLI drops
# verifiers as a dependency
# (https://github.com/PrimeIntellect-ai/prime/pull/940). The CLI pins
# verifiers==0.2.0, which would swap the editable for the PyPI wheel
# and break prime-rl's imports; the --overrides file ignores that one
# requirement. When removing it, drop the overrides file and the
# --overrides flag here and in Dockerfile.cuda.
echo "[prime-rl] installing the prime CLI"
printf 'verifiers\n' > /tmp/prime-cli-overrides.txt
uv pip install --overrides /tmp/prime-cli-overrides.txt 'prime>=0.7'
# The chart's `uv run --no-sync <entrypoint>` commands resolve the
# project from the cwd; the venv itself stays /app/.venv via
# UV_PROJECT_ENVIRONMENT above.
-3
View File
@@ -134,9 +134,6 @@ main() {
source $HOME/.local/bin/env
fi
log_info "Installing prime..."
uv tool install prime
log_info "Syncing virtual environment..."
uv sync --all-extras
+1 -1
View File
@@ -65,7 +65,7 @@ env.agent.runtime.type = "subprocess"
Source lists are set in TOML. The CLI has no list-index paths (`--orchestrator.eval.source.0.env.taskset.id` does not parse); a whole list can be passed as JSON (`--orchestrator.eval.source '[{"env": {"taskset": {"id": "reverse-text"}}}]'`), which replaces the list wholesale.
The `sft` entrypoint takes the same eval shape at the top level for online evals: `[eval]` + `[[eval.source]]` (with `[inference]` for the server). The `eval` entrypoint flattens it further: `[[source]]`, `[client]`, `[concurrency]`, `num_examples`, `group_size` at the top level, plus the single-source shorthands `uv run eval <taskset-id> --env.<field> <value> -n N -r N -c N -m MODEL` (see the `eval` skill).
The `sft` entrypoint takes the same eval shape at the top level for online evals: `[eval]` + `[[eval.source]]` (with `[inference]` for the server). The `eval` entrypoint flattens it further: `[[source]]`, `[client]`, `[concurrency]`, `[select]`, `group_size` at the top level, plus the single-source shorthands `uv run eval <taskset-id> --env.<field> <value> -n N -s -r N -c N -m MODEL` (see the `eval` skill).
**Dicts** — TOML uses a section; CLI takes a JSON string: `--trainer.env-vars '{"key1": "value1"}'`. This works for plain `dict` fields only — nested pydantic-model fields (e.g. `algo`) reject JSON strings; use dotted keys (`--orchestrator.algo.type max_rl`) or a TOML overlay file.
+38 -4
View File
@@ -23,18 +23,20 @@ uv run eval @ eval.toml --monitors.prime # stream eac
- Config: `EvalConfig` (`packages/prime-rl-configs/src/prime_rl/configs/eval.py`); `uv run eval -h` lists the fields.
- Entrypoint: `src/prime_rl/entrypoints/eval.py`; implementation `src/prime_rl/eval/eval.py`, shared engine `src/prime_rl/eval/runner.py`.
- Shorthands (single-source runs): `<taskset-id>`, `--env.<field> <value>`, `-n` `num_examples`, `-r` `group_size`, `-m` `model`, `-c N` pins `concurrency.min_inflight = max_inflight = N`. They cannot be combined with a TOML that defines `[[source]]` blocks.
- Shorthands (single-source runs): `<taskset-id>`, `--env.<field> <value>`, `-n` `select.limit`, `-s` `select.shuffle`, `-r` `group_size`, `-m` `model`, `-c N` pins `concurrency.min_inflight = max_inflight = N`. They cannot be combined with a TOML that defines `[[source]]` blocks.
- Concurrency: an API exposes no vLLM `/metrics`, so run pinned there; against `uv run inference` set `min_inflight < max_inflight` in `[concurrency]` to adapt to KV usage.
- Env servers: spawned per source on OS-assigned ports (published to `configs/attempt_N/resolved/envs/eval/<name>.address`) unless the source sets `serve.address`.
- Ready-made configs: `configs/debug/eval/*.toml`, one per shape (single turn, multi turn, resume, multi env, aime2026, tb2).
Minimal multi-source TOML (the eval block is flattened to the top level; per-source `num_examples`, `group_size`, `sampling` override the top level):
Minimal multi-source TOML (the eval block is flattened to the top level; per-source `select`, `group_size`, `sampling` override the top level):
```toml
model = "Qwen/Qwen3-4B"
num_examples = 32
group_size = 4
[select]
limit = 32
[client]
base_url = "http://localhost:8000/v1"
@@ -48,6 +50,38 @@ env.agent.harness.id = "null"
env.agent.runtime.type = "subprocess"
```
## Select tasks
`select` picks which tasks of a source's taskset run. The steps apply in a fixed order: `include` and `exclude` (by `idx` position, `ids`, `keys` or `names`), then `shuffle` (under `seed`, default 0), `skip`, `limit`. Set it once for every source of a group (`[select]` in an eval TOML, `[orchestrator.eval.select]`, `[orchestrator.train.select]`), or per source (`select.limit = 50` in a `[[source]]`); a source's own fields win.
```bash
uv run eval gsm8k -n 50 # the first 50 tasks
uv run eval gsm8k -n 50 -s # a random subset of 50 (same tasks every run)
uv run eval gsm8k -n 50 -s --select.seed 1 # another random subset
uv run eval gsm8k --select.include.idx 0:10,42 # tasks by position (ints and Python slices)
uv run eval terminal-bench-2 --select.include.names '["fix-git"]' # tasks by name; `ids` and `keys` work the same
uv run eval terminal-bench-2 --select.exclude.keys '["<task.key>"]' # drop known-broken tasks (keys are on every trace)
```
Disjoint train/test splits from one taskset:
```toml
# contiguous: eval on the first 100 tasks, train on the rest
[[orchestrator.eval.source]]
env.taskset.id = "gsm8k"
select.include.idx = [":100"]
[[orchestrator.train.source]]
env.taskset.id = "gsm8k"
select.exclude.idx = [":100"]
# random: the same shuffle on both sides; eval takes 100, train skips them
# eval: select.shuffle = true, select.limit = 100
# train: select.shuffle = true, select.skip = 100
```
The shuffle comes before `skip` and `limit`, so a larger `limit` extends the same selection: resuming a `-n 50 -s` run with `-n 100` keeps the 50 landed tasks and adds 50 more.
## Monitor an eval
Run dir: `output_dir / run.name` (auto `<envs>--<model>--<short-id>`; `ls -t outputs | head -1` finds the latest). The console stays quiet while the eval runs; everything is in the files and the dashboard (`dashboard` skill).
@@ -72,4 +106,4 @@ The progress line in `eval.log` counts live rollouts by phase (`- boot 1 · runn
Metrics live under `eval/<env>/all/<agent>/…` (`reward/mean`, `is_truncated/mean` — raise `sampling.max_completion_tokens` when high, `has_error/mean`, the taskset's own metrics). Validate a result by reading a few traces in the dashboard rather than trusting the mean alone.
Stop a run with SIGINT/SIGTERM to the eval PID (`ps aux | grep PRL::Eval`); `--resume` restores the landed episodes from the trace stream and runs only the rollouts still owed (`num_examples`/`group_size` may change, the model, sampling and env config may not). Env servers are children of the eval process and exit with it.
Stop a run with SIGINT/SIGTERM to the eval PID (`ps aux | grep PRL::Eval`); `--resume` restores the landed episodes from the trace stream and runs only the rollouts still owed. Any config may be overridden on resume (`select`/`group_size` change what is owed); keep the model, sampling and env config the same to keep the landed episodes comparable. Env servers are children of the eval process and exit with it.
+8 -7
View File
@@ -272,13 +272,14 @@ def eval_env(config: dict) -> str | None:
def source_total_episodes(source: dict) -> int | None:
"""What one ``[[source]]`` will produce, from its config alone: ``num_examples = -1``
means the whole taskset, unknown up front unless the source names its tasks."""
tasks = ((source.get("env") or {}).get("taskset") or {}).get("tasks")
count = source.get("num_examples") or -1
if count < 0 and not tasks:
"""What one ``[[source]]`` will produce, from its config alone: without a
``select.limit`` the count is unknown up front unless the source names its tasks."""
taskset = (source.get("env") or {}).get("taskset") or {}
limit = (source.get("select") or {}).get("limit")
tasks = taskset.get("tasks")
if limit is None and not tasks:
return None
return (count if count >= 0 else len(tasks)) * (source.get("group_size") or 1)
return (limit if limit is not None else len(tasks)) * (source.get("group_size") or 1)
def eval_totals(config: dict) -> dict[str, int | None]:
@@ -294,7 +295,7 @@ def eval_total_episodes(config: dict) -> int | None:
if sources:
totals = [source_total_episodes(s) for s in sources]
return None if any(t is None for t in totals) else sum(totals) or None
return (config.get("num_tasks") or 0) * (config.get("num_rollouts") or 0) or None
return ((config.get("select") or {}).get("limit") or 0) * (config.get("num_rollouts") or 0) or None
def run_meta(run_dir: Path) -> dict:
+1 -1
View File
@@ -21,7 +21,7 @@ from prime_rl.utils.config import cli, dump_resolved_config
from prime_rl.utils.process import DEFAULT_COMMON_ENV_VARS, cleanup_processes, set_proc_title
USAGE = """\
usage: uv run eval [<taskset-id>] [--env.<field> <value> ...] [-n N] [-r N] [-c N] [-m MODEL] [options]
usage: uv run eval [<taskset-id>] [--env.<field> <value> ...] [-n N] [-s] [-r N] [-c N] [-m MODEL] [options]
uv run eval @ eval.toml [options] multi-source runs ([[source]] blocks)
uv run eval @ eval.toml --run.name <name> --resume resume an interrupted run
-229
View File
@@ -21,8 +21,6 @@ def apply_shared_vllm_patches():
monkey_patch_online_fp8_parameter_cast()
monkey_patch_deepseek_v4_allowed_layer_types()
monkey_patch_deepseek_v4_request_tools_placement()
monkey_patch_deepseek_v4_per_layer_rope()
monkey_patch_deepseek_v4_bf16_o_proj()
def monkey_patch_deepseek_v4_allowed_layer_types():
@@ -185,110 +183,6 @@ def monkey_patch_kv_xfer_finished_tolerate_freed():
logger.warning("Patched Scheduler._update_from_kv_xfer_finished to tolerate freed (aborted) KV-transfer reqs.")
def monkey_patch_deepseek_v4_bf16_o_proj():
"""Run DeepSeek V4's output projection in bf16 when the weights are not FP8.
vLLM's DeepSeek V4 output projection is FP8-only. All three CUDA attention
classes (``DeepseekV4FlashMLAAttention``,
``DeepseekV4FlashInferMLAAttention``, ``DeepseekV4FlashInferSM120Attention``)
implement ``_o_proj`` by calling ``deep_gemm_fp8_o_proj``
(``vllm/models/deepseek_v4/nvidia/ops/o_proj.py``), which dereferences
``wo_a.weight_scale``, falling back to ``wo_a.weight_scale_inv``, and hands
the result to DeepGEMM's ``fp8_einsum``. There is no branch on quant config
or weight dtype, and ``_o_proj`` is an ``@abstractmethod`` dispatched purely
by platform subclass, so no attention backend routes around it. A bf16
checkpoint has neither attribute and therefore fails with
``AttributeError: 'ColumnParallelLinear' object has no attribute
'weight_scale_inv'``.
Quantizing is not an answer, because nothing quantizes by default:
``[inference.vllm] quantization`` is unset, which leaves vLLM to infer the
scheme from the checkpoint. bf16 DeepSeek V4 checkpoints are a first-class
artifact here, written by ``tools/convert_fp8_to_bf16.py``,
``tools/convert_dcp_to_bf16.py``, and trainer exports, and they carry no
scales for the op to find. Passing ``--quantization fp8_per_block`` does
produce a correct ``weight_scale_inv`` and is a genuine alternative on
hardware whose DeepGEMM build has block-scaled FP8 kernels, but it changes
the served numerics, so it is a deployment decision rather than a fix for
serving the bf16 weights as given.
Only the unquantized case is redirected: an FP8 weight keeps using vLLM's own
kernel, so a real FP8-serialized checkpoint behaves exactly as before. The
condition is the weight dtype rather than the presence of
``weight_scale_inv``, so a checkpoint that *is* quantized but whose scales
ended up in the wrong layout still fails loudly instead of being silently
rerouted.
The replacement mirrors the Triton kernel's arithmetic
(``vllm/models/deepseek_v4/common/ops/fused_inv_rope_fp8_quant.py:95-105``)
without the quantization step. The trailing ``rope_dim`` channels of each head
carry an inverse RoPE over interleaved pairs, with ``cos_sin_cache`` holding
``rope_dim // 2`` cosines followed by the matching sines:
y[even] = x[even] * cos + x[odd] * sin
y[odd] = x[odd] * cos - x[even] * sin
The remaining ``nope_dim`` channels pass through. The projection is the same
grouped contraction ``fp8_einsum`` performs, with the group axis recovered by
reshaping: head ``g * heads_per_group + i`` belongs to group ``g`` at offset
``i * head_dim``, matching the kernel's own
``g = pid_gh // heads_per_group`` indexing.
Rotation is computed in fp32 and the contraction runs in bf16, whose CUDA
matmuls accumulate in fp32. That is strictly more accurate than the FP8 path
it replaces, and it avoids materializing an fp32 copy of the attention output.
"""
from vllm.models.deepseek_v4.nvidia import flashinfer_sparse, flashmla
from vllm.models.deepseek_v4.nvidia.ops import o_proj as o_proj_module
original_o_proj = o_proj_module.deep_gemm_fp8_o_proj
if getattr(original_o_proj, "_prime_rl_has_bf16_fallback", False):
return
def _inverse_rope(o, positions, cos_sin_cache, rope_dim):
num_tokens, num_heads, head_dim = o.shape
half_rope = rope_dim // 2
cos_sin = cos_sin_cache[positions].float()
cos = cos_sin[:, :half_rope].view(num_tokens, 1, half_rope)
sin = cos_sin[:, half_rope:].view(num_tokens, 1, half_rope)
rotated = o[:, :, head_dim - rope_dim :].float().reshape(num_tokens, num_heads, half_rope, 2)
even, odd = rotated[..., 0], rotated[..., 1]
pairs = torch.stack((even * cos + odd * sin, odd * cos - even * sin), dim=-1)
out = o.clone()
out[:, :, head_dim - rope_dim :] = pairs.reshape(num_tokens, num_heads, rope_dim).to(o.dtype)
return out
def _patched_o_proj(o, positions, cos_sin_cache, wo_a, wo_b, *, n_groups, heads_per_group, **kwargs):
if wo_a.weight.dtype == torch.float8_e4m3fn:
return original_o_proj(
o,
positions,
cos_sin_cache,
wo_a,
wo_b,
n_groups=n_groups,
heads_per_group=heads_per_group,
**kwargs,
)
x = _inverse_rope(o, positions, cos_sin_cache, kwargs["rope_dim"])
x = x.reshape(o.shape[0], n_groups, heads_per_group * o.shape[-1])
weight = wo_a.weight.view(n_groups, kwargs["o_lora_rank"], -1)
z = torch.einsum("tgr,gdr->tgd", x, weight)
return wo_b(z.flatten(1))
_patched_o_proj._prime_rl_has_bf16_fallback = True
o_proj_module.deep_gemm_fp8_o_proj = _patched_o_proj
# Both attention modules did `from ...ops.o_proj import deep_gemm_fp8_o_proj` at
# import time, so patching the defining module alone would not reach the names
# their `_o_proj` methods actually call.
flashmla.deep_gemm_fp8_o_proj = _patched_o_proj
flashinfer_sparse.deep_gemm_fp8_o_proj = _patched_o_proj
def monkey_patch_nano_v3_reasoning_parser():
from vllm.reasoning.abs_reasoning_parsers import ReasoningParserManager
from vllm.reasoning.deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser
@@ -795,126 +689,3 @@ def monkey_patch_dp_coordinator_startup_timeout():
zmq_addr_pipe.close()
DPCoordinator._wait_for_zmq_addrs = _patched_wait_for_zmq_addrs
_DEEPSEEK_V4_YARN_ROPE_TYPES = frozenset({"yarn", "deepseek_yarn", "deepseek_llama_scaling"})
def _deepseek_v4_rope_parameters(rope_parameters, *, compress_ratio, max_position_embeddings):
"""Flat, single-layer rope parameters for `build_deepseek_v4_rope`.
Handles both on-disk schemas. The real checkpoint ships a flat legacy `rope_scaling`, which
vLLM's config shim normalizes in place. HF's own `DeepseekV4Config` nests the parameters
under `main`/`compress` rope-type labels instead, and so does this repo's port. vLLM's shim
cannot read that: `is_rope_parameters_nested` only recognizes nesting by *attention* layer
type, so transformers leaves the sub-dicts alone and injects a top-level
`rope_type="default"` beside them. Upstream then builds unscaled RoPE for every layer and
hands `get_rope` a cache key containing a dict, which is unhashable. Selecting the branch
this layer wants resolves both. Upstream picks the base from `config.rope_theta` /
`config.compress_rope_theta` on its own either way.
"""
rope_parameters = rope_parameters if isinstance(rope_parameters, dict) else {}
# `compress_ratio` is already clamped to >= 1 by the caller, so <= 1 is "no compressor",
# i.e. the reference's `else` branch. vLLM lumps the MTP layers in here too.
is_sliding = compress_ratio <= 1
if any(isinstance(value, dict) for value in rope_parameters.values()):
label = "main" if is_sliding else "compress"
branch = rope_parameters.get(label)
if not isinstance(branch, dict):
raise ValueError(
f"DeepSeek V4 rope_parameters is nested by rope type but has no {label!r} "
f"sub-dict; found {sorted(rope_parameters)}."
)
parameters = dict(branch)
else:
parameters = dict(rope_parameters)
rope_type = parameters.get("rope_type", parameters.get("type", "default"))
if is_sliding or rope_type not in _DEEPSEEK_V4_YARN_ROPE_TYPES:
# Plain RoPE, written as YaRN with `factor=1` rather than as `rope_type="default"`.
# The table is the same either way, since `_compute_inv_freq`'s interpolated and
# extrapolated frequencies coincide at `factor=1` and `yarn_get_mscale` returns 1.0,
# but `"default"` would route `get_rope` to a plain `RotaryEmbedding`, whose cache
# follows the ambient dtype and so fails the fp32 assertion in
# `vllm/models/deepseek_v4/common/ops/fused_inv_rope_fp8_quant.py`.
# `original_max_position_embeddings` is widened because the cache is
# `original_max * factor` rows and must still span the context.
rope_type = "yarn"
parameters["factor"] = 1
parameters["original_max_position_embeddings"] = max_position_embeddings
parameters["rope_type"] = rope_type
return parameters
def monkey_patch_deepseek_v4_per_layer_rope():
"""Give each DeepSeek V4 layer the RoPE its reference implementation uses.
DeepSeek ships the reference inside the checkpoint we serve, at
https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731/tree/main/inference. Its
`model.py:481-485` picks the frequencies per layer:
if self.compress_ratio:
original_seq_len, rope_theta = args.original_seq_len, args.compress_rope_theta
else:
# disable YaRN and use base rope_theta in pure sliding-window attention
original_seq_len, rope_theta = 0, args.rope_theta
and `precompute_freqs_cis` (`model.py:206-235`) applies the NTK-by-parts ramp only when
`original_seq_len > 0`. So a pure sliding-window layer gets plain RoPE at `rope_theta` and
every compressed layer gets YaRN at `compress_rope_theta`. HF's `DeepseekV4Config` splits its
`rope_parameters` into `main`/`compress` for the same reason, and so does this repo's trainer.
`vllm/models/deepseek_v4/common/rope.py`'s `build_deepseek_v4_rope` branches the base on
`compress_ratio` but never the scaling, so on the real checkpoint it hands YaRN to layers 0
and 1 as well. No config value can correct that: `rope_type` is one global field there.
So this patch resolves `rope_parameters` per layer instead, which also gives upstream a
schema and a dtype it can handle; see `_deepseek_v4_rope_parameters` above.
Measured against the reference's own frequencies, at the test's `factor=16`,
`original_max_position_embeddings=4096` geometry, this takes the sliding layers from 5.1e-03
max absolute error to 6e-08, the float32 residual the compressed layers already have. The
rope tests in `tests/unit/train/models/test_deepseek_v4.py` are that comparison, over both
on-disk schemas and both scaled and unscaled configs.
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
original_build = dsv4_rope.build_deepseek_v4_rope
if getattr(original_build, "_prime_rl_matches_deepseek_reference", False):
return
def _patched_build(config, *, head_dim, rope_head_dim, max_position_embeddings, compress_ratio):
# Swapping a copy in also spares `config.rope_parameters` upstream's in-place mutation,
# which otherwise leaves the last-built layer's `rope_theta` on the shared config.
original_parameters = config.rope_parameters
config.rope_parameters = _deepseek_v4_rope_parameters(
original_parameters,
compress_ratio=compress_ratio,
max_position_embeddings=max_position_embeddings,
)
try:
return original_build(
config,
head_dim=head_dim,
rope_head_dim=rope_head_dim,
max_position_embeddings=max_position_embeddings,
compress_ratio=compress_ratio,
)
finally:
config.rope_parameters = original_parameters
_patched_build._prime_rl_matches_deepseek_reference = True
dsv4_rope.build_deepseek_v4_rope = _patched_build
# `attention.py` imports the builder into its own namespace, so the defining module alone
# would not reach the already-bound reference.
from vllm.models.deepseek_v4 import attention as dsv4_attention
dsv4_attention.build_deepseek_v4_rope = _patched_build
+1 -1
View File
@@ -26,7 +26,7 @@ from prime_rl.inference.patches import (
)
# NOTE: Monkeypatch TokenizeParams to fix overly conservative validation
# Still needed in vLLM 0.29 — upstream rejects prompt_len > max_model_len - max_tokens
# Still needed in vLLM 0.30 — 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.
+12 -25
View File
@@ -20,10 +20,8 @@ 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
from pathlib import Path
from typing import Generic, TypeVar
@@ -41,11 +39,6 @@ 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
@@ -74,11 +67,11 @@ class Env:
is None."""
self.sampling_args: dict = {}
self.num_tasks: int | None = 0
"""Task count; ``None`` means the taskset is infinite."""
"""Task count; ``None`` means the selected tasks never end."""
self.tasks: Iterator[vf.Task] | None = None
"""The env's tasks, client-side, set at ``start()``. A finite taskset is
materialized (``num_tasks`` is its count) and iterated from there; an infinite
one streams off its generator. Consumed once — by ``TrainSource`` (train) or
"""The env's selected tasks (``select``), client-side, set at
``start()``. A bounded selection is materialized (``num_tasks`` is its count)
and iterated from there; an unbounded one streams off the taskset. Consumed once — by ``TrainSource`` (train) or
``EvalEnv.start`` (eval)."""
self._env_client: EnvClient | None = None
@@ -102,19 +95,15 @@ class Env:
# The server may still be coming up (the launcher spawns it concurrently with
# the orchestrator), so poll until it answers.
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:
taskset = vf.load_taskset(self.config.env.taskset).select(self.config.select)
if taskset.bounded:
# 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)
else:
self.tasks = iter(taskset)
self.num_tasks = None
num_tasks = self.num_tasks if self.num_tasks is not None else "infinite"
get_logger().info(f"Env {self.name} ready in {format_time(time.perf_counter() - t0)} (num_tasks={num_tasks})")
@@ -186,12 +175,10 @@ class EvalEnv(Env):
async def start(self) -> None:
await super().start()
n = self.config.num_examples
if self.num_tasks is None and n < 0:
raise ValueError(f"Eval env {self.name} has an infinite taskset — set num_examples to bound it")
if self.num_tasks is None:
raise ValueError(f"Eval env {self.name} has an infinite taskset — set select.limit to bound it")
# A fixed eval set, pulled off the tasks once and reused every epoch.
tasks = list(self.tasks) if n < 0 else list(islice(self.tasks, n))
self.examples = tasks
self.examples = list(self.tasks)
EnvT = TypeVar("EnvT", bound=Env)
+98 -5
View File
@@ -5,11 +5,15 @@ from typing import TypedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from prime_rl.utils.logger import get_logger
from prime_rl.utils.vlm import get_final_logit_softcapping
# Same as torch's cross entropy loss
IGNORE_INDEX = -100
class PrimeLmOutput(TypedDict, total=False):
"""Output from LM head - a TypedDict so pytree can find tensors for FSDP2 hooks."""
@@ -35,6 +39,13 @@ def cast_float_and_contiguous(output: PrimeLmOutput) -> PrimeLmOutput:
class FusedOutputLinear(torch.nn.Linear):
"""Chunked LM head that never materializes the full [N, V] logits.
With ``labels`` and no ``temperature`` it returns the summed cross-entropy over labels != IGNORE_INDEX
as ``loss``, computing the gradients chunk by chunk in the forward pass (see ``_ChunkedCrossEntropySumFn``).
With ``temperature`` it returns per-token ``logprobs`` and ``entropy``.
"""
def __init__(self, in_features: int, out_features: int, chunk_size: int):
super().__init__(in_features, out_features, bias=False)
self.chunk_size = chunk_size
@@ -47,11 +58,16 @@ class FusedOutputLinear(torch.nn.Linear):
sampling_mask: Tensor | None = None,
) -> PrimeLmOutput:
assert labels is not None, "FusedOutputLinear requires labels for chunked logprob computation"
assert temperature is not None, "FusedOutputLinear requires per-token temperatures"
b, s, h = hidden_states.shape
hidden_states = hidden_states.reshape(b * s, h).contiguous()
labels = labels.reshape(b * s).contiguous()
if temperature is None:
assert sampling_mask is None, "sampling-mask replay requires per-token temperatures"
loss = _ChunkedCrossEntropySumFn.apply(hidden_states, self.weight, labels, self.chunk_size)
return PrimeLmOutput(loss=loss)
inv_t = 1.0 / temperature.reshape(b * s).contiguous() # [N]
if sampling_mask is not None:
sampling_mask = sampling_mask.reshape(b * s, sampling_mask.shape[-1]).contiguous()
@@ -66,6 +82,9 @@ class FusedOutputLinear(torch.nn.Linear):
class VanillaOutputLinear(torch.nn.Linear):
"""LM head that returns the full logits, or with ``labels`` and no ``temperature`` the summed fp32
cross-entropy over labels != IGNORE_INDEX as ``loss``."""
def __init__(self, in_features: int, out_features: int):
super().__init__(in_features, out_features, bias=False)
@@ -76,9 +95,18 @@ class VanillaOutputLinear(torch.nn.Linear):
temperature: Tensor | None = None,
sampling_mask: Tensor | None = None,
) -> PrimeLmOutput:
# VanillaOutputLinear just returns logits. train.py applies temperature
# scaling and sampling-mask replay.
return PrimeLmOutput(logits=super().forward(hidden_states))
logits = super().forward(hidden_states)
if labels is not None and temperature is None:
return PrimeLmOutput(loss=cross_entropy_sum(logits, labels))
# train.py applies temperature scaling and sampling-mask replay to the logits.
return PrimeLmOutput(logits=logits)
def cross_entropy_sum(logits: Tensor, labels: Tensor) -> Tensor:
"""Summed fp32 cross-entropy over labels != IGNORE_INDEX."""
return F.cross_entropy(
logits.view(-1, logits.shape[-1]).float(), labels.reshape(-1), ignore_index=IGNORE_INDEX, reduction="sum"
)
def _online_logsumexp_and_weighted_update(
@@ -266,6 +294,71 @@ class _SequenceChunkedLogProbEntropyFn(torch.autograd.Function):
return grad_hidden, grad_weight, None, None, None, None
class _ChunkedCrossEntropySumFn(torch.autograd.Function):
"""Summed cross-entropy over labels != IGNORE_INDEX, with the gradients computed during forward.
Per chunk of ``chunk_size`` tokens: one full-vocab logits GEMM, the loss, and the gradient
(softmax minus one-hot) folded straight into ``grad_hidden`` and ``grad_weight``. Only one chunk's
logits are alive at a time and backward does no recompute: it scales the stored gradients by the
incoming scalar. That drops the head's matmul passes from four to three (forward logits, dX, dW).
Same approach as torchtitan's ChunkedLossWrapper.
Backward only accepts a scalar upstream gradient (e.g. ``loss_sum / k``). Per-token weighted losses
must pass a temperature and go through the logprob path instead.
"""
@staticmethod
def forward( # type: ignore[override]
ctx,
hidden: torch.Tensor, # [N, H]
weight: torch.Tensor, # [V, H]
labels: torch.Tensor, # [N], IGNORE_INDEX where the token has no loss
chunk_size: int,
) -> torch.Tensor:
assert hidden.dim() == 2 and weight.dim() == 2 and labels.dim() == 1
assert hidden.shape[0] == labels.shape[0] and hidden.shape[1] == weight.shape[1]
assert chunk_size > 0
needs_hidden, needs_weight = ctx.needs_input_grad[0], ctx.needs_input_grad[1]
grad_hidden = torch.empty_like(hidden) if needs_hidden else None
grad_weight = torch.zeros_like(weight) if needs_weight else None
loss = torch.zeros((), device=hidden.device, dtype=torch.float32)
for start in range(0, hidden.shape[0], chunk_size):
end = min(start + chunk_size, hidden.shape[0])
hidden_chunk = hidden[start:end]
labels_chunk = labels[start:end]
valid = labels_chunk != IGNORE_INDEX
target = labels_chunk.clamp(min=0).unsqueeze(-1)
logits = (hidden_chunk @ weight.t()).float()
logz = torch.logsumexp(logits, dim=-1)
target_logits = logits.gather(1, target).squeeze(1)
loss += torch.where(valid, logz - target_logits, 0.0).sum()
if needs_hidden or needs_weight:
# dx(loss)/dx(logits) is softmax minus one-hot on valid rows and zero elsewhere so it reuses the logits buffer
grad_logits = logits.sub_(logz.unsqueeze(-1)).exp_()
grad_logits.scatter_add_(1, target, torch.full_like(target, -1, dtype=grad_logits.dtype))
grad_logits = grad_logits.mul_(valid.unsqueeze(-1)).to(hidden.dtype)
if needs_hidden:
torch.mm(grad_logits, weight, out=grad_hidden[start:end])
if needs_weight:
grad_weight.addmm_(grad_logits.t(), hidden_chunk)
ctx.save_for_backward(grad_hidden, grad_weight)
return loss
@staticmethod
def backward(ctx, grad_loss: torch.Tensor):
grad_hidden, grad_weight = ctx.saved_tensors
if grad_hidden is not None:
grad_hidden = grad_hidden * grad_loss.to(grad_hidden.dtype)
if grad_weight is not None:
grad_weight = grad_weight * grad_loss.to(grad_weight.dtype)
return grad_hidden, grad_weight, None, None
def inject_prime_lm_head(
model: nn.Module,
chunk_size: int | None = None,
@@ -279,7 +372,7 @@ def inject_prime_lm_head(
Args:
model: The model to wrap.
chunk_size: When set to an int, uses FusedOutputLinear with sequence-token chunked
logprob/entropy computation.
loss/logprob/entropy computation.
"""
# Guards so we have nicer error messages when a non-standard model is used
assert hasattr(model, "model"), f"model doesnt have backbone in model.model:\n{model}"
@@ -5,9 +5,11 @@ import torch.nn as nn
from torch import Tensor
from prime_rl.trainer.models.layers.lm_head import (
IGNORE_INDEX,
PrimeLmOutput,
_online_logsumexp_and_weighted_update,
_patch_model_forward,
cross_entropy_sum,
)
from prime_rl.utils.logger import get_logger
@@ -26,14 +28,21 @@ class GemmaFusedOutputLinear(torch.nn.Linear):
sampling_mask: Tensor | None = None,
) -> PrimeLmOutput:
assert labels is not None, "GemmaFusedOutputLinear requires labels for chunked logprob computation"
assert temperature is not None, "GemmaFusedOutputLinear requires per-token temperatures"
assert sampling_mask is None, "sampling-mask replay is not supported with Gemma softcapped lm_heads"
b, s, h = hidden_states.shape
hidden_states = hidden_states.reshape(b * s, h).contiguous()
labels = labels.reshape(b * s).contiguous()
inv_t = 1.0 / temperature.reshape(b * s).contiguous() # [N]
if temperature is None:
# Summed cross-entropy through the logprob path; IGNORE_INDEX rows are masked at the sum.
inv_t = torch.ones(b * s, device=hidden_states.device, dtype=torch.float32)
logprobs, _ = _GemmaChunkedLogProbEntropyFn.apply(
hidden_states, self.weight, labels, inv_t, self.chunk_size, self.softcap
)
return PrimeLmOutput(loss=-logprobs[labels != IGNORE_INDEX].sum())
inv_t = 1.0 / temperature.reshape(b * s).contiguous() # [N]
logprobs, entropy = _GemmaChunkedLogProbEntropyFn.apply(
hidden_states, self.weight, labels, inv_t, self.chunk_size, self.softcap
)
@@ -57,6 +66,8 @@ class GemmaVanillaOutputLinear(torch.nn.Linear):
) -> PrimeLmOutput:
logits = super().forward(hidden_states)
logits = self.softcap * torch.tanh(logits / self.softcap)
if labels is not None and temperature is None:
return PrimeLmOutput(loss=cross_entropy_sum(logits, labels))
return PrimeLmOutput(logits=logits)
+74 -2
View File
@@ -6,7 +6,14 @@ from beartype import beartype as typechecker
from jaxtyping import Bool, Float, Int, jaxtyped
from torch import Tensor
from prime_rl.configs.trainer import CustomLossConfig, IcePopLossConfig, IPOLossConfig, LossConfig
from prime_rl.configs.trainer import (
CISPOLossConfig,
CustomLossConfig,
IcePopLossConfig,
IPOLossConfig,
LossConfig,
PPOLossConfig,
)
from prime_rl.trainer.models.layers.lm_head import sampling_replay_mask
from prime_rl.utils.utils import import_object
@@ -39,7 +46,7 @@ class LossOutputs:
class Loss(Protocol):
"""Interface for the config-initialized rl loss objects built by
``setup_rl_loss_fn``: ``IPOLoss``, ``IcePopLoss`` and ``CustomLoss``."""
``setup_rl_loss_fn``."""
def loss(self, inputs: LossInputs) -> LossOutputs: ...
@@ -222,6 +229,67 @@ class IcePopLoss:
return LossOutputs(loss=per_token_loss.sum(), metrics=metrics)
class PPOLoss:
"""Token-level PPO clipped surrogate with bounded importance weights."""
def __init__(self, config: PPOLossConfig):
self.config = config
def loss(self, inputs: LossInputs) -> LossOutputs:
config = self.config
logprobs = inputs.trainer_logprobs[inputs.loss_mask]
log_ratio = logprobs - inputs.inference_logprobs[inputs.loss_mask]
advantages = config.adv_tau * inputs.advantages[inputs.loss_mask]
ratio = _capped_importance_ratio(log_ratio, config.max_importance_ratio)
clipped_ratio = ratio.clamp(config.ratio_low, config.ratio_high)
per_token_loss = -torch.minimum(advantages * ratio, advantages * clipped_ratio)
if inputs.loss_weights is not None:
per_token_loss = per_token_loss * inputs.loss_weights[inputs.loss_mask]
clipped = ((advantages > 0) & (log_ratio.detach() > log_ratio.new_tensor(config.ratio_high).log())) | (
(advantages < 0) & (log_ratio.detach() < log_ratio.new_tensor(config.ratio_low).log())
)
metrics = {
"is_clipped": clipped.sum() / max(clipped.numel(), 1),
"ratio_capped": (log_ratio.detach() > log_ratio.new_tensor(config.max_importance_ratio).log()).sum()
/ max(log_ratio.numel(), 1),
}
return LossOutputs(loss=per_token_loss.sum(), metrics=metrics)
class CISPOLoss:
"""CISPO uses a detached clipped importance weight on the current logprob."""
def __init__(self, config: CISPOLossConfig):
self.config = config
def loss(self, inputs: LossInputs) -> LossOutputs:
config = self.config
logprobs = inputs.trainer_logprobs[inputs.loss_mask]
log_ratio = logprobs - inputs.inference_logprobs[inputs.loss_mask]
advantages = config.adv_tau * inputs.advantages[inputs.loss_mask]
detached_log_ratio = log_ratio.detach()
log_ratio_high = log_ratio.new_tensor(config.ratio_high).log()
clipped_log_ratio = detached_log_ratio.clamp(max=log_ratio_high)
is_clipped = detached_log_ratio > log_ratio_high
if config.ratio_low:
log_ratio_low = log_ratio.new_tensor(config.ratio_low).log()
clipped_log_ratio = clipped_log_ratio.clamp(min=log_ratio_low)
is_clipped = is_clipped | (detached_log_ratio < log_ratio_low)
importance_weight = clipped_log_ratio.exp()
per_token_loss = -importance_weight * advantages * logprobs
if inputs.loss_weights is not None:
per_token_loss = per_token_loss * inputs.loss_weights[inputs.loss_mask]
metrics = {
"is_clipped": is_clipped.sum() / max(is_clipped.numel(), 1),
}
return LossOutputs(loss=per_token_loss.sum(), metrics=metrics)
def ref_kl_loss_fn(inputs: LossInputs) -> LossOutputs:
"""
Ref-KL loss type (on-policy distillation): the reverse KL to the reference
@@ -305,6 +373,10 @@ def setup_rl_loss_fn(loss_config: LossConfig) -> Loss:
return IPOLoss(loss_config)
case IcePopLossConfig():
return IcePopLoss(loss_config)
case PPOLossConfig():
return PPOLoss(loss_config)
case CISPOLossConfig():
return CISPOLoss(loss_config)
case _:
raise TypeError(f"Unsupported RL loss config: {type(loss_config).__name__}")
+15 -34
View File
@@ -6,8 +6,6 @@ import asyncio
from contextlib import nullcontext
from datetime import timedelta
from torch.nn import CrossEntropyLoss
# Import environment before any other imports
# ruff: noqa: I001
@@ -21,6 +19,7 @@ from prime_rl.configs.trainer import CheckpointConfig
from prime_rl.transports.weights import prune_broadcasts_beyond, setup_weight_sender
from prime_rl.utils.cp import setup_context_parallel, setup_cp_params, shard_for_cp
from prime_rl.trainer.lora import get_lora_state
from prime_rl.trainer.models.layers.lm_head import IGNORE_INDEX
from prime_rl.trainer.models.layers.lora import set_lora_num_tokens
from prime_rl.utils.logger import format_time, setup_logger
from prime_rl.trainer.optim import setup_optimizer
@@ -279,39 +278,21 @@ def train(config: SFTConfig):
token_count = loss_mask.sum(dtype=torch.int64)
# Labels without a temperature make the LM head return the summed cross-entropy directly.
labels = target_ids.masked_fill(~loss_mask, IGNORE_INDEX)
with maybe_activation_offloading(config.model.ac_offloading):
if isinstance(config.model.fused_lm_head_token_chunk_size, int):
# Same path as the RL trainer: the chunked LM head computes per-token
# logprobs without materializing the [N, V] logits, and per-token
# cross-entropy is the negative target logprob.
temperature = torch.ones_like(target_ids, dtype=torch.float32)
out = forward(
model,
input_ids,
position_ids,
seq_lens=seq_lens,
labels=target_ids,
temperature=temperature,
mm_kwargs=mm_kwargs,
mm_token_type_ids=mm_type_ids,
seq_lens_are_pre_shard=seq_lens_are_pre_shard,
)
loss_sum = -out["logprobs"][loss_mask].sum()
else:
out = forward(
model,
input_ids,
position_ids,
mm_kwargs=mm_kwargs,
mm_token_type_ids=mm_type_ids,
seq_lens=seq_lens,
seq_lens_are_pre_shard=seq_lens_are_pre_shard,
)
logits = out["logits"]
B, L, V = logits.shape
token_loss = CrossEntropyLoss(reduction="none")(logits.view(-1, V), target_ids.view(-1)).view(B, L)
loss_sum = token_loss[loss_mask].sum()
del logits
out = forward(
model,
input_ids,
position_ids,
seq_lens=seq_lens,
labels=labels,
mm_kwargs=mm_kwargs,
mm_token_type_ids=mm_type_ids,
seq_lens_are_pre_shard=seq_lens_are_pre_shard,
)
loss_sum = out["loss"]
del out
return loss_sum, token_count
+1 -1
View File
@@ -36,7 +36,7 @@ def test_plan_keeps_landed_rollouts_up_to_the_target_and_owes_the_rest() -> None
_record("math", "m0"),
_record("math", "m0"), # a third rollout of m0 exceeds group_size 2
_record("math", "m1"),
_record("math", "m9"), # no longer selected (num_examples shrank)
_record("math", "m9"), # no longer selected (select.limit shrank)
_record("code", "c0", ok=False), # errored: owed again
]
+6
View File
@@ -193,6 +193,12 @@ def test_icepop_is_an_optional_loss_with_validated_ratio_bounds():
with pytest.raises(ValidationError, match="ratio_low must not exceed ratio_high"):
TrainerConfig.model_validate({"loss": {"type": "icepop", "ratio_low": 5.0, "ratio_high": 0.2}})
assert TrainerConfig.model_validate({"loss": {"type": "ppo"}}).loss.type == "ppo"
assert TrainerConfig.model_validate({"loss": {"type": "cispo"}}).loss.type == "cispo"
with pytest.raises(ValidationError, match="max_importance_ratio must be at least ratio_high"):
TrainerConfig.model_validate({"loss": {"type": "ppo", "max_importance_ratio": 1.0, "ratio_high": 1.2}})
def test_moe_runtime_defaults_are_independent_from_dense_quantization():
config = TrainerModelConfig.model_validate({"quantization": {"type": "mxfp8"}})
+11 -14
View File
@@ -451,8 +451,7 @@ def test_deepseek_v4_init_buffers_post_meta_restores_every_rotary():
#
# `precompute_freqs_cis` (`model.py:206-235`) applies the NTK-by-parts ramp only when
# `original_seq_len > 0`, so a pure sliding-window layer gets plain RoPE at `rope_theta` and every
# compressed layer gets YaRN at `compress_rope_theta`. vLLM's `build_deepseek_v4_rope` branches the
# base but not the scaling, which `monkey_patch_deepseek_v4_per_layer_rope` corrects.
# compressed layer gets YaRN at `compress_rope_theta`. vLLM's `build_deepseek_v4_rope` must match.
#
# The real checkpoint's beta range and factor, but a reduced `original_max_position_embeddings`:
# the cos/sin cache is `original_max * factor` rows of fp32, which at the checkpoint's 65536 would
@@ -474,13 +473,15 @@ ROPE_SCALING = {
}
# The nested `main`/`compress` schema, which HF's own `DeepseekV4Config` and this repo's port both
# write and which vLLM's config shim cannot read. A config.json can also carry the flat legacy
# `rope_scaling` the real checkpoint ships, or no YaRN parameters at all; the nested scaled form
# is asserted here because it is the one the patch has the most normalization to do on.
# write. A config.json can also carry the flat legacy `rope_scaling` the real checkpoint ships.
ROPE_NESTED_PLAIN = {"rope_type": "default", "partial_rotary_factor": 0.125}
ROPE_PARAMETERS = {
"main": dict(ROPE_NESTED_PLAIN),
"compress": {**ROPE_SCALING, "partial_rotary_factor": 0.125},
"compress": {
"rope_type": "yarn",
**{key: value for key, value in ROPE_SCALING.items() if key != "type"},
"partial_rotary_factor": 0.125,
},
}
@@ -522,12 +523,11 @@ def _vllm_rope_freqs(rotary_emb) -> torch.Tensor:
@pytest.fixture
def vllm_rope_builder():
"""`build_deepseek_v4_rope`, patched, under the live vLLM config its `CustomOp` base asserts on.
"""`build_deepseek_v4_rope` under the live vLLM config its `CustomOp` base asserts on.
The builder is resolved off the module at call time rather than bound at import, because the
patch rebinds that attribute. The config goes through vLLM's own `patch_rope_parameters`, the
same normalization the engine runs: it renames the legacy `type` key and, for the nested
schema, injects a top-level `rope_type="default"` beside the sub-dicts.
The config goes through vLLM's own `patch_rope_parameters`, the same normalization the engine
runs: it renames the legacy `type` key and, for the nested schema, injects a top-level
`rope_type="default"` beside the sub-dicts.
"""
from vllm.config import VllmConfig, set_current_vllm_config
from vllm.model_executor.layers import rotary_embedding
@@ -536,9 +536,6 @@ def vllm_rope_builder():
from vllm.transformers_utils.configs.deepseek_v4 import DeepseekV4Config as VllmDeepseekV4Config
from vllm.utils.torch_utils import set_default_torch_dtype
from prime_rl.inference.patches import monkey_patch_deepseek_v4_per_layer_rope
monkey_patch_deepseek_v4_per_layer_rope()
rotary_embedding._ROPE_DICT.clear()
def build(compress_ratio: int):
+79 -1
View File
@@ -1,7 +1,7 @@
import pytest
import torch
from prime_rl.configs.trainer import CustomLossConfig, IcePopLossConfig, IPOLossConfig
from prime_rl.configs.trainer import CISPOLossConfig, CustomLossConfig, IcePopLossConfig, IPOLossConfig, PPOLossConfig
from prime_rl.trainer.rl.loss import (
IcePopLoss,
LossInputs,
@@ -206,6 +206,84 @@ def test_mismatch_kl_retains_small_positive_values():
)
def test_ppo_clips_by_advantage_sign_and_keeps_unclipped_gradients():
ratios = torch.tensor([0.5, 0.9, 1.0, 1.1, 2.0, 2.0], device="cuda")
trainer_logprobs = (-10 + ratios.log()).requires_grad_()
inputs = LossInputs(
trainer_logprobs=trainer_logprobs,
inference_logprobs=torch.full_like(trainer_logprobs, -10),
ref_logprobs=None,
advantages=torch.tensor([1.0, 1.0, 1.0, 1.0, 1.0, -1.0], device="cuda"),
loss_mask=torch.ones(6, dtype=torch.bool, device="cuda"),
)
result = setup_rl_loss_fn(PPOLossConfig()).loss(inputs)
torch.testing.assert_close(result.loss, torch.tensor(-2.7, device="cuda"))
torch.testing.assert_close(result.metrics["is_clipped"], torch.tensor(1 / 6, device="cuda"))
result.loss.backward()
torch.testing.assert_close(trainer_logprobs.grad, torch.tensor([-0.5, -0.9, -1.0, -1.1, 0.0, 2.0], device="cuda"))
def test_ppo_caps_unbounded_negative_advantage_ratio():
trainer_logprobs = torch.tensor([-10.0, float("nan")], device="cuda", requires_grad=True)
inputs = LossInputs(
trainer_logprobs=trainer_logprobs,
inference_logprobs=torch.tensor([-100.0, float("nan")], device="cuda"),
ref_logprobs=None,
advantages=torch.tensor([-1.0, 1.0], device="cuda"),
loss_mask=torch.tensor([True, False], device="cuda"),
)
result = setup_rl_loss_fn(PPOLossConfig()).loss(inputs)
torch.testing.assert_close(result.loss, torch.tensor(1e4, device="cuda"))
assert all(torch.isfinite(value) for value in result.metrics.values())
result.loss.backward()
torch.testing.assert_close(trainer_logprobs.grad, torch.tensor([1e4, 0.0], device="cuda"))
def test_cispo_clips_detached_weight_without_dropping_gradients():
ratios = torch.tensor([0.1, 1.0, 5.0, 10.0], device="cuda")
trainer_logprobs = (-10 + ratios.log()).requires_grad_()
advantages = torch.tensor([1.0, -1.0, 1.0, 1.0], device="cuda")
inputs = LossInputs(
trainer_logprobs=trainer_logprobs,
inference_logprobs=torch.full_like(trainer_logprobs, -10),
ref_logprobs=None,
advantages=advantages,
loss_mask=torch.ones(4, dtype=torch.bool, device="cuda"),
)
result = setup_rl_loss_fn(CISPOLossConfig()).loss(inputs)
expected_weight = torch.tensor([0.1, 1.0, 5.0, 5.0], device="cuda")
torch.testing.assert_close(result.loss, -(expected_weight * advantages * trainer_logprobs.detach()).sum())
torch.testing.assert_close(result.metrics["is_clipped"], torch.tensor(0.25, device="cuda"))
result.loss.backward()
torch.testing.assert_close(trainer_logprobs.grad, torch.tensor([-0.1, 1.0, -5.0, -5.0], device="cuda"))
def test_cispo_handles_extreme_ratio_and_optional_lower_clip():
trainer_logprobs = torch.tensor([-10.0, 0.0, float("nan")], device="cuda", requires_grad=True)
inputs = LossInputs(
trainer_logprobs=trainer_logprobs,
inference_logprobs=torch.tensor(
[-10.0 - torch.log(torch.tensor(0.1)).item(), -100.0, float("nan")], device="cuda"
),
ref_logprobs=None,
advantages=torch.ones(3, device="cuda"),
loss_mask=torch.tensor([True, True, False], device="cuda"),
)
result = setup_rl_loss_fn(CISPOLossConfig(ratio_low=0.2)).loss(inputs)
assert torch.isfinite(result.loss)
assert all(torch.isfinite(value) for value in result.metrics.values())
result.loss.backward()
torch.testing.assert_close(trainer_logprobs.grad, torch.tensor([-0.2, -5.0, 0.0], device="cuda"))
def test_ce_component_matches_masked_nll():
trainer_logprobs = [torch.tensor([-0.1, -0.5, -0.2], dtype=torch.float32).cuda()]
inference_logprobs = [torch.zeros(3, dtype=torch.float32).cuda()]
+74
View File
@@ -0,0 +1,74 @@
import pytest
import torch
import torch.nn.functional as F
from prime_rl.trainer.models.layers.lm_head import IGNORE_INDEX, FusedOutputLinear, VanillaOutputLinear
from prime_rl.trainer.models.layers.lm_head_gemma import GemmaFusedOutputLinear, GemmaVanillaOutputLinear
B, S, H, V = 2, 7, 8, 37
SOFTCAP = 5.0
UPSTREAM = 0.25 # stands in for the 1 / grad_accum_steps scaling in the SFT loop
HEADS = {
"fused": (lambda chunk_size: FusedOutputLinear(H, V, chunk_size=chunk_size), None),
"vanilla": (lambda chunk_size: VanillaOutputLinear(H, V), None),
"gemma_fused": (lambda chunk_size: GemmaFusedOutputLinear(H, V, chunk_size=chunk_size, softcap=SOFTCAP), SOFTCAP),
"gemma_vanilla": (lambda chunk_size: GemmaVanillaOutputLinear(H, V, softcap=SOFTCAP), SOFTCAP),
}
def _reference_and_grads(hidden, weight, target_ids, loss_mask, softcap):
hidden = hidden.detach().clone().requires_grad_(True)
weight = weight.detach().clone().requires_grad_(True)
logits = hidden @ weight.t()
if softcap is not None:
logits = softcap * torch.tanh(logits / softcap)
loss = F.cross_entropy(logits.view(-1, V), target_ids.view(-1), reduction="none")[loss_mask.view(-1)].sum()
(loss * UPSTREAM).backward()
return loss.detach(), hidden.grad, weight.grad
def _inputs():
torch.manual_seed(0)
hidden = torch.randn(B, S, H)
weight = torch.randn(V, H)
target_ids = torch.randint(0, V, (B, S))
loss_mask = torch.rand(B, S) > 0.3
return hidden, weight, target_ids, loss_mask
@pytest.mark.parametrize("head", list(HEADS))
@pytest.mark.parametrize("chunk_size", [1, 5, 64])
def test_lm_head_labels_without_temperature_returns_summed_cross_entropy(head, chunk_size):
make_head, softcap = HEADS[head]
hidden, weight, target_ids, loss_mask = _inputs()
reference, ref_hidden_grad, ref_weight_grad = _reference_and_grads(hidden, weight, target_ids, loss_mask, softcap)
lm_head = make_head(chunk_size)
lm_head.weight = torch.nn.Parameter(weight.clone())
hidden = hidden.clone().requires_grad_(True)
out = lm_head(hidden, target_ids.masked_fill(~loss_mask, IGNORE_INDEX))
assert set(out) == {"loss"}
(out["loss"] * UPSTREAM).backward()
torch.testing.assert_close(out["loss"], reference, rtol=1e-5, atol=1e-5)
torch.testing.assert_close(hidden.grad, ref_hidden_grad, rtol=1e-5, atol=1e-5)
torch.testing.assert_close(lm_head.weight.grad, ref_weight_grad, rtol=1e-5, atol=1e-5)
@pytest.mark.parametrize("chunk_size", [1, 5, 64])
def test_fused_lm_head_with_temperature_keeps_logprob_path(chunk_size):
hidden, weight, target_ids, loss_mask = _inputs()
reference, ref_hidden_grad, ref_weight_grad = _reference_and_grads(hidden, weight, target_ids, loss_mask, None)
lm_head = FusedOutputLinear(H, V, chunk_size=chunk_size)
lm_head.weight = torch.nn.Parameter(weight.clone())
hidden = hidden.clone().requires_grad_(True)
out = lm_head(hidden, target_ids, temperature=torch.ones(B, S))
assert set(out) == {"logprobs", "entropy"}
loss = -out["logprobs"][loss_mask].sum()
(loss * UPSTREAM).backward()
torch.testing.assert_close(loss, reference, rtol=1e-5, atol=1e-5)
torch.testing.assert_close(hidden.grad, ref_hidden_grad, rtol=1e-5, atol=1e-5)
torch.testing.assert_close(lm_head.weight.grad, ref_weight_grad, rtol=1e-5, atol=1e-5)
Generated
+121 -76
View File
@@ -151,7 +151,7 @@ members = [
overrides = [
{ name = "apache-tvm-ffi", specifier = "==0.1.11" },
{ name = "nvidia-cudnn-cu13", marker = "sys_platform == 'linux'", specifier = ">=9.15" },
{ name = "nvidia-cutlass-dsl", specifier = "==4.6.2" },
{ name = "nvidia-cutlass-dsl", specifier = "==4.7.1" },
{ name = "openenv-core" },
{ name = "tilelang", specifier = "==0.1.12" },
{ name = "torch", marker = "sys_platform != 'linux'", specifier = ">=2.13.0" },
@@ -176,8 +176,8 @@ requires-dist = ["nixl-cu13==0.10.1"]
[[manifest.dependency-metadata]]
name = "nvidia-cutlass-dsl"
version = "4.6.2"
requires-dist = ["nvidia-cutlass-dsl-libs-base==4.6.2", "nvidia-cutlass-dsl-libs-cu13==4.6.2"]
version = "4.7.1"
requires-dist = ["nvidia-cutlass-dsl-libs-base==4.7.1", "nvidia-cutlass-dsl-libs-cu13==4.7.1"]
[[package]]
name = "absl-py"
@@ -563,7 +563,7 @@ dependencies = [
{ name = "google-search-results" },
{ name = "html2text" },
{ 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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "mistralai" },
{ name = "mpmath" },
{ name = "networkx" },
@@ -1263,7 +1263,7 @@ dependencies = [
{ name = "fsspec", extra = ["http"] },
{ name = "httpx" },
{ 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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "multiprocess" },
{ name = "numpy" },
{ name = "packaging" },
@@ -1396,7 +1396,7 @@ version = "0.1.0"
source = { editable = "deps/prime-envs/environments/reasoning/deshuffle_papers" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -1527,7 +1527,7 @@ version = "0.1.0"
source = { editable = "deps/prime-envs/environments/science/drug_discovery_bench" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers", extra = ["harbor"] },
]
@@ -1858,7 +1858,7 @@ dependencies = [
[[package]]
name = "flashinfer-python"
version = "0.6.18"
version = "0.6.18.post1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "apache-tvm-ffi" },
@@ -1878,9 +1878,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/3e/72/12066c5f42a49e7eabe6ec445ac73c59785480bba1b763bd7e0a512f13c1/flashinfer_python-0.6.18.tar.gz", hash = "sha256:70a2074d78cb17ed39c98e5ed47f626c6e8bb29015cf028c49cbf8f2629405a1", size = 13286160, upload-time = "2026-08-29T02:09:18.376Z" }
sdist = { url = "https://files.pythonhosted.org/packages/ad/7e/a756567c193b2af546f98c08158505e998c2dd4a7f8fc6fe6c72105dce8b/flashinfer_python-0.6.18.post1.tar.gz", hash = "sha256:1ebfb8ff3fa3a896e5abbd0dec123a5f3e3734029871349dad6968b252b82097", size = 13294037, upload-time = "2026-09-05T03:26:09.049Z" }
wheels = [
{ 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" },
{ url = "https://files.pythonhosted.org/packages/64/3f/bd0a74bfbb4f3813bfe61267ff696fb229ab70c0f1f44848287221928c95/flashinfer_python-0.6.18.post1-py3-none-any.whl", hash = "sha256:adb6d2952b47131138e108bd2999b1fe18b71f1a4c0b2684f168753db9563991", size = 18348022, upload-time = "2026-09-05T03:26:06.084Z" },
]
[[package]]
@@ -2014,6 +2014,12 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", hash = "sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf", size = 62794, upload-time = "2025-01-02T07:20:43.624Z" },
]
[[package]]
name = "gitignore-parser"
version = "0.1.13"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/e5/51/e391a1a4238f18d0abb47be479b07af265ad4519022cf51b7da47ef82487/gitignore_parser-0.1.13.tar.gz", hash = "sha256:c7e10c8190accb8ae57fb3711889e73a9c0dbc04d4222b91ace8a4bf64d2f746", size = 5603, upload-time = "2025-08-25T06:33:22.704Z" }
[[package]]
name = "gitpython"
version = "3.1.50"
@@ -2386,7 +2392,7 @@ wheels = [
[[package]]
name = "huggingface-hub"
version = "1.28.0"
version = "1.32.0"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
@@ -2403,9 +2409,9 @@ dependencies = [
{ name = "tqdm" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c6/ae/222a91937ebee7f62c0ca8f5ee0afd97577caf24c0abb927d1f5c7e9f6d2/huggingface_hub-1.28.0.tar.gz", hash = "sha256:46a2e950c09234de54093d587d1675382f0d08dbd600d9fb599b5932f5b2c6cb", size = 959609, upload-time = "2026-08-18T12:27:15.101Z" }
sdist = { url = "https://files.pythonhosted.org/packages/fe/0f/e83fdd856da8fca26bf78d71709ebd120432a0ce535e72b9597cab1eb5bf/huggingface_hub-1.32.0.tar.gz", hash = "sha256:ed70a45498abe86039df7c2f4e5f7575de524be908d3840e8f828d5525eafd6a", size = 1038662, upload-time = "2026-09-17T10:27:48.049Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/51/0e/eafef18f1a75e125e68395db21131db0cf868a128ecd2fce69b4df6c584b/huggingface_hub-1.28.0-py3-none-any.whl", hash = "sha256:58a8bacb03072edfc38067065e9dc24bbb34805410fcd36a1632de0b329660bb", size = 793202, upload-time = "2026-08-18T12:27:12.719Z" },
{ url = "https://files.pythonhosted.org/packages/1b/cf/d98dd561d6d0d7b7d7a64d1563f8aaaa7c235daee41c1c9bcc3da62420ed/huggingface_hub-1.32.0-py3-none-any.whl", hash = "sha256:b0c7c80561969d9cdacdd55fce67ba9584cca0b9d4ea80957a3a5c1445fac5c8", size = 842906, upload-time = "2026-09-17T10:27:46.102Z" },
]
[[package]]
@@ -3081,7 +3087,7 @@ version = "0.1.0"
source = { editable = "deps/prime-envs/environments/code/livecodebench" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -3587,7 +3593,7 @@ version = "0.3.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "grpcio" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" } },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" } },
{ name = "nixl" },
{ name = "numpy" },
{ name = "protobuf" },
@@ -4099,19 +4105,19 @@ wheels = [
[[package]]
name = "nvidia-cutlass-dsl"
version = "4.6.2"
version = "4.7.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "nvidia-cutlass-dsl-libs-base" },
{ name = "nvidia-cutlass-dsl-libs-cu13" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/b2/ec/14e6ecbfed31ec35bbd1bb6965ae61f879370906a8f9c2e851e292704ba4/nvidia_cutlass_dsl-4.6.2-py3-none-any.whl", hash = "sha256:06ac62deb182a852dfb053032cf945bf02b9aa1bf502a18b129d280d7babb26c", size = 10460, upload-time = "2026-08-05T14:39:41.657Z" },
{ url = "https://files.pythonhosted.org/packages/af/ef/903dab832a19e0f1d798c9acc96edbda5dfb29f2e030b46e163946555817/nvidia_cutlass_dsl-4.7.1-py3-none-any.whl", hash = "sha256:765850c74868a0b5a02fefbfc1b380842b64e5f7a1c8b1655e322a3b14c01726", size = 10460, upload-time = "2026-08-26T03:11:56.593Z" },
]
[[package]]
name = "nvidia-cutlass-dsl-libs-base"
version = "4.6.2"
version = "4.7.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "cuda-python" },
@@ -4122,13 +4128,13 @@ dependencies = [
{ name = "typing-extensions" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/aa/f3/4be98f2faa283471e355a42ecbc20956fb2c3b6dbc71861f483be277e99a/nvidia_cutlass_dsl_libs_base-4.6.2-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:e129db7155d56ba4478be098c0f819e37690a6ce5d43a9a9a83bf1300d32c57f", size = 3321894, upload-time = "2026-08-05T14:12:30.139Z" },
{ url = "https://files.pythonhosted.org/packages/54/1b/cf4a0837054bb4b9dc36cdd86f9d2e7fead3629e3373aaa7f7ec1e5e1542/nvidia_cutlass_dsl_libs_base-4.6.2-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:24dfaddad6077fd0de14eecaf66a72762f2f5f30ae1872231f5bf8b243ac2eac", size = 2824987, upload-time = "2026-08-05T14:12:49.618Z" },
{ url = "https://files.pythonhosted.org/packages/9f/6e/5d3f67caba70fe9a5cc21b845d2be35d88049da536185196a2644b0d461c/nvidia_cutlass_dsl_libs_base-4.7.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:e86c55a5010a7edfc067648a75cb29d0c5bd67d75210168cf507b0d0e4d15ba7", size = 3329548, upload-time = "2026-08-26T02:53:14.176Z" },
{ url = "https://files.pythonhosted.org/packages/55/b5/af332a4dbb0dba45828994d9789d1969dfecca006a6221cd8b92e4825d3f/nvidia_cutlass_dsl_libs_base-4.7.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:c2b67dacabfc905e4d132784fe4848647f40b0b97b1cdde3ce4a482642536b84", size = 2832971, upload-time = "2026-08-26T02:53:52.164Z" },
]
[[package]]
name = "nvidia-cutlass-dsl-libs-core"
version = "4.6.2"
version = "4.7.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "cuda-python" },
@@ -4138,12 +4144,12 @@ dependencies = [
{ name = "typing-extensions" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/7c/ef/10c0089234a32f1379e1f213f28f8c7521a9ff0154e3acc58f613d5ef3be/nvidia_cutlass_dsl_libs_core-4.6.2-py3-none-any.whl", hash = "sha256:571d4b46fca1bfbb123d0dc348eaa7fd80af0014ddffc07b849e8195b2364333", size = 772393, upload-time = "2026-08-05T14:09:50.76Z" },
{ url = "https://files.pythonhosted.org/packages/6b/14/b669cc890f7fd74008d7bc52f493d0a7ff256de10f3941c6676249419c07/nvidia_cutlass_dsl_libs_core-4.7.1-py3-none-any.whl", hash = "sha256:c65662abc9ab18fd997c57547895736928e559f4624bbe2aa1aa91418ea014ca", size = 1235214, upload-time = "2026-08-26T02:50:56.241Z" },
]
[[package]]
name = "nvidia-cutlass-dsl-libs-cu13"
version = "4.6.2"
version = "4.7.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "cuda-python" },
@@ -4154,8 +4160,8 @@ dependencies = [
{ name = "typing-extensions" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/46/38/bbe5b8f1ef1a15e7bd1e2ea86686c38f15eeee0a4ba440a5d00d8222cb8e/nvidia_cutlass_dsl_libs_cu13-4.6.2-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:b9543257622ce70d696c6a2bda7e9617ef5b1cc9f29bfe66f4b38d1d1e29a8cb", size = 86712108, upload-time = "2026-08-05T14:27:35.488Z" },
{ url = "https://files.pythonhosted.org/packages/ca/05/7874c37d50e112177a64a96dd6c7eaeacb1661ebb864e0fe5cfd9f706767/nvidia_cutlass_dsl_libs_cu13-4.6.2-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:a299a623fad75eb752c1a4e447b924e9049ed396b037509c41a48da82d1f340a", size = 88036030, upload-time = "2026-08-05T14:27:58.991Z" },
{ url = "https://files.pythonhosted.org/packages/30/ea/c7c2b4da3d6c9818e152e20cd5f797fb6d9ef75c3a5c80d2d6a9cb211489/nvidia_cutlass_dsl_libs_cu13-4.7.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:e675bf04dc6c91f7c4d5540699b7a031f2b8b44cd2687b32c20892f112f7e0d9", size = 86957786, upload-time = "2026-08-26T03:07:23.015Z" },
{ url = "https://files.pythonhosted.org/packages/10/71/e178bb0858fd7b96857e98e3acec70b23f13b88540a2fcc53569f8e8ea34/nvidia_cutlass_dsl_libs_cu13-4.7.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:20c14e16125cb8e36bc9947a9f0a57a660f44651365337b911c84abde4967f5f", size = 88260436, upload-time = "2026-08-26T03:07:59.639Z" },
]
[[package]]
@@ -4237,7 +4243,7 @@ version = "0.1.1"
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -4269,7 +4275,7 @@ version = "0.1.0"
source = { editable = "deps/prime-envs/environments/long_context/oolong_pairs" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -4371,7 +4377,7 @@ 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'" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -4658,7 +4664,7 @@ version = "0.1.1"
source = { editable = "deps/prime-envs/environments/search/pi_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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -4799,6 +4805,45 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/e6/88/bdb244e40284ded3632a9f88c23bc80230bd7b2ae4a8b7f2cc91adead7a8/preshed-3.0.13-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2e77bed56aded7cbe5d28d6bd2178bc5b13eda0e0e464dab205fb578fa915000", size = 1919236, upload-time = "2026-03-23T08:56:42.616Z" },
]
[[package]]
name = "prime"
version = "0.8.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "build" },
{ name = "cryptography" },
{ name = "gitignore-parser" },
{ name = "httpx" },
{ name = "prime-evals" },
{ name = "prime-sandboxes" },
{ name = "prime-traces" },
{ name = "prime-tunnel" },
{ name = "pydantic" },
{ name = "pyyaml" },
{ name = "rich" },
{ name = "toml" },
{ name = "tomli" },
{ name = "typer" },
]
sdist = { url = "https://files.pythonhosted.org/packages/68/c8/b37b13f4a5904be93d14b34485202577a18b7a70e995dda8082283ac1d17/prime-0.8.0.tar.gz", hash = "sha256:cd86f667b5c8910c36e748ecfdb1680025cf1928d6c51a696c74c8fec05c2596", size = 529963, upload-time = "2026-09-29T01:33:26.6Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/db/85/01110e29549272e4965c64112c490df0dba85968397e1fa6bdbe001aee2f/prime-0.8.0-py3-none-any.whl", hash = "sha256:fcbbbbad72489497eb0f17e62c3966d11182d38e1d6e217b3844fc6c3b2d85c4", size = 287686, upload-time = "2026-09-29T01:33:25.089Z" },
]
[[package]]
name = "prime-evals"
version = "0.2.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
{ name = "pydantic" },
{ name = "tenacity" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9c/89/bfbb4aa271669b16e9bc1303d3edeaaace000e5dd29df9ac7ffebf1fb59e/prime_evals-0.2.4.tar.gz", hash = "sha256:759d99e58f587ce8be314a58bdc811106006a74435e981c95c7783045f41cdd0", size = 16575, upload-time = "2026-09-15T17:15:12.452Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b8/95/c3c2ac163f3ae4909e3e4f47f3244441006432e9e78e9a14833466bac769/prime_evals-0.2.4-py3-none-any.whl", hash = "sha256:50641df3bbc63acac9a85595c2ec363260d41bcc78775a227800449c20648f69", size = 14267, upload-time = "2026-09-15T17:15:11.083Z" },
]
[[package]]
name = "prime-kernels"
version = "0.1.0+cu130torch2.13.0"
@@ -4878,10 +4923,10 @@ dependencies = [
{ name = "openai" },
{ name = "orjson" },
{ name = "pandas" },
{ name = "prime" },
{ name = "prime-pydantic-config" },
{ name = "prime-rl-configs" },
{ name = "prime-runs", extra = ["train"] },
{ name = "prime-sandboxes" },
{ name = "prometheus-client" },
{ name = "psutil" },
{ name = "pyarrow" },
@@ -4928,8 +4973,8 @@ all = [
{ name = "torchdata", marker = "sys_platform == 'linux'" },
{ name = "torchtitan", marker = "sys_platform == 'linux'" },
{ name = "torchvision", marker = "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", version = "0.30.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.30.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.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'" },
]
@@ -4978,8 +5023,8 @@ gpu = [
{ name = "torchdata", marker = "sys_platform == 'linux'" },
{ name = "torchtitan", marker = "sys_platform == 'linux'" },
{ name = "torchvision", marker = "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", version = "0.30.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
{ name = "vllm", version = "0.30.0", source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.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'" },
@@ -5037,6 +5082,7 @@ requires-dist = [
{ name = "orjson", specifier = ">=3.10" },
{ name = "orjson", specifier = ">=3.11.0" },
{ name = "pandas", specifier = ">=2.0" },
{ name = "prime", specifier = ">=0.8.0" },
{ name = "prime-kernels", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'kernels'", 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" },
{ name = "prime-kernels", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'kernels'" },
{ name = "prime-kernels", marker = "platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'kernels'", url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.1/prime_kernels-0.1.0+cu130torch2.13.0-cp312-cp312-linux_x86_64.whl" },
@@ -5049,7 +5095,6 @@ requires-dist = [
{ name = "prime-rl", extras = ["quack"], marker = "extra == 'all'" },
{ name = "prime-rl-configs", editable = "packages/prime-rl-configs" },
{ name = "prime-runs", extras = ["train"], specifier = ">=0.1.3" },
{ name = "prime-sandboxes", specifier = ">=0.3.2" },
{ name = "prometheus-client", specifier = ">=0.20.0" },
{ name = "psutil", specifier = ">=7.0.0" },
{ name = "pyarrow", specifier = ">=21.0.0" },
@@ -5075,9 +5120,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.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", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'gpu'", url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.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.30.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.30.0/vllm-0.30.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" },
@@ -5118,7 +5163,7 @@ requires-dist = [
{ name = "renderers", specifier = ">=0.1.11" },
{ name = "tomli", specifier = ">=2.2.1" },
{ name = "tomli-w", specifier = ">=1.2.0" },
{ name = "verifiers", specifier = ">=0.3.2.dev143" },
{ name = "verifiers", specifier = ">=0.3.2.dev152" },
]
[[package]]
@@ -5160,15 +5205,15 @@ wheels = [
[[package]]
name = "prime-traces"
version = "0.0.4"
version = "0.0.7"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
{ name = "pydantic" },
]
sdist = { url = "https://files.pythonhosted.org/packages/5f/5d/d3646fb34d4f3cf4caf2064eb3830c4da5c18a3ecd3292ce9e85eb04398f/prime_traces-0.0.4.tar.gz", hash = "sha256:713b59984292304bd4e99a55998b7d69373f22b5205a7e097ef0d0d8e531561c", size = 50935, upload-time = "2026-09-04T16:51:10.488Z" }
sdist = { url = "https://files.pythonhosted.org/packages/26/f6/d015f0d09ec0e83a7b57662062ac5df5ee00cb53cc25e98c2c5780430c4f/prime_traces-0.0.7.tar.gz", hash = "sha256:638b22ced135d46ae386246b7d666f75e831e3db942a0e379b1ad2c9fabfa8e7", size = 56910, upload-time = "2026-09-25T18:20:29.881Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b6/55/de30cc732631522f5f12cb590b63b80cb1c6ca004ad81762d94ee7dda256/prime_traces-0.0.4-py3-none-any.whl", hash = "sha256:68f2b527d266f9c3d02f6c86a1713309a58a61b81e1be6be43948e1dd2456d8f", size = 38409, upload-time = "2026-09-04T16:51:09.201Z" },
{ url = "https://files.pythonhosted.org/packages/74/e9/710e44430f38f8901ad4141c6e8f353c666435166f713bec52431d3e3581/prime_traces-0.0.7-py3-none-any.whl", hash = "sha256:646e5e178428de7dec49d2eb074f42345536139d8b7016dd87c538d431241411", size = 41921, upload-time = "2026-09-25T18:20:28.53Z" },
]
[[package]]
@@ -5191,7 +5236,7 @@ version = "1.2.3"
source = { registry = "https://pypi.org/simple" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "jinja2" },
{ name = "junitparser" },
{ name = "pydantic" },
@@ -5211,7 +5256,7 @@ version = "0.2.0"
source = { editable = "deps/prime-envs/environments/code/programbench_env" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "programbench" },
{ name = "verifiers" },
]
@@ -5845,7 +5890,7 @@ wheels = [
[[package]]
name = "quack-kernels"
version = "0.6.4"
version = "0.6.5"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "apache-tvm-ffi" },
@@ -5854,9 +5899,9 @@ dependencies = [
{ name = "torch", version = "2.13.0+cu130", source = { registry = "https://download.pytorch.org/whl/cu130" } },
{ name = "torch-c-dlpack-ext" },
]
sdist = { url = "https://files.pythonhosted.org/packages/75/5c/67c4a0d54cbb8d4d05af73132d620d1900a193b33e0d5ea6a25829b941d2/quack_kernels-0.6.4.tar.gz", hash = "sha256:8bf08a0e1a85aecc892ce84f4b6ed7abb6a44ec7c68b83040abe174bc8c2b936", size = 845485, upload-time = "2026-08-07T23:25:31.94Z" }
sdist = { url = "https://files.pythonhosted.org/packages/5f/18/6c2a20d00dff254f154fb3b951f4e5a0377a60122c17385e5f08d5f5b5e1/quack_kernels-0.6.5.tar.gz", hash = "sha256:dd9405a4a6fa35fc3a5a18fe35b46a14b0bf7e3ad9fe2451903e355047ac471d", size = 846876, upload-time = "2026-09-11T05:08:20.621Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/28/f5/36ec7e075e90bd92bdf30fee0606f189348c2bbb0af6aebaf7382927c622/quack_kernels-0.6.4-py3-none-any.whl", hash = "sha256:e77c5d1f1299b0b38487fe8737df6c6975daa16bca7f7eb883bd1a74d09e7e78", size = 728458, upload-time = "2026-08-07T23:25:30.549Z" },
{ url = "https://files.pythonhosted.org/packages/73/d8/f5e56c38b286308d115a171e3c5c44f24e9d03980c3cfd22588df40261fa/quack_kernels-0.6.5-py3-none-any.whl", hash = "sha256:df1ddd31366c82eb9692fe087c671209189dcbde53c909c81a865d4ee66b158d", size = 729615, upload-time = "2026-09-11T05:08:19.306Z" },
]
[[package]]
@@ -6135,7 +6180,7 @@ version = "0.1.0"
source = { editable = "deps/prime-envs/environments/search/s1_deepresearch" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -6257,7 +6302,7 @@ version = "5.6.0"
source = { registry = "https://pypi.org/simple" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "numpy" },
{ name = "scikit-learn" },
{ name = "scipy" },
@@ -6860,7 +6905,7 @@ 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'" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers", extra = ["harbor"] },
]
@@ -6983,7 +7028,7 @@ version = "0.22.2"
source = { registry = "https://pypi.org/simple" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/73/6f/f80cfef4a312e1fb34baf7d85c72d4411afde10978d4657f8cdd811d3ccc/tokenizers-0.22.2.tar.gz", hash = "sha256:473b83b915e547aa366d1eee11806deaf419e17be16310ac0a14077f1e28f917", size = 372115, upload-time = "2026-01-05T10:45:15.988Z" }
wheels = [
@@ -7283,7 +7328,7 @@ 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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "orjson" },
{ name = "verifiers" },
]
@@ -7310,7 +7355,7 @@ version = "5.6.2"
source = { registry = "https://pypi.org/simple" }
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 = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "numpy" },
{ name = "packaging" },
{ name = "pyyaml" },
@@ -7699,7 +7744,7 @@ 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'" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'linux'" },
{ name = "verifiers" },
]
@@ -7726,8 +7771,8 @@ wheels = [
[[package]]
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" }
version = "0.30.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_aarch64.whl" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
@@ -7746,7 +7791,7 @@ dependencies = [
{ name = "fastsafetensors" },
{ name = "filelock" },
{ name = "flashinfer-python" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" } },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" } },
{ name = "humming-kernels", extra = ["cu13"] },
{ name = "ijson" },
{ name = "instanttensor" },
@@ -7809,7 +7854,7 @@ dependencies = [
{ name = "xgrammar" },
]
wheels = [
{ 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" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:eb3e11bab695d085098579a6eda2d602419adec3826ebfbcce9a3ffa543eb62e" },
]
[package.metadata]
@@ -7818,7 +7863,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.6" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.3.0" },
{ name = "blake3" },
{ name = "cachetools" },
{ name = "cbor2" },
@@ -7831,9 +7876,9 @@ 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.18" },
{ name = "flashinfer-python", specifier = "==0.6.18.post1" },
{ name = "helion", marker = "extra == 'helion'", specifier = "==1.4.0" },
{ name = "huggingface-hub", specifier = ">=1.28.0" },
{ name = "huggingface-hub", specifier = ">=1.31.0" },
{ name = "humming-kernels", extras = ["cu13"], specifier = "==0.1.12" },
{ name = "ijson" },
{ name = "instanttensor", specifier = ">=0.1.9" },
@@ -7843,7 +7888,7 @@ requires-dist = [
{ name = "llguidance", marker = "platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'ppc64le' or platform_machine == 's390x' or platform_machine == 'x86_64'", specifier = ">=1.7.0,<1.8.0" },
{ name = "lm-format-enforcer", specifier = "==0.11.3" },
{ name = "matplotlib", marker = "extra == 'bench'" },
{ name = "mcp" },
{ name = "mcp", specifier = ">=2.0.0,<3.0.0" },
{ name = "mistral-common", extras = ["audio"], marker = "extra == 'audio'" },
{ name = "mistral-common", extras = ["image"], specifier = ">=1.11.6" },
{ name = "model-hosting-container-standards", specifier = ">=0.1.14,<1.0.0" },
@@ -7852,10 +7897,10 @@ requires-dist = [
{ name = "numba", specifier = "==0.65.0" },
{ name = "numpy" },
{ name = "nvidia-cudnn-frontend", specifier = ">=1.19.1" },
{ name = "nvidia-cutlass-dsl", extras = ["cu13"], specifier = "==4.6.2" },
{ name = "nvidia-cutlass-dsl", extras = ["cu13"], specifier = "==4.7.1" },
{ name = "nvidia-deepstream-videodecode-cu13", marker = "extra == 'deepstream'", specifier = ">=9.0.2" },
{ name = "nvtx", specifier = "==0.2.15" },
{ name = "openai", specifier = ">=2.0.0" },
{ name = "openai", specifier = ">=2.25.0" },
{ name = "openai-harmony", specifier = ">=0.0.3" },
{ name = "opencv-python-headless", specifier = ">=4.13.0" },
{ name = "opentelemetry-api", specifier = ">=1.27.0" },
@@ -7882,7 +7927,7 @@ requires-dist = [
{ name = "python-json-logger" },
{ name = "pyyaml" },
{ name = "pyzmq", specifier = ">=25.0.0" },
{ name = "quack-kernels", specifier = "==0.6.4" },
{ name = "quack-kernels", specifier = "==0.6.5" },
{ name = "regex" },
{ name = "requests", specifier = ">=2.26.0" },
{ name = "runai-model-streamer", extras = ["azure", "gcs", "s3"], marker = "extra == 'runai'", specifier = ">=0.15.7" },
@@ -7919,8 +7964,8 @@ provides-extras = ["zen", "bench", "tensorizer", "fastsafetensors", "instanttens
[[package]]
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" }
version = "0.30.0"
source = { url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_x86_64.whl" }
resolution-markers = [
"platform_machine == 'x86_64' and sys_platform == 'linux'",
]
@@ -7939,7 +7984,7 @@ dependencies = [
{ name = "fastsafetensors" },
{ name = "filelock" },
{ name = "flashinfer-python" },
{ name = "huggingface-hub", version = "1.28.0", source = { registry = "https://pypi.org/simple" } },
{ name = "huggingface-hub", version = "1.32.0", source = { registry = "https://pypi.org/simple" } },
{ name = "humming-kernels", extra = ["cu13"] },
{ name = "ijson" },
{ name = "instanttensor" },
@@ -8002,7 +8047,7 @@ dependencies = [
{ name = "xgrammar" },
]
wheels = [
{ 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" },
{ url = "https://github.com/vllm-project/vllm/releases/download/v0.30.0/vllm-0.30.0-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:ef52ee58c410ead0b8afb190838fa4cbcb52075596f67862a03859d984966ac4" },
]
[package.metadata]
@@ -8011,7 +8056,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.6" },
{ name = "b12x", marker = "extra == 'b12x'", specifier = "==1.3.0" },
{ name = "blake3" },
{ name = "cachetools" },
{ name = "cbor2" },
@@ -8024,9 +8069,9 @@ 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.18" },
{ name = "flashinfer-python", specifier = "==0.6.18.post1" },
{ name = "helion", marker = "extra == 'helion'", specifier = "==1.4.0" },
{ name = "huggingface-hub", specifier = ">=1.28.0" },
{ name = "huggingface-hub", specifier = ">=1.31.0" },
{ name = "humming-kernels", extras = ["cu13"], specifier = "==0.1.12" },
{ name = "ijson" },
{ name = "instanttensor", specifier = ">=0.1.9" },
@@ -8036,7 +8081,7 @@ requires-dist = [
{ name = "llguidance", marker = "platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'ppc64le' or platform_machine == 's390x' or platform_machine == 'x86_64'", specifier = ">=1.7.0,<1.8.0" },
{ name = "lm-format-enforcer", specifier = "==0.11.3" },
{ name = "matplotlib", marker = "extra == 'bench'" },
{ name = "mcp" },
{ name = "mcp", specifier = ">=2.0.0,<3.0.0" },
{ name = "mistral-common", extras = ["audio"], marker = "extra == 'audio'" },
{ name = "mistral-common", extras = ["image"], specifier = ">=1.11.6" },
{ name = "model-hosting-container-standards", specifier = ">=0.1.14,<1.0.0" },
@@ -8045,10 +8090,10 @@ requires-dist = [
{ name = "numba", specifier = "==0.65.0" },
{ name = "numpy" },
{ name = "nvidia-cudnn-frontend", specifier = ">=1.19.1" },
{ name = "nvidia-cutlass-dsl", extras = ["cu13"], specifier = "==4.6.2" },
{ name = "nvidia-cutlass-dsl", extras = ["cu13"], specifier = "==4.7.1" },
{ name = "nvidia-deepstream-videodecode-cu13", marker = "extra == 'deepstream'", specifier = ">=9.0.2" },
{ name = "nvtx", specifier = "==0.2.15" },
{ name = "openai", specifier = ">=2.0.0" },
{ name = "openai", specifier = ">=2.25.0" },
{ name = "openai-harmony", specifier = ">=0.0.3" },
{ name = "opencv-python-headless", specifier = ">=4.13.0" },
{ name = "opentelemetry-api", specifier = ">=1.27.0" },
@@ -8075,7 +8120,7 @@ requires-dist = [
{ name = "python-json-logger" },
{ name = "pyyaml" },
{ name = "pyzmq", specifier = ">=25.0.0" },
{ name = "quack-kernels", specifier = "==0.6.4" },
{ name = "quack-kernels", specifier = "==0.6.5" },
{ name = "regex" },
{ name = "requests", specifier = ">=2.26.0" },
{ name = "runai-model-streamer", extras = ["azure", "gcs", "s3"], marker = "extra == 'runai'", specifier = ">=0.15.7" },