Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b929ec184 | ||
|
|
d72e7e8b1e | ||
|
|
2662c9ace1 | ||
|
|
cde3bcd546 | ||
|
|
f962e9c104 |
@@ -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
|
||||
|
||||
@@ -22,7 +22,9 @@ lr = 2e-5
|
||||
|
||||
[eval]
|
||||
interval = 25
|
||||
num_examples = 32
|
||||
|
||||
[eval.select]
|
||||
limit = 32
|
||||
|
||||
[eval.sampling]
|
||||
max_completion_tokens = 1024
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
#
|
||||
# uv run eval @ configs/debug/eval/multi-env.toml
|
||||
|
||||
num_examples = 16
|
||||
[select]
|
||||
limit = 16
|
||||
|
||||
[[source]]
|
||||
name = "tb2-bash"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Vendored
+1
-1
Submodule deps/verifiers updated: 8854e0da3a...e5a9e17a8c
@@ -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
@@ -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
@@ -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
@@ -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"
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -15,7 +15,9 @@ lr = 2e-5
|
||||
|
||||
[eval]
|
||||
interval = 25
|
||||
num_examples = 32
|
||||
|
||||
[eval.select]
|
||||
limit = 32
|
||||
|
||||
[eval.sampling]
|
||||
max_completion_tokens = 1024
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
@@ -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'" },
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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__}")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
]
|
||||
|
||||
|
||||
@@ -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"}})
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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()]
|
||||
|
||||
@@ -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)
|
||||
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user