Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
330f174761 | ||
|
|
91f58bd9d9 | ||
|
|
7f9de649aa | ||
|
|
88f5e6def1 |
@@ -63,17 +63,19 @@ type = "adamw"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 1536
|
||||
max_inflight = 1536
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -27,6 +27,8 @@ lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -16,9 +16,11 @@ name = "hendrycks-sanity"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset.id = "math-env"
|
||||
|
||||
@@ -17,6 +17,8 @@ name = "reverse-text"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -35,6 +35,8 @@ target_modules = [
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -19,6 +19,8 @@ name = "PrimeIntellect/Qwen3-1.7B-Wordle-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
|
||||
@@ -17,6 +17,8 @@ lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -17,6 +17,8 @@ rank = 8
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -14,6 +14,8 @@ rank = 8
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -20,6 +20,8 @@ impl = "custom"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -22,15 +22,17 @@ name = "ci-rl-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.algo.teacher]
|
||||
[orchestrator.train.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -22,16 +22,18 @@ name = "ci-rl-sft"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.algo.sampling.source]
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ lr = 3e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -17,6 +17,8 @@ lr = 3e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -16,6 +16,8 @@ name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -15,9 +15,11 @@ name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
max_inflight = 128
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -16,6 +16,8 @@ name = "Qwen/Qwen3-4B-Instruct-2507"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -16,6 +16,8 @@ name = "PrimeIntellect/Qwen3-1.7B-Wordle-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -15,6 +15,8 @@ language_model_attr = "model.language_model"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -16,7 +16,7 @@ Minimal end-to-end configs for the algorithms against bundled verifiers envs, us
|
||||
|
||||
The policy inference server is auto-launched on GPU 0 at `http://localhost:8000/v1` with `gpu_memory_utilization=0.5`. The local frozen model (used by `opd*.toml`, `sft_distill.toml` / `sft_distill_lora.toml`, and `mixed_grpo_opd.toml`) is **not** auto-launched — start it manually on GPU 1.
|
||||
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.algo.teacher]` for `opd`, `[orchestrator.algo.sampling.source]` for `sft` — with `name` + `base_url`. `opsd` declares none (it self-distills against the live policy). prime-rl never hosts them; only the trainable policy's server is managed by the `rl` entrypoint.
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.train.algo.teacher]` for `opd`, `[orchestrator.train.algo.sampling.source]` for `sft` — with `name` + `base_url`. `opsd` declares none (it self-distills against the live policy). prime-rl never hosts them; only the trainable policy's server is managed by the `rl` entrypoint.
|
||||
|
||||
## Start the local frozen model
|
||||
|
||||
|
||||
@@ -14,14 +14,16 @@ name = "debug-echo"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
# alphabet-sort's feedback arrives as user messages, so train the user role
|
||||
# instead of echo's tool default.
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "echo"
|
||||
|
||||
[orchestrator.algo.roles.user]
|
||||
[orchestrator.train.algo.roles.user]
|
||||
alpha = 0.1
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
|
||||
@@ -10,9 +10,11 @@ name = "debug-rl"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
|
||||
@@ -10,9 +10,11 @@ name = "debug-max-rl"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "max_rl"
|
||||
|
||||
[orchestrator.renderer]
|
||||
|
||||
@@ -20,9 +20,11 @@ name = "debug-mixed-grpo-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.renderer]
|
||||
|
||||
@@ -17,12 +17,14 @@ name = "debug-opd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.algo.teacher]
|
||||
[orchestrator.train.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -17,12 +17,14 @@ name = "debug-opd-lora"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.algo.teacher]
|
||||
[orchestrator.train.algo.teacher]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@ name = "debug-rae"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 1
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "rae"
|
||||
|
||||
[orchestrator.renderer]
|
||||
|
||||
@@ -16,10 +16,12 @@ name = "debug-self-distill"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 1
|
||||
|
||||
# reverse-text's demo lives in the "answer" column.
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opsd"
|
||||
demo_key = "answer"
|
||||
|
||||
|
||||
@@ -17,13 +17,15 @@ name = "debug-sft"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.algo.sampling.source]
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -17,13 +17,15 @@ name = "debug-sft-lora"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 4
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "sft"
|
||||
|
||||
# sft's teacher IS the model it samples from.
|
||||
[orchestrator.algo.sampling.source]
|
||||
[orchestrator.train.algo.sampling.source]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-RL"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
|
||||
|
||||
@@ -88,13 +88,15 @@ type = "sign_sgd"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
group_size = 8
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -9,6 +9,8 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.renderer]
|
||||
|
||||
Vendored
+1
-1
Submodule deps/verifiers updated: e5a9e17a8c...5406ebcfe3
+22
-22
@@ -30,7 +30,7 @@ This page covers the math and the configurable algorithmic components: the algor
|
||||
|
||||
## The Algorithm Abstraction
|
||||
|
||||
A training algorithm in `prime-rl` is configured under `[orchestrator.algo]`, where **`type` names the algorithm** (`grpo`, `opd`, `sft`, …) and the class defaults are its vetted setting. It has two parts:
|
||||
A training algorithm in `prime-rl` is configured under `[orchestrator.train.algo]`, where **`type` names the algorithm** (`grpo`, `opd`, `sft`, …) and the class defaults are its vetted setting. It has two parts:
|
||||
|
||||
1. **Sampling** (`algo.sampling`) — how train rollouts are produced: which model generates them. `source` is a [model reference](#model-references): `"policy"` (the live policy, the default) or an inline frozen hosted model. Group sizing stays on the env config (`group_size`).
|
||||
2. **The per-token training signal** — credit assignment and loss routing, fused; the algorithm's own parameters sit directly on `algo`. One mapping from a finalized rollout to per-token *(loss component, weight)* pairs — the credit a token gets and the loss that consumes it are two coordinates of the same output. Group-relative algorithms compute credit on the orchestrator and ship per-token advantage streams; reference-KL algorithms query a reference model at batch-ship time (bounded concurrency) and ship its prefill logprobs for the trainer to evaluate against the live policy. The `type` determines which loss component consumes the action tokens (`rl` / `ce` / `ref_kl`) and what happens to env-provided observation tokens in multi-turn rollouts (masked out by default; `echo` trains on them with weighted CE).
|
||||
@@ -42,17 +42,17 @@ The trainer is algorithm-blind: the loss is a sum of three components (rl, ce, r
|
||||
`prime-rl` hosts exactly one model: the trainable policy (`[orchestrator.model]`). Every other model an algorithm uses is an external OpenAI-compatible endpoint, declared *inline on the component that uses it*. A model reference is either the string `"policy"` (the live policy) or a frozen hosted model (`name` + `base_url`):
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opd"
|
||||
|
||||
[orchestrator.algo.teacher] # opd's teacher: the frozen model it scores against
|
||||
[orchestrator.train.algo.teacher] # opd's teacher: the frozen model it scores against
|
||||
name = "Qwen/Qwen3-32B"
|
||||
base_url = "http://localhost:8001/v1"
|
||||
```
|
||||
|
||||
Model *roles* are algorithm-local vocabulary — each algorithm names its reference on the field where the model is actually used, and there is no shared `teacher` slot. `opd` declares a `teacher` field (the frozen model whose reverse KL the policy distills toward); `sft`'s teacher *is* its `sampling.source` (the frozen model it imitates); `opsd` self-distills against the live policy and names no model at all. No role exists outside the algorithm that declares it: the dispatcher, sink, and trainer branch on liveness alone, never on what an algorithm calls a model.
|
||||
|
||||
So for `opd` set `[orchestrator.algo.teacher]`; for `sft` set `[orchestrator.algo.sampling.source]`; `opsd` needs neither. `opd`'s teacher must be a frozen endpoint — it is typed `FrozenModelConfig`, so `"policy"` isn't representable (the KL would be identically zero); `opsd`'s teacher *is* the live policy by definition (self-distillation conditioned on a demonstration), so it exposes no reference to configure.
|
||||
So for `opd` set `[orchestrator.train.algo.teacher]`; for `sft` set `[orchestrator.train.algo.sampling.source]`; `opsd` needs neither. `opd`'s teacher must be a frozen endpoint — it is typed `FrozenModelConfig`, so `"policy"` isn't representable (the KL would be identically zero); `opsd`'s teacher *is* the live policy by definition (self-distillation conditioned on a demonstration), so it exposes no reference to configure.
|
||||
|
||||
Liveness is a property of the reference, not of any role: rollouts sampled from `"policy"` get version-salted prefix caches, carry sampling logprobs for importance ratios, and age off-policy as weights update; rollouts and scores from frozen models get a stable prefix cache and never go stale. Frozen models are externally hosted (`base_url` is required) — `prime-rl` never launches or updates them, and each env's algorithm builds its own client pool to the endpoints it declares.
|
||||
|
||||
@@ -61,7 +61,7 @@ Liveness is a property of the reference, not of any role: rollouts sampled from
|
||||
The `algo.type` names the algorithm, and each type's class defaults are its vetted setting — picking a type with no other keys IS the algorithm:
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo" # the default
|
||||
```
|
||||
|
||||
@@ -83,13 +83,13 @@ Every key beyond `type` is visibly your own assembly — there is no preset laye
|
||||
```toml
|
||||
# echo on tool AND user feedback tokens, each at its own weight.
|
||||
# Setting any role replaces the whole table.
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "echo"
|
||||
|
||||
[orchestrator.algo.roles.tool]
|
||||
[orchestrator.train.algo.roles.tool]
|
||||
alpha = 0.25
|
||||
|
||||
[orchestrator.algo.roles.user]
|
||||
[orchestrator.train.algo.roles.user]
|
||||
alpha = 0.05
|
||||
```
|
||||
|
||||
@@ -98,10 +98,10 @@ A new algorithm is a named class in code, not a config that points at an import
|
||||
Echo also takes an optional user-supplied token filter that narrows the role selection per rollout — e.g. dropping warning lines from tool output, or tokens the sampler found unlikely:
|
||||
|
||||
```toml
|
||||
[orchestrator.algo.filter]
|
||||
[orchestrator.train.algo.filter]
|
||||
import_path = "my_module.drop_warnings"
|
||||
|
||||
[orchestrator.algo.filter.kwargs]
|
||||
[orchestrator.train.algo.filter.kwargs]
|
||||
patterns = ["WARNING"]
|
||||
```
|
||||
|
||||
@@ -116,14 +116,14 @@ Component compatibility is validated at config time: frozen-model sampling can o
|
||||
|
||||
### Per-Env Algorithms
|
||||
|
||||
Both components resolve per environment. Each env inherits `[orchestrator.algo]` unless it sets its own, so a single run can mix algorithms across envs — e.g. GRPO on math, ECHO on a terminal env:
|
||||
Both components resolve per environment. Each env inherits `[orchestrator.train.algo]` like any other group default: an env that sets only some params keeps the group's algorithm with those params changed, and an env that sets a different `type` runs its own algorithm. So a single run can mix algorithms across envs — e.g. GRPO on math, ECHO on a terminal env:
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "math" # inherits the top-level grpo
|
||||
name = "math" # inherits the group's grpo
|
||||
env.taskset.id = "math"
|
||||
env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
@@ -139,7 +139,7 @@ algo.type = "echo"
|
||||
|
||||
### The Algorithm Classes
|
||||
|
||||
At runtime, each env's resolved config builds two objects: a `GenerationSource` (`prime_rl.orchestrator.generation_source`) that resolves the `sampling.source` model into the inference pool used for train episodes, and one of the named algorithm classes in `prime_rl.orchestrator.algo` (one module per algorithm: `algo/grpo.py`, `algo/opd.py`, …) from the algorithm config. Algorithm dispatch is keyed on `algo.type` — it names the algorithm, and each config class's defaults are its vetted parameterization:
|
||||
At runtime, each env's resolved config builds two objects: a `GenerationSource` (`prime_rl.orchestrator.generation_source`) that resolves the `sampling.source` model into the inference pool used for train episodes, and one of the named algorithm classes in `prime_rl.orchestrator.train.algo` (one module per algorithm: `algo/grpo.py`, `algo/opd.py`, …) from the algorithm config. Algorithm dispatch is keyed on `algo.type` — it names the algorithm, and each config class's defaults are its vetted parameterization:
|
||||
|
||||
| `algo.type` | Class | hook(s) — stage |
|
||||
|---|---|---|
|
||||
@@ -159,7 +159,7 @@ Algorithms operate on native verifier artifacts and annotate their message graph
|
||||
|
||||
The pipeline drives these through `finalize_episode` and `finalize_group`. Advantages, reference logprobs, and named loss weights stay on verifier nodes through admission. Only admitted traces are flattened into `TrainingSample`s.
|
||||
|
||||
Class-level declarations state what the algorithm needs: which loss component its action tokens feed (`action_loss_type`). Every class is constructed with its algorithm config plus the one host-owned resource it can't rebuild — the live policy clients (`self.clients`). Everything else an algorithm needs it builds from its own config in `setup()`: `opd` connects its frozen `teacher`; `opsd` builds the renderer for its demonstration hint (tokenizer is always the live policy's — self-distillation has no separate model). The pipeline only ever calls the two `finalize_*` methods — writing your own algorithm is subclassing `Algorithm` and overriding the hooks its signal needs (see [Authoring an Algorithm](#authoring-an-algorithm)). Shared math (efficiency shaping, prefill alignment) lives as plain functions in `prime_rl.orchestrator.algo.advantage`.
|
||||
Class-level declarations state what the algorithm needs: which loss component its action tokens feed (`action_loss_type`). Every class is constructed with its algorithm config plus the one host-owned resource it can't rebuild — the live policy clients (`self.clients`). Everything else an algorithm needs it builds from its own config in `setup()`: `opd` connects its frozen `teacher`; `opsd` builds the renderer for its demonstration hint (tokenizer is always the live policy's — self-distillation has no separate model). The pipeline only ever calls the two `finalize_*` methods — writing your own algorithm is subclassing `Algorithm` and overriding the hooks its signal needs (see [Authoring an Algorithm](#authoring-an-algorithm)). Shared math (efficiency shaping, prefill alignment) lives as plain functions in `prime_rl.orchestrator.train.algo.advantage`.
|
||||
|
||||
## Async / Off-Policy Training
|
||||
|
||||
@@ -323,10 +323,10 @@ This is intentionally simple — it does the right thing for most envs. Write a
|
||||
A **length penalty** (`length_penalty` on the `grpo`-family algorithms) can be layered on top to discourage rambling. The `linear` penalty subtracts a single `pass_rate`-scaled penalty from each reward before the GRPO baseline, combining output tokens (`num_output_tokens_weight`), input / context tokens (`num_input_tokens_weight`), and turns (`num_turns_weight`) — each normalized by the group's own max for that quantity, with `num_input_tokens_weight` and `num_turns_weight` defaulting to `0.1`.
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
```
|
||||
|
||||
@@ -362,7 +362,7 @@ For example, if three solvers receive rewards `[1, 1, 0]` on one proposed proble
|
||||
Configure which roles are compared within a single proposed problem with `episode_agents`. For `proposer-solver`, that role is `solver`:
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "hierarchical_grpo"
|
||||
episode_agents = ["solver"]
|
||||
|
||||
@@ -388,7 +388,7 @@ Group-relative baselines assume the group is exchangeable attempts by one agent.
|
||||
`rae` implements SPIRAL's role-conditioned advantage estimation ([arXiv:2506.24119](https://arxiv.org/abs/2506.24119)): each agent keeps an exponential-moving-average baseline of its own rewards, and every trace's advantage is its reward minus its agent's baseline — measured against the *pre-update* baseline (the unbiased order), then folded in at `decay` (SPIRAL's α, default 0.95). The algorithm instance is per-env, so baselines are keyed per (env, agent) — the paper's per (game, role). Advantages are not normalized, and `group_size` is free (RAE needs no sibling rollouts; `group_size = 1` is fine). Baselines live in orchestrator memory and re-warm from 0 over ~`1/(1 − decay)` traces per agent after a restart.
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "rae"
|
||||
decay = 0.95
|
||||
|
||||
@@ -411,8 +411,8 @@ There is no config hook that points at user code — a new credit-assignment sch
|
||||
# src/prime_rl/orchestrator/algo/my_algo.py
|
||||
import torch
|
||||
|
||||
from prime_rl.orchestrator.algo.base import Algorithm
|
||||
from prime_rl.orchestrator.algo.routing import assign_advantages
|
||||
from prime_rl.orchestrator.train.algo.base import Algorithm
|
||||
from prime_rl.orchestrator.train.algo.routing import assign_advantages
|
||||
|
||||
|
||||
class MyAlgorithm(Algorithm):
|
||||
@@ -436,7 +436,7 @@ Curriculum admission and metrics can inspect the resulting graph-native streams
|
||||
- `opsd` — SDFT: prepend an expert demonstration as a leading system message (`template`, with a `{demonstration}` placeholder) and score the sample under that demo-conditioned context. The sample is scored verbatim (`hint_block + token_ids`, slicing the hint's logprobs back off), so the join is BPE-clean and it's robust to tool/multimodal prompts and any number of turns. The scoring reference *is* the live policy — self-distillation names no teacher. opsd builds its own renderer to tokenize the hint block: the tokenizer is always the live policy's (not configurable — there is no separate model), and only the `renderer` family is settable (defaults to `"auto"`, resolved from the policy tokenizer; set it to match a non-auto policy renderer). The demonstration is read from the example's `info[demo_key]`, falling back to a top-level rollout field of the same name (e.g. `answer`).
|
||||
|
||||
```toml
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "opsd"
|
||||
demo_key = "demonstration"
|
||||
```
|
||||
|
||||
+15
-7
@@ -171,23 +171,31 @@ env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
```
|
||||
|
||||
Each source group — `[orchestrator.train]`, `[orchestrator.eval]`, the `[eval]` block of `sft` and the top level of `eval` — takes an `env` block that each of its sources inherits. A source's own `env` values win. The block holds only the knobs that every env and taskset has: `retries`, `timeout`, `max_concurrent_agents`, `interception`, and `taskset.task` and `taskset.system_prompt`. Ids and agents stay on each source:
|
||||
Each source group — `[orchestrator.train]`, `[orchestrator.eval]`, the `[eval]` block of `sft` and the top level of `eval` — holds defaults for its sources. Every field that a group and its sources both have is a default: `env`, `sampling`, `select` and `group_size`, plus `algo` on the train group and `interval` on the eval groups of a training run. Each source inherits the fields that its group sets. One rule applies to all of them: nested blocks merge key by key, a source's own values win, and a block whose `type` (e.g. of `algo`) differs from the group's is the source's alone.
|
||||
|
||||
```toml
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
env.taskset.id = "math"
|
||||
group_size = 32 # this source's own value wins over the group's 16
|
||||
|
||||
[orchestrator.eval.env]
|
||||
retries.max_retries = 3
|
||||
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]
|
||||
[orchestrator.eval.select] # evaluate 128 tasks of each taskset
|
||||
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.
|
||||
The group `env` block holds only the knobs that every env and taskset has: `retries`, `timeout`, `max_concurrent_agents`, `interception`, and `taskset.task` and `taskset.system_prompt`. Ids and agents stay on each source. `select` picks which tasks of a source's taskset run: `include`/`exclude` by task `idx`/`ids`/`keys`/`names`, then `shuffle`, `skip` and `limit`, in that order.
|
||||
|
||||
`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; 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>.*`).
|
||||
|
||||
|
||||
+5
-5
@@ -59,9 +59,9 @@ A condensed view of the knobs you'll most often tune. For trainer-side paralleli
|
||||
|---|---|
|
||||
| `orchestrator.batch_size` | Tasks per trainer step. |
|
||||
| `orchestrator.constant_trainer_batch_size` | Keep trainer batches constant when samples have no training signal, such as zero advantage on all tokens. Enabled by default. Disable it for faster collection with variable trainer batch sizes. |
|
||||
| `orchestrator.group_size` | Rollouts generated per task. |
|
||||
| `orchestrator.train.group_size` | Rollouts generated per task. |
|
||||
| `orchestrator.max_off_policy_steps` | Maximum staleness of a trained rollout (default 8): the version a batch trains on minus the oldest version that generated the rollout, queue time included. Episodes past the bound are dropped; a group shares one dispatch version, so its episodes age out together. The main off-policy dial on long agentic rollouts — bump for throughput, lower for tighter on-policyness. Watch `off_policy/*` and `mismatch_kl/all/mean` when tuning. |
|
||||
| `[orchestrator.algo]` | Training algorithm — its `type` names it (`grpo` default, `max_rl`, `rae`, `hierarchical_grpo`, `opd`, `opsd`, `sft`, `echo`). See [Algorithms](#algorithms). |
|
||||
| `[orchestrator.train.algo]` | Training algorithm — its `type` names it (`grpo` default, `max_rl`, `rae`, `hierarchical_grpo`, `opd`, `opsd`, `sft`, `echo`). See [Algorithms](#algorithms). |
|
||||
| `[[orchestrator.train.source]]` | Training sources. List multiple tables for multi-env training; weight them via `ratio`. See [Configuration § Training sources](configuration.md#training-sources-orchestratortrainsource). |
|
||||
| `[[orchestrator.eval.source]]` + `orchestrator.eval.interval` | Eval environments and cadence (default every 100 steps). |
|
||||
|
||||
@@ -86,7 +86,7 @@ A condensed view of the knobs you'll most often tune. For trainer-side paralleli
|
||||
|
||||
### Algorithms
|
||||
|
||||
The RL entrypoint supports several training algorithms, switched via `[orchestrator.algo]`'s `type` (see [Algorithms](algorithms.md#the-algorithm-abstraction) for the full reference, model references, and per-algorithm customization):
|
||||
The RL entrypoint supports several training algorithms, switched via `[orchestrator.train.algo]`'s `type` (see [Algorithms](algorithms.md#the-algorithm-abstraction) for the full reference, model references, and per-algorithm customization):
|
||||
|
||||
| `algo.type` | Frozen model | Use case |
|
||||
|---|---|---|
|
||||
@@ -101,7 +101,7 @@ The RL entrypoint supports several training algorithms, switched via `[orchestra
|
||||
|
||||
A new algorithm is a named class in code, not a config — see [Algorithms § Authoring an Algorithm](algorithms.md#authoring-an-algorithm).
|
||||
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.algo.teacher]` for `opd` (the frozen model scored against), `[orchestrator.algo.sampling.source]` for `sft` (the model it samples from) — each with `name` + `base_url`. `opsd` declares no frozen model: it self-distills against the live policy. The `rl` entrypoint only manages policy inference — start frozen-model servers yourself and point `base_url` at them:
|
||||
Frozen models are declared inline on the algorithm, named where the model is used — `[orchestrator.train.algo.teacher]` for `opd` (the frozen model scored against), `[orchestrator.train.algo.sampling.source]` for `sft` (the model it samples from) — each with `name` + `base_url`. `opsd` declares no frozen model: it self-distills against the live policy. The `rl` entrypoint only manages policy inference — start frozen-model servers yourself and point `base_url` at them:
|
||||
|
||||
```bash
|
||||
CUDA_VISIBLE_DEVICES=1 uv run inference \
|
||||
@@ -405,6 +405,6 @@ Requires `PRIME_API_KEY` (`prime login` or the env var) and a team (`PRIME_TEAM_
|
||||
|
||||
- **Start small.** Run `examples/basic/reverse-text/rl.toml` end-to-end on 2 GPUs before scaling. If the smoke run finishes cleanly, your install is good.
|
||||
- **Batch size ≥ 64.** Smaller batches give noisy gradient estimates and the trainer's overhead-per-step dominates throughput. 64 is the practical floor; 128–512 is the range for quick ablations; production RL often runs at 1024+.
|
||||
- **Group size ≥ 8.** Bigger groups (`orchestrator.group_size`) make it more likely that a task produces a mix of high- and low-reward rollouts, which is what gives the trainer a usable signal — if all rollouts in a group succeed or all fail, the within-group advantage collapses to zero and the trainer learns nothing from that task. Bigger groups also tighten advantage normalization. 8 is the floor; 16–32 is common.
|
||||
- **Group size ≥ 8.** Bigger groups (`orchestrator.train.group_size`) make it more likely that a task produces a mix of high- and low-reward rollouts, which is what gives the trainer a usable signal — if all rollouts in a group succeed or all fail, the within-group advantage collapses to zero and the trainer learns nothing from that task. Bigger groups also tighten advantage normalization. 8 is the floor; 16–32 is common.
|
||||
- **Runs never share a directory.** Every launch writes to its own run directory `<output_dir>/<run_name>`, auto-named `<envs>--<model>--<short-id>` by default. Name runs you want to find again or resume with `--run.name <name>`; re-using a name blocks unless you resume or pass `--clean`.
|
||||
- **Use `--dry-run` before SLURM.** Validators (e.g. CP needs flash-attention) fail fast in dry-run and slow in queue.
|
||||
|
||||
@@ -68,9 +68,11 @@ type = "muon"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 256
|
||||
max_inflight = 512
|
||||
@@ -79,10 +81,10 @@ max_inflight = 512
|
||||
name = "glm-4.5"
|
||||
thinking_retention = "all"
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -83,13 +83,15 @@ type = "sign_sgd"
|
||||
# --- Orchestrator ---
|
||||
|
||||
[orchestrator]
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -79,13 +79,15 @@ type = "muon"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -69,9 +69,11 @@ type = "muon"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 256
|
||||
max_inflight = 512
|
||||
@@ -80,10 +82,10 @@ max_inflight = 512
|
||||
name = "glm-4.5"
|
||||
thinking_retention = "all"
|
||||
|
||||
[orchestrator.algo]
|
||||
[orchestrator.train.algo]
|
||||
type = "grpo"
|
||||
|
||||
[orchestrator.algo.length_penalty]
|
||||
[orchestrator.train.algo.length_penalty]
|
||||
type = "linear"
|
||||
num_output_tokens_weight = 0.0
|
||||
num_input_tokens_weight = 0.1
|
||||
|
||||
@@ -109,9 +109,11 @@ weight_decay = 0.0
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
group_size = 16
|
||||
max_off_policy_steps = 8 # 16/32 can be better, 8 is more CPU stable
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 256
|
||||
max_inflight = 512
|
||||
|
||||
@@ -45,6 +45,8 @@ weight_decay = 0.01
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 2048
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -42,9 +42,11 @@ lr = 1e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
max_off_policy_steps = 8
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 1024
|
||||
|
||||
|
||||
@@ -43,9 +43,11 @@ lr = 1e-6
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
max_off_policy_steps = 16
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.concurrency]
|
||||
initial_inflight = 1024
|
||||
|
||||
|
||||
@@ -32,9 +32,11 @@ freq = 1
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 16
|
||||
max_off_policy_steps = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
env.taskset.id = "general-agent"
|
||||
env.taskset.min_tier = 1
|
||||
|
||||
@@ -26,6 +26,8 @@ lr = 1e-5
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 256
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -13,9 +13,11 @@ name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
group_size = 8
|
||||
seq_len = 8192
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
name = "hendrycks-math"
|
||||
env.taskset.id = "math-env"
|
||||
|
||||
@@ -10,6 +10,8 @@ name = "reverse-text"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 128
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -31,6 +31,8 @@ target_modules = [
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[orchestrator.concurrency]
|
||||
|
||||
@@ -16,6 +16,8 @@ name = "PrimeIntellect/Qwen3-1.7B-Wordle-SFT"
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 512
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 16
|
||||
|
||||
[[orchestrator.train.source]]
|
||||
|
||||
@@ -13,6 +13,8 @@ num_infer_gpus = 1
|
||||
|
||||
[orchestrator]
|
||||
batch_size = 32
|
||||
|
||||
[orchestrator.train]
|
||||
group_size = 8
|
||||
|
||||
[orchestrator.train.sampling]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
max_steps = 20
|
||||
seq_len = 2048
|
||||
batch_size = 128
|
||||
group_size = 16
|
||||
|
||||
[model]
|
||||
name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
@@ -10,6 +9,9 @@ name = "PrimeIntellect/Qwen3-0.6B-Reverse-Text-SFT"
|
||||
project = "reverse-text"
|
||||
name = "reverse-text"
|
||||
|
||||
[train]
|
||||
group_size = 16
|
||||
|
||||
[train.sampling]
|
||||
max_completion_tokens = 128
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies = [
|
||||
"renderers>=0.1.11",
|
||||
"tomli>=2.2.1",
|
||||
"tomli-w>=1.2.0",
|
||||
"verifiers>=0.3.2.dev152",
|
||||
"verifiers>=0.3.2.dev158",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
|
||||
@@ -28,11 +28,12 @@ class ServedEvalConfig(EvalSourcesConfig):
|
||||
rate limiting."""
|
||||
|
||||
heartbeat: HeartbeatConfig | None = None
|
||||
"""BetterStack heartbeat for the run: one ping per landed episode — the first
|
||||
"""BetterStack heartbeat for the run: pinged by landed episodes — the first
|
||||
landed episode is the first beat, so the run's boot never shows up as a
|
||||
stale-prone silence. When episodes stop landing, the pings stop and the heartbeat
|
||||
goes stale on Better Stack after its grace period. Size that period + grace above
|
||||
the longest legitimate gap between episodes."""
|
||||
stale-prone silence. Pings are throttled to at most one every
|
||||
``heartbeat.min_interval`` seconds. When episodes stop landing, the pings stop
|
||||
and the heartbeat goes stale on Better Stack after its grace period. Size that
|
||||
period + grace above the longest legitimate gap between episodes."""
|
||||
|
||||
@property
|
||||
def env_addresses(self) -> dict[tuple[str, str], str | None]:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Any, Literal, TypeAlias
|
||||
from typing import Annotated, Any, Literal, TypeAlias, get_args
|
||||
|
||||
import verifiers.v1 as vf
|
||||
from pydantic import Field, SerializeAsAny, ValidationError, model_validator
|
||||
from pydantic import AliasChoices, BaseModel, Field, SerializeAsAny, TypeAdapter, ValidationError, model_validator
|
||||
from pydantic.fields import FieldInfo
|
||||
from renderers import AutoRendererConfig, RendererConfig
|
||||
|
||||
from prime_rl.configs.algorithm import (
|
||||
@@ -194,49 +195,32 @@ class EnvConfig(BaseConfig):
|
||||
return self
|
||||
|
||||
|
||||
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
|
||||
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 inherit_defaults(defaults: dict[str, Any], source: dict) -> dict:
|
||||
"""Fill in one raw source with its group's ``defaults`` (field name to validated
|
||||
group value). A config block such as ``sampling`` is filled in key by key with
|
||||
``vf.merge_defaults``; a plain value such as ``group_size`` is used only when the
|
||||
source leaves it unset. The source's own values always win, and a block that the
|
||||
source passes as an already-built config is kept as is."""
|
||||
merged = dict(source)
|
||||
for name, value in defaults.items():
|
||||
own = source.get(name)
|
||||
if isinstance(value, BaseModel):
|
||||
if own is None or isinstance(own, dict):
|
||||
merged[name] = vf.merge_defaults(value, own)
|
||||
elif name not in source:
|
||||
merged[name] = value
|
||||
return merged
|
||||
|
||||
|
||||
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
|
||||
def raw_field(data: dict, name: str, field: FieldInfo) -> tuple[bool, Any]:
|
||||
"""Whether raw ``data`` sets field ``name``, under its name or an alias (``-r``
|
||||
arrives as ``r``), and the value it sets."""
|
||||
alias = field.validation_alias
|
||||
keys = [name, *(alias.choices if isinstance(alias, AliasChoices) else [alias] if alias else [])]
|
||||
for key in keys:
|
||||
if isinstance(key, str) and key in data:
|
||||
return True, data[key]
|
||||
return False, None
|
||||
|
||||
|
||||
class StandardSamplerConfig(BaseConfig):
|
||||
@@ -318,13 +302,14 @@ class TrainSourceConfig(EnvConfig):
|
||||
"""Sampling weight for this environment in the buffer. Relative weights are normalized to probabilities across envs (e.g. [1, 1] and [0.5, 0.5] are equivalent). Defaults to 1, i.e. equal weight per env."""
|
||||
|
||||
group_size: int = Field(1, ge=1)
|
||||
"""Rollouts generated per example for GRPO group-relative advantages.
|
||||
Inherits from ``orchestrator.group_size`` when unset."""
|
||||
"""Rollouts generated per example for GRPO group-relative advantages. Overrides the
|
||||
train group's ``group_size`` for this env, so envs can use different sizes."""
|
||||
|
||||
algo: AlgoConfig | None = None
|
||||
"""Training algorithm for this env. Inherits from the top-level
|
||||
``orchestrator.algo`` when unset; set ``type`` (and its params) to give
|
||||
this env its own algorithm."""
|
||||
algo: AlgoConfig = GRPOAlgoConfig()
|
||||
"""Training algorithm for this env: sampling plus the per-token training signal
|
||||
(credit assignment and loss routing, fused — its ``type`` names the algorithm).
|
||||
Setting only some params keeps the group's algorithm; a different ``type`` is
|
||||
this env's own algorithm."""
|
||||
|
||||
curriculum: CurriculumConfig | None = None
|
||||
"""User-authored task sampler and admission gates. The default cycles
|
||||
@@ -343,41 +328,68 @@ class OnlineEvalSourceConfig(EvalSourceConfig):
|
||||
"""An eval source of a training run: evaluated on a step interval."""
|
||||
|
||||
interval: int = Field(100, ge=1)
|
||||
"""Per-env eval interval. If unset, inherits from the group-level eval interval."""
|
||||
"""Step interval at which to evaluate this env."""
|
||||
|
||||
|
||||
class TrainConfig(BaseConfig):
|
||||
source: list[TrainSourceConfig] = Field(default_factory=list)
|
||||
"""Training sources."""
|
||||
class SourceGroupConfig(BaseConfig):
|
||||
"""A list of sources plus defaults for them.
|
||||
|
||||
Any field that both the group and its source type declare (``env``, ``sampling``,
|
||||
``select``, ``group_size``, ...) is a default. Before validation, each source gets
|
||||
the group's value for every such field that the group sets:
|
||||
|
||||
- a field the source sets itself keeps the source's value;
|
||||
- a nested block is filled in key by key (``vf.merge_defaults``);
|
||||
- a block with a different ``type``/``id`` (e.g. another ``algo``) is the source's
|
||||
alone.
|
||||
|
||||
A field the group leaves unset is not passed on, so each group field must default
|
||||
to the same value as the source field it feeds."""
|
||||
|
||||
env: vf.SharedEnvConfig = vf.SharedEnvConfig()
|
||||
"""Env knobs that every training source inherits: the fields every env and taskset
|
||||
has, such as ``retries`` and ``timeout``. A source's own ``env`` values win."""
|
||||
|
||||
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."""
|
||||
"""Env knobs that every source inherits: the fields every env and taskset has, such
|
||||
as ``retries`` and ``timeout``."""
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def resolve_group_defaults(cls, data):
|
||||
return merge_group_defaults(data)
|
||||
def inherit_group_defaults(cls, data: Any) -> Any:
|
||||
"""Pass the group's set defaults down into each raw source."""
|
||||
if not isinstance(data, dict) or not isinstance(data.get("source"), list):
|
||||
return data
|
||||
(source_type,) = get_args(cls.model_fields["source"].annotation)
|
||||
defaults: dict[str, Any] = {}
|
||||
for name, field in cls.model_fields.items():
|
||||
if name == "source" or name not in source_type.model_fields:
|
||||
continue
|
||||
is_set, raw = raw_field(data, name, field)
|
||||
if not is_set:
|
||||
continue
|
||||
try:
|
||||
defaults[name] = TypeAdapter(field.rebuild_annotation()).validate_python(raw)
|
||||
except ValidationError:
|
||||
continue # the group field reports its own errors once, not once per source
|
||||
data["source"] = [
|
||||
inherit_defaults(defaults, source) if isinstance(source, dict) else source for source in data["source"]
|
||||
]
|
||||
return data
|
||||
|
||||
@model_validator(mode="after")
|
||||
def resolve_env_defaults(self):
|
||||
"""Resolve per-env overrides: inherit group-level sampling (the worker ``pool``
|
||||
is configured per env, defaulting to elastic)."""
|
||||
group_sampling = self.sampling.model_dump()
|
||||
for env in self.source:
|
||||
if "sampling" not in env.model_fields_set:
|
||||
env.sampling = TrainSamplingConfig(**group_sampling)
|
||||
else:
|
||||
merged = group_sampling | env.sampling.model_dump(exclude_unset=True)
|
||||
env.sampling = TrainSamplingConfig(**merged)
|
||||
return self
|
||||
|
||||
class TrainConfig(SourceGroupConfig):
|
||||
source: list[TrainSourceConfig] = Field(default_factory=list)
|
||||
"""Training sources."""
|
||||
|
||||
sampling: TrainSamplingConfig = TrainSamplingConfig()
|
||||
"""Sampling that every training source inherits."""
|
||||
|
||||
select: vf.SelectConfig = vf.SelectConfig()
|
||||
"""Task selection that every training source inherits."""
|
||||
|
||||
group_size: int = Field(1, ge=1)
|
||||
"""Rollouts generated per example that every training source inherits unless it
|
||||
sets its own. ``batch_size`` must be divisible by every source's group size."""
|
||||
|
||||
algo: AlgoConfig = GRPOAlgoConfig()
|
||||
"""Training algorithm that every training source inherits. Defaults to ``grpo``."""
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_unique_env_names(self):
|
||||
@@ -390,46 +402,21 @@ class TrainConfig(BaseConfig):
|
||||
return self
|
||||
|
||||
|
||||
class EvalSourcesConfig(BaseConfig):
|
||||
"""Eval sources and the group-level defaults they inherit."""
|
||||
class EvalSourcesConfig(SourceGroupConfig):
|
||||
"""Eval sources and the defaults they inherit."""
|
||||
|
||||
source: list[EvalSourceConfig] = Field(default_factory=list)
|
||||
"""Evaluation sources."""
|
||||
|
||||
env: vf.SharedEnvConfig = vf.SharedEnvConfig()
|
||||
"""Env knobs that every eval source inherits: the fields every env and taskset
|
||||
has, such as ``retries`` and ``timeout``. A source's own ``env`` values win."""
|
||||
|
||||
sampling: EvalSamplingConfig = Field(default_factory=EvalSamplingConfig)
|
||||
"""Shared eval sampling configuration; can differ from training sampling."""
|
||||
"""Sampling that every eval source inherits; can differ from training sampling."""
|
||||
|
||||
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."""
|
||||
128 tasks of each taskset."""
|
||||
|
||||
group_size: int = Field(1, ge=1)
|
||||
"""Default rollouts per example. Can be overridden per env."""
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
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 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:
|
||||
source.sampling = EvalSamplingConfig(**group_sampling)
|
||||
else:
|
||||
merged = group_sampling | source.sampling.model_dump(exclude_unset=True)
|
||||
source.sampling = EvalSamplingConfig(**merged)
|
||||
if "group_size" not in source.model_fields_set:
|
||||
source.group_size = self.group_size
|
||||
return self
|
||||
"""Rollouts per example that every eval source inherits."""
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_non_empty_sources(self):
|
||||
@@ -458,7 +445,7 @@ class ScheduledEvalConfig(EvalSourcesConfig):
|
||||
"""Evaluation sources, each with its own step interval."""
|
||||
|
||||
interval: int = Field(100, ge=1)
|
||||
"""Step interval at which to evaluate the model."""
|
||||
"""Step interval that every eval source inherits."""
|
||||
|
||||
skip_first_step: bool = False
|
||||
"""If True, skip the startup eval that otherwise runs before any
|
||||
@@ -469,14 +456,6 @@ class ScheduledEvalConfig(EvalSourcesConfig):
|
||||
crash that left in-flight evals unfinished). By default, assumes a clean
|
||||
exit where all evals already completed."""
|
||||
|
||||
@model_validator(mode="after")
|
||||
def resolve_env_intervals(self):
|
||||
"""Per-env intervals inherit the group-level interval."""
|
||||
for source in self.source:
|
||||
if "interval" not in source.model_fields_set:
|
||||
source.interval = self.interval
|
||||
return self
|
||||
|
||||
@property
|
||||
def intervals(self) -> dict[str, int]:
|
||||
"""Step interval per eval env, by resolved name."""
|
||||
@@ -580,12 +559,6 @@ TRAIN_TOP_K_BOUND = 512
|
||||
|
||||
|
||||
class OrchestratorConfig(BaseConfig):
|
||||
algo: AlgoConfig = GRPOAlgoConfig()
|
||||
"""Training algorithm: sampling plus the per-token training signal (credit
|
||||
assignment and loss routing, fused — its ``type`` names the algorithm).
|
||||
Defaults to ``grpo``. Override per source via ``[[orchestrator.train.source]]``'s
|
||||
``algo``."""
|
||||
|
||||
model: ModelConfig = ModelConfig()
|
||||
"""The model being trained: its model fields plus the client of the live
|
||||
vLLM deployment (``[orchestrator.model] name = ...`` with
|
||||
@@ -649,9 +622,6 @@ class OrchestratorConfig(BaseConfig):
|
||||
concurrency: ConcurrencyConfig = ConcurrencyConfig()
|
||||
"""Adaptive in-flight concurrency control (``[orchestrator.concurrency]``)."""
|
||||
|
||||
group_size: int = Field(1, ge=1)
|
||||
"""Output sequences returned per example during training."""
|
||||
|
||||
seq_len: int = 2048
|
||||
"""Training sequence length. Shorter samples are padded; longer samples are truncated."""
|
||||
|
||||
@@ -688,20 +658,10 @@ class OrchestratorConfig(BaseConfig):
|
||||
self.monitors.prime.name = self.monitors.wandb.name
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
def inherit_env_algorithms(self):
|
||||
"""Envs without their own algorithm inherit the top-level one.
|
||||
Declared before any validator that reads ``algo``."""
|
||||
for env_cfg in self.train.source:
|
||||
if env_cfg.algo is None:
|
||||
env_cfg.algo = self.algo.model_copy(deep=True)
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_env_algorithms(self):
|
||||
"""Let each algorithm reject environments it cannot score correctly."""
|
||||
for env_cfg in self.train.source:
|
||||
assert env_cfg.algo is not None # resolved by inherit_env_algorithms
|
||||
env_cfg.algo.validate_env(env_cfg.env)
|
||||
return self
|
||||
|
||||
@@ -712,9 +672,9 @@ class OrchestratorConfig(BaseConfig):
|
||||
Owned here: every truncating config gets a top-k bound (bounds the sampling
|
||||
masks); opd/opsd is rejected (full-vocab prefill refs would mix
|
||||
normalizations). Frozen-source envs sample externally and are exempt."""
|
||||
policy_samplings = [
|
||||
env.sampling for env in self.train.source if env.algo is not None and env.algo.sampling.source == "policy"
|
||||
] or ([self.train.sampling] if not self.train.source else [])
|
||||
policy_samplings = [env.sampling for env in self.train.source if env.algo.sampling.source == "policy"] or (
|
||||
[self.train.sampling] if not self.train.source else []
|
||||
)
|
||||
truncating = [sampling for sampling in policy_samplings if sampling.truncates_distribution()]
|
||||
if not truncating:
|
||||
return self
|
||||
@@ -744,7 +704,7 @@ class OrchestratorConfig(BaseConfig):
|
||||
for sampling in unbounded:
|
||||
sampling.top_k = TRAIN_TOP_K_BOUND
|
||||
|
||||
algos = [env.algo for env in self.train.source if env.algo is not None] or [self.algo]
|
||||
algos = [env.algo for env in self.train.source] or [self.train.algo]
|
||||
if any(algo.type in ("opd", "opsd") for algo in algos):
|
||||
raise ValueError(
|
||||
"opd/opsd is not supported with truncated train sampling: reference logprobs are full-vocab "
|
||||
@@ -757,7 +717,7 @@ class OrchestratorConfig(BaseConfig):
|
||||
@property
|
||||
def any_policy_sourced(self) -> bool:
|
||||
"""True when at least one train env samples rollouts from the live policy."""
|
||||
return any(env.algo is not None and env.algo.sampling.source == "policy" for env in self.train.source)
|
||||
return any(env.algo.sampling.source == "policy" for env in self.train.source)
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_renderer_auto_resolves(self):
|
||||
@@ -804,18 +764,18 @@ class OrchestratorConfig(BaseConfig):
|
||||
if not has_rollout_batch and not has_token_batch:
|
||||
self.batch_size = 128
|
||||
|
||||
if self.batch_size is not None and self.batch_size % self.group_size != 0:
|
||||
raise ValueError("Batch size must be divisible by the number of samples per problem")
|
||||
group_sizes = [source.group_size for source in self.train.source] or [self.train.group_size]
|
||||
if self.batch_size is not None and any(self.batch_size % size for size in group_sizes):
|
||||
raise ValueError(
|
||||
f"Batch size {self.batch_size} must be divisible by every train source's group_size {sorted(set(group_sizes))}"
|
||||
)
|
||||
|
||||
for field in ("max_inflight", "initial_inflight"):
|
||||
value = getattr(self.concurrency, field)
|
||||
if value is not None and value < self.group_size:
|
||||
raise ValueError(f"concurrency.{field} must be at least the number of rollouts per example")
|
||||
|
||||
# Propagate the top-level ``group_size`` into each train env that didn't set its own.
|
||||
for env_cfg in self.train.source:
|
||||
if "group_size" not in env_cfg.model_fields_set:
|
||||
env_cfg.group_size = self.group_size
|
||||
if value is not None and value < max(group_sizes):
|
||||
raise ValueError(
|
||||
f"concurrency.{field} must be at least the largest train group_size ({max(group_sizes)})"
|
||||
)
|
||||
|
||||
return self
|
||||
|
||||
@@ -825,7 +785,6 @@ class OrchestratorConfig(BaseConfig):
|
||||
for env in self.train.source:
|
||||
# Policy-sourced rollouts hit our vLLM server; frozen-sourced
|
||||
# rollouts may hit external OAI endpoints that reject these knobs.
|
||||
assert env.algo is not None
|
||||
if env.algo.sampling.source == "policy":
|
||||
env.sampling.extra_body.setdefault("top_k", -1)
|
||||
env.sampling.extra_body.setdefault("min_p", 0.0)
|
||||
@@ -835,9 +794,7 @@ class OrchestratorConfig(BaseConfig):
|
||||
@model_validator(mode="after")
|
||||
def validate_policy_top_k_consistency(self):
|
||||
"""Require one top-k capture mode across the live policy server."""
|
||||
policy_sources = [
|
||||
env for env in self.train.source if env.algo is not None and env.algo.sampling.source == "policy"
|
||||
]
|
||||
policy_sources = [env for env in self.train.source if env.algo.sampling.source == "policy"]
|
||||
enabled = [env for env in policy_sources if env.sampling.top_k is not None]
|
||||
disabled = [env for env in policy_sources if env.sampling.top_k is None]
|
||||
if enabled and disabled:
|
||||
|
||||
@@ -618,9 +618,7 @@ class RLConfig(BaseConfig):
|
||||
on, vLLM rejects requests with ``temperature <= 0`` or without ``top_k > 0``,
|
||||
so eval sampling against the same server must set both."""
|
||||
policy_samplings = [
|
||||
env.sampling
|
||||
for env in self.orchestrator.train.source
|
||||
if env.algo is not None and env.algo.sampling.source == "policy"
|
||||
env.sampling for env in self.orchestrator.train.source if env.algo.sampling.source == "policy"
|
||||
] or ([self.orchestrator.train.sampling] if not self.orchestrator.train.source else [])
|
||||
if not any(sampling.truncates_distribution() for sampling in policy_samplings):
|
||||
return self
|
||||
|
||||
@@ -222,6 +222,11 @@ class HeartbeatConfig(BaseConfig):
|
||||
url: str
|
||||
"""URL to send the heartbeat to."""
|
||||
|
||||
min_interval: float = Field(30.0, gt=0)
|
||||
"""Minimum seconds between pings. Beats can arrive far more often (evals beat once
|
||||
per landed episode); surplus beats are dropped to stay under Better Stack's heartbeat
|
||||
rate limit. Size it well under the monitor's period."""
|
||||
|
||||
|
||||
class MetricsServerConfig(BaseConfig):
|
||||
port: int = Field(8000, ge=1, le=65535)
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ dependencies = [
|
||||
"rich>=14.0.0",
|
||||
"setproctitle>=1.3.0",
|
||||
"uvloop>=0.21.0",
|
||||
"verifiers[harbor]>=0.3.2.dev152",
|
||||
"verifiers[harbor]>=0.3.2.dev158",
|
||||
"renderers[multimodal]>=0.1.12.dev2",
|
||||
"pybase64>=1.4.2",
|
||||
"orjson>=3.10",
|
||||
@@ -270,8 +270,8 @@ torchao = [
|
||||
dion = { git = "https://github.com/samsja/dion.git", rev = "6f9242d" }
|
||||
flash-attn-4 = { git = "https://github.com/Dao-AILab/flash-attention.git", subdirectory = "flash_attn/cute", rev = "0251105" }
|
||||
vllm-router = [
|
||||
{ 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'" },
|
||||
{ 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'" },
|
||||
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl", marker = "platform_machine == 'x86_64'" },
|
||||
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_aarch64.whl", marker = "platform_machine == 'aarch64'" },
|
||||
]
|
||||
vllm = [
|
||||
{ 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'" },
|
||||
|
||||
@@ -63,19 +63,21 @@ env.agent.harness.id = "null"
|
||||
env.agent.runtime.type = "subprocess"
|
||||
```
|
||||
|
||||
Each source group (`[orchestrator.train]`, `[orchestrator.eval]`, the `sft` `[eval]` block, the top level of `eval`) holds defaults that its sources inherit: every field that the group and its sources both have (`env`, `sampling`, `select`, `group_size`, plus `algo` on train and `interval` on online eval). Blocks merge key by key, a source's own values win, and a block whose `type` differs is the source's alone.
|
||||
|
||||
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]`, `[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.
|
||||
**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.train.algo.type max_rl`) or a TOML overlay file.
|
||||
|
||||
**vLLM pass-through** — `[inference.vllm]` uses vLLM's own argument names (`model`, `tensor_parallel_size`, `data_parallel_size`, `max_model_len`, ...) and forwards *any* key to the vLLM server, typed by prime-rl or not: `[inference.vllm] max_num_seqs = 256`, or `--inference.vllm.max-num-seqs 256` on the CLI. CLI values are JSON-coerced, so dict-valued vLLM args work as `--inference.vllm.compilation-config '{"cudagraph_mode": "NONE"}'`. Non-vLLM knobs (router, deployment, weight broadcast, kv-cache offload, env vars) stay on `[inference]` itself.
|
||||
|
||||
**Discriminated unions** — set the `type` field to pick the variant (`[orchestrator.algo] type = "max_rl"`). Omit `type` to keep the default variant.
|
||||
**Discriminated unions** — set the `type` field to pick the variant (`[orchestrator.train.algo] type = "max_rl"`). Omit `type` to keep the default variant.
|
||||
|
||||
**RL loss** — `[trainer.loss]` defaults to IPO with `eps = 0.1`, `adv_tau = 1.0`, and `kl_tau = 1e-3`. Omit the section to use these defaults. Set `type = "icepop"` for ratio masking with `ratio_low = 0.2`, `ratio_high = 5.0`, and `adv_tau = 1.0`; IcePop has no separate KL term. Set `type = "custom"` with `import_path` and optional `kwargs` to load a custom RL loss. The `ce` and `ref_kl` components are fixed.
|
||||
|
||||
**Algorithms** — `[orchestrator.algo] type = "grpo" | "max_rl" | "rae" | "hierarchical_grpo" | "opd" | "opsd" | "sft" | "echo"` — the type names the algorithm (credit assignment + loss routing, fused), and each type's class defaults are its vetted setting; any other key you set is your own assembly (e.g. `[orchestrator.algo.roles.user] alpha = 0.1` for echo — setting any echo role replaces the whole role table). `hierarchical_grpo` is only valid with a proposer-solver env: it compares solvers with attempts on the same proposed problem and proposers with other proposals in the group. There is no preset layer, and no config hook that points at user code — a new algorithm is a named class in the repo (subclass `Algorithm`, register it). Per-source override: `[orchestrator.train.source.algo] type = "opd"` (the source assembles its own algorithm). prime-rl only hosts the trainable policy; frozen models are inline external endpoints on the algorithm, named where the model is used — `[orchestrator.algo.teacher]` for opd (the frozen model scored against), `[orchestrator.algo.sampling.source]` for sft (the model it samples from), each with `name` + `base_url`. There is no shared `teacher` slot. opsd declares no model — it self-distills against the live policy. See `docs/algorithms.md`.
|
||||
**Algorithms** — `[orchestrator.train.algo] type = "grpo" | "max_rl" | "rae" | "hierarchical_grpo" | "opd" | "opsd" | "sft" | "echo"` — the type names the algorithm (credit assignment + loss routing, fused), and each type's class defaults are its vetted setting; any other key you set is your own assembly (e.g. `[orchestrator.train.algo.roles.user] alpha = 0.1` for echo — setting any echo role replaces the whole role table). `hierarchical_grpo` is only valid with a proposer-solver env: it compares solvers with attempts on the same proposed problem and proposers with other proposals in the group. There is no preset layer, and no config hook that points at user code — a new algorithm is a named class in the repo (subclass `Algorithm`, register it). Each train source inherits the group algorithm: a source `algo` with a different `type` is its own algorithm (`[orchestrator.train.source.algo] type = "opd"`), and params without a `type` keep the group's algorithm with those params changed. prime-rl only hosts the trainable policy; frozen models are inline external endpoints on the algorithm, named where the model is used — `[orchestrator.train.algo.teacher]` for opd (the frozen model scored against), `[orchestrator.train.algo.sampling.source]` for sft (the model it samples from), each with `name` + `base_url`. There is no shared `teacher` slot. opsd declares no model — it self-distills against the live policy. See `docs/algorithms.md`.
|
||||
|
||||
**`BaseModel | None` fields** — bare flag enables defaults; nested override enables and sets:
|
||||
|
||||
|
||||
@@ -243,9 +243,7 @@ def rl_local(config: RLConfig):
|
||||
|
||||
frozen_endpoints: list[str] = []
|
||||
for env in config.orchestrator.train.source:
|
||||
algo = env.algo
|
||||
assert algo is not None, "TrainSourceConfig.algo must be resolved before launch (inherit_env_algorithms)"
|
||||
for ref in (algo.sampling.source, getattr(algo, "teacher", None)):
|
||||
for ref in (env.algo.sampling.source, getattr(env.algo, "teacher", None)):
|
||||
if isinstance(ref, FrozenModelConfig):
|
||||
frozen_endpoints.append(f"{ref.name} ({ref.base_url})")
|
||||
if frozen_endpoints:
|
||||
|
||||
@@ -84,7 +84,7 @@ class EvalRunner:
|
||||
# sit inside the ping stream as an abnormally long silence and flip a healthy
|
||||
# run stale. Until then the heartbeat has simply never been pinged.
|
||||
if config.heartbeat is not None:
|
||||
self.heart = Heartbeat(config.heartbeat.url)
|
||||
self.heart = Heartbeat(config.heartbeat)
|
||||
|
||||
# The launcher-set $PRL_RUN_ID is the run identity; standalone runs mint a local one.
|
||||
self.run_id = os.environ.get("PRL_RUN_ID") or uuid.uuid4().hex
|
||||
|
||||
@@ -178,7 +178,9 @@ class PrimeTrainMonitor(Monitor):
|
||||
training=pr.TrainingSpec(
|
||||
max_steps=config.max_steps or 0,
|
||||
batch_size=config.batch_size,
|
||||
rollouts_per_example=config.group_size,
|
||||
rollouts_per_example=max(
|
||||
(source.group_size for source in config.train.source), default=config.train.group_size
|
||||
),
|
||||
seq_len=config.seq_len,
|
||||
wandb_project=config.monitors.wandb.project if config.monitors.wandb else None,
|
||||
),
|
||||
|
||||
@@ -159,9 +159,7 @@ class TrainEnv(Env):
|
||||
self.sampling_args = generation_source.sampling_args(config.sampling.to_sampling_args())
|
||||
# Truncated policy sampling must ship the sampling masks the trainer replays.
|
||||
self.requires_sampling_masks = (
|
||||
config.sampling.truncates_distribution()
|
||||
and config.algo is not None
|
||||
and config.algo.sampling.source == "policy"
|
||||
config.sampling.truncates_distribution() and config.algo.sampling.source == "policy"
|
||||
)
|
||||
|
||||
|
||||
@@ -235,7 +233,6 @@ class TrainEnvs(Envs[TrainEnv]):
|
||||
):
|
||||
self._envs: dict[str, TrainEnv] = {}
|
||||
for config in configs:
|
||||
assert config.algo is not None, "TrainSourceConfig.algo must be resolved before env construction"
|
||||
get_logger().info(f"Initializing {config.algo.type} algorithm for {config.resolved_name}")
|
||||
env = TrainEnv(
|
||||
config,
|
||||
|
||||
@@ -224,7 +224,7 @@ class Orchestrator:
|
||||
set_base_sandbox_labels([self.run_name])
|
||||
|
||||
if config.heartbeat is not None:
|
||||
self.heart = Heartbeat(config.heartbeat.url)
|
||||
self.heart = Heartbeat(config.heartbeat)
|
||||
|
||||
config_dir = get_config_dir(config.output_dir)
|
||||
self.train_envs = TrainEnvs(
|
||||
|
||||
@@ -19,6 +19,7 @@ from torch.distributed.checkpoint.hf_storage import HuggingFaceStorageReader
|
||||
from torch.distributed.checkpoint.state_dict_loader import load as dcp_load
|
||||
from torch.distributed.device_mesh import DeviceMesh
|
||||
from torch.distributed.fsdp import CPUOffloadPolicy, FSDPModule, MixedPrecisionPolicy, OffloadPolicy, fully_shard
|
||||
from torch.distributed.tensor import Shard
|
||||
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, GenerationConfig, PretrainedConfig
|
||||
from transformers.tokenization_utils import PreTrainedTokenizer
|
||||
from transformers.utils.import_utils import is_flash_attn_3_available
|
||||
@@ -504,7 +505,16 @@ def setup_fsdp(model: nn.Module, config: ModelConfig, parallel_dims: ParallelDim
|
||||
mp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16, reduce_dtype=DTYPE_MAP[config.reduce_dtype])
|
||||
offload_policy: OffloadPolicy = CPUOffloadPolicy(pin_memory=True) if config.fsdp_cpu_offload else OffloadPolicy()
|
||||
|
||||
shard_placement_fn = get_fsdp_shard_placement_fn(model) if config.fusions.shard_fused_on_dim1 else None
|
||||
fused_shard_placement_fn = get_fsdp_shard_placement_fn(model) if config.fusions.shard_fused_on_dim1 else None
|
||||
hsdp_mesh = parallel_dims.get_mesh("hsdp")
|
||||
shard_size = parallel_dims.get_mesh("dp_shard_cp").size()
|
||||
|
||||
def shard_placement_fn(parameter: nn.Parameter) -> Shard | None:
|
||||
# Qwen's single-row shared-expert gates need equal shards for Muon's all-to-all.
|
||||
if parameter.ndim == 2 and parameter.shape[0] == 1 and parameter.shape[1] % shard_size == 0:
|
||||
return Shard(1)
|
||||
return fused_shard_placement_fn(parameter) if fused_shard_placement_fn is not None else None
|
||||
|
||||
fsdp_config = {
|
||||
"mp_policy": mp_policy,
|
||||
"offload_policy": offload_policy,
|
||||
@@ -512,8 +522,6 @@ def setup_fsdp(model: nn.Module, config: ModelConfig, parallel_dims: ParallelDim
|
||||
"shard_placement_fn": shard_placement_fn,
|
||||
}
|
||||
|
||||
hsdp_mesh = parallel_dims.get_mesh("hsdp")
|
||||
|
||||
dp_mod_ep_mesh: DeviceMesh | None = None
|
||||
if parallel_dims.ep_enabled:
|
||||
dp_mod_ep_mesh_dim_names = []
|
||||
|
||||
@@ -99,7 +99,7 @@ def train(config: TrainerConfig):
|
||||
heart = None
|
||||
if config.heartbeat is not None and world.is_master:
|
||||
logger.info("Initializing heartbeat")
|
||||
heart = Heartbeat(config.heartbeat.url)
|
||||
heart = Heartbeat(config.heartbeat)
|
||||
|
||||
# Setup metrics server (full on master, health-only on other nodes' local rank 0)
|
||||
metrics_server = None
|
||||
|
||||
@@ -93,7 +93,7 @@ def train(config: SFTConfig):
|
||||
heart = None
|
||||
if config.heartbeat is not None and world.rank == 0:
|
||||
logger.info("Initializing heartbeat")
|
||||
heart = Heartbeat(config.heartbeat.url)
|
||||
heart = Heartbeat(config.heartbeat)
|
||||
|
||||
# Set precision
|
||||
setup_torch_distributed(
|
||||
|
||||
@@ -1,53 +1,61 @@
|
||||
import threading
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
from prime_rl.configs.shared import HeartbeatConfig
|
||||
from prime_rl.utils.logger import get_logger
|
||||
|
||||
|
||||
class Heartbeat:
|
||||
"""Heartbeat monitor that sends heartbeats to Better Stack.
|
||||
|
||||
The beat() method sends a heartbeat every time it's called. Heartbeats are
|
||||
sent in a background thread to avoid blocking the training loop.
|
||||
The beat() method is called on every progress event (train batch, landed eval
|
||||
episode, ...), but a ping is only sent when the last one is at least
|
||||
``min_interval`` seconds old and none is in flight. Better Stack rate-limits
|
||||
frequent pings (HTTP 429), and a monitor only needs pings well within its
|
||||
period + grace, so surplus beats are dropped without an HTTP request.
|
||||
|
||||
Args:
|
||||
heartbeat_url: The unique URL provided by Better Stack for the heartbeat.
|
||||
config: The heartbeat config: the Better Stack URL to ping and the
|
||||
minimum seconds between pings.
|
||||
"""
|
||||
|
||||
def __init__(self, heartbeat_url: str):
|
||||
self.heartbeat_url = heartbeat_url
|
||||
def __init__(self, config: HeartbeatConfig):
|
||||
self.heartbeat_url = config.url
|
||||
self.min_interval = config.min_interval
|
||||
self._lock = threading.Lock()
|
||||
self._pending = False
|
||||
self._last_beat_at: float | None = None
|
||||
|
||||
def _send_heartbeat(self):
|
||||
"""Send heartbeat in background thread."""
|
||||
try:
|
||||
response = requests.get(self.heartbeat_url, timeout=1)
|
||||
if response.status_code == 200:
|
||||
with self._lock:
|
||||
self._pending = False
|
||||
else:
|
||||
if response.status_code != 200:
|
||||
get_logger().warning(f"BetterStack heartbeat failed with status code: {response.status_code}")
|
||||
with self._lock:
|
||||
self._pending = False
|
||||
except requests.RequestException as e:
|
||||
get_logger().warning(f"BetterStack heartbeat error: {e}")
|
||||
finally:
|
||||
with self._lock:
|
||||
self._pending = False
|
||||
|
||||
def beat(self):
|
||||
"""Send a heartbeat.
|
||||
|
||||
Returns immediately without blocking. Heartbeat is sent in background thread.
|
||||
Returns immediately without blocking. The HTTP request runs in a daemon
|
||||
thread, so even if the server is slow/unresponsive (up to the 1s timeout),
|
||||
training continues uninterrupted. The lock is held only briefly
|
||||
(microseconds) to check/set flags atomically.
|
||||
|
||||
Non-blocking guarantee: This method never blocks the training loop. The HTTP
|
||||
request runs in a daemon thread, so even if the server is slow/unresponsive
|
||||
(up to the 1s timeout), training continues uninterrupted. The lock is held only
|
||||
briefly (microseconds) to check/set flags atomically.
|
||||
Beats that arrive while a ping is in flight or within ``min_interval`` of
|
||||
the last one are dropped; the first beat after the interval sends the
|
||||
next ping.
|
||||
"""
|
||||
with self._lock:
|
||||
if not self._pending:
|
||||
self._pending = True
|
||||
thread = threading.Thread(target=self._send_heartbeat, daemon=True)
|
||||
thread.start()
|
||||
now = time.monotonic()
|
||||
if self._pending or (self._last_beat_at is not None and now - self._last_beat_at < self.min_interval):
|
||||
return
|
||||
self._pending = True
|
||||
self._last_beat_at = now
|
||||
threading.Thread(target=self._send_heartbeat, daemon=True).start()
|
||||
|
||||
+92
-23
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Literal
|
||||
from typing import Annotated, Literal, get_args
|
||||
|
||||
import pytest
|
||||
import tomli_w
|
||||
@@ -8,9 +8,15 @@ from pydantic import BaseModel, Field, ValidationError
|
||||
from pydantic_config import ConfigFileError
|
||||
|
||||
from prime_rl.configs.env_server import EnvServerConfig
|
||||
from prime_rl.configs.eval import EvalConfig
|
||||
from prime_rl.configs.eval import EvalConfig, SFTOnlineEvalConfig
|
||||
from prime_rl.configs.inference import InferenceConfig
|
||||
from prime_rl.configs.orchestrator import OrchestratorConfig
|
||||
from prime_rl.configs.orchestrator import (
|
||||
EvalSourcesConfig,
|
||||
OrchestratorConfig,
|
||||
RLOnlineEvalConfig,
|
||||
ScheduledEvalConfig,
|
||||
TrainConfig,
|
||||
)
|
||||
from prime_rl.configs.rl import RLConfig
|
||||
from prime_rl.configs.sft import SFTConfig
|
||||
from prime_rl.configs.trainer import ModelConfig as TrainerModelConfig
|
||||
@@ -392,44 +398,107 @@ def test_resolved_json_roundtrips_explicit_none(tmp_path):
|
||||
assert reloaded == config
|
||||
|
||||
|
||||
def test_env_algo_overrides_top_level():
|
||||
def test_env_algo_inherits_the_group_algo():
|
||||
config = OrchestratorConfig.model_validate(
|
||||
{
|
||||
"renderer": {"name": "qwen3"}, # echo needs the renderer's role attribution
|
||||
"algo": {"type": "echo"},
|
||||
"train": {
|
||||
"algo": {"type": "echo", "roles": {"user": {"alpha": 0.1}}},
|
||||
"source": [
|
||||
{"env": {"taskset": {"id": "reverse-text"}}, "algo": {"type": "grpo"}},
|
||||
{"env": {"taskset": {"id": "reverse-text"}}, "name": "b"},
|
||||
]
|
||||
{"env": {"taskset": {"id": "reverse-text"}}, "name": "c", "algo": {"roles": {"tool": {}}}},
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
env_a, env_b = config.train.source
|
||||
# Env a sets its own algorithm; only env b inherits the top-level echo algorithm.
|
||||
assert env_a.algo is not None and env_a.algo.type == "grpo"
|
||||
assert env_b.algo is not None and env_b.algo.type == "echo"
|
||||
env_a, env_b, env_c = config.train.source
|
||||
# A different type is the env's own algorithm; no type keeps the group's.
|
||||
assert env_a.algo.type == "grpo"
|
||||
assert env_b.algo.type == "echo" and env_b.algo.roles.user.alpha == 0.1
|
||||
assert env_c.algo.type == "echo" and env_c.algo.roles.user.alpha == 0.1 and env_c.algo.roles.tool is not None
|
||||
|
||||
# Resolved configs round-trip.
|
||||
dumped = config.model_dump(exclude_none=True)
|
||||
reloaded = OrchestratorConfig.model_validate(dumped)
|
||||
assert reloaded.train.source[0].algo is not None and reloaded.train.source[0].algo.type == "grpo"
|
||||
assert [env.algo.type for env in reloaded.train.source] == ["grpo", "echo", "echo"]
|
||||
|
||||
with pytest.raises(ValidationError, match="env"):
|
||||
OrchestratorConfig.model_validate(
|
||||
|
||||
def test_sources_inherit_the_group_fields_they_leave_unset():
|
||||
config = EvalConfig.model_validate(
|
||||
{
|
||||
"r": 4,
|
||||
"sampling": {"temperature": 0.5, "extra_body": {"a": 1}},
|
||||
"select": {"limit": 8, "include": {"idx": [":100"]}},
|
||||
"env": {"retries": {"max_retries": 3}},
|
||||
"source": [
|
||||
{"env": {"taskset": {"id": "gsm8k"}}},
|
||||
{
|
||||
"name": "b",
|
||||
"env": {"taskset": {"id": "gsm8k"}},
|
||||
"group_size": 2,
|
||||
"sampling": {"extra_body": {"b": 2}},
|
||||
"select": {"include": {"names": ["x"]}},
|
||||
},
|
||||
],
|
||||
}
|
||||
)
|
||||
a, b = config.source
|
||||
assert (a.group_size, b.group_size) == (4, 2)
|
||||
assert b.sampling.temperature == 0.5 and b.sampling.extra_body == {"a": 1, "b": 2}
|
||||
assert b.select.limit == 8 and b.select.include.idx == [":100"] and b.select.include.names == ["x"]
|
||||
assert a.env.retries.max_retries == 3 and b.env.retries.max_retries == 3
|
||||
reloaded = EvalConfig.model_validate(config.model_dump(mode="json"))
|
||||
assert reloaded.source[1].model_dump() == b.model_dump()
|
||||
|
||||
online = RLOnlineEvalConfig.model_validate(
|
||||
{
|
||||
"interval": 5,
|
||||
"source": [
|
||||
{"env": {"taskset": {"id": "gsm8k"}}},
|
||||
{"name": "b", "env": {"taskset": {"id": "gsm8k"}}, "interval": 2},
|
||||
],
|
||||
}
|
||||
)
|
||||
assert online.intervals == {"gsm8k": 5, "b": 2}
|
||||
|
||||
|
||||
def test_train_sources_can_use_their_own_group_sizes():
|
||||
def orchestrator(batch_size: int, **concurrency) -> OrchestratorConfig:
|
||||
return OrchestratorConfig.model_validate(
|
||||
{
|
||||
"renderer": {"name": "qwen3"},
|
||||
"train": {"env": [{"env": {"taskset": {"id": "removed"}}}]},
|
||||
"batch_size": batch_size,
|
||||
"concurrency": concurrency,
|
||||
"train": {
|
||||
"group_size": 16,
|
||||
"source": [
|
||||
{"env": {"taskset": {"id": "reverse-text"}}},
|
||||
{"env": {"taskset": {"id": "reverse-text"}}, "name": "b", "group_size": 8},
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
with pytest.raises(ValidationError, match="env"):
|
||||
OrchestratorConfig.model_validate(
|
||||
{
|
||||
"renderer": {"name": "qwen3"},
|
||||
"eval": {"env": [{"env": {"taskset": {"id": "removed"}}}]},
|
||||
}
|
||||
)
|
||||
assert [source.group_size for source in orchestrator(64).train.source] == [16, 8]
|
||||
with pytest.raises(ValidationError, match="divisible by every train source"):
|
||||
orchestrator(40)
|
||||
with pytest.raises(ValidationError, match="largest train group_size"):
|
||||
orchestrator(64, max_inflight=8)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"group", [TrainConfig, EvalSourcesConfig, ScheduledEvalConfig, EvalConfig, SFTOnlineEvalConfig]
|
||||
)
|
||||
def test_group_defaults_match_source_defaults(group):
|
||||
# An unset group field is not layered, so its default must be the source's.
|
||||
def default(field):
|
||||
value = field.get_default(call_default_factory=True)
|
||||
return value.model_dump() if isinstance(value, BaseModel) else value
|
||||
|
||||
(source,) = get_args(group.model_fields["source"].annotation)
|
||||
for name, field in group.model_fields.items():
|
||||
if name not in ("source", "env") and name in source.model_fields:
|
||||
assert default(field) == default(source.model_fields[name]), f"{group.__name__}.{name}"
|
||||
|
||||
|
||||
def test_policy_sources_accept_different_top_p_values():
|
||||
@@ -831,7 +900,7 @@ def test_run_dir_propagates_through_cli(tmp_path):
|
||||
"model": {"name": "Qwen/Qwen3-0.6B"},
|
||||
"monitors": {"wandb": {}},
|
||||
"trainer": {},
|
||||
"orchestrator": {"batch_size": 16, "group_size": 1},
|
||||
"orchestrator": {"batch_size": 16, "train": {"group_size": 1}},
|
||||
"inference": {},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -4975,8 +4975,8 @@ all = [
|
||||
{ name = "torchvision", marker = "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'" },
|
||||
{ name = "vllm-router", version = "0.2.2", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "vllm-router", version = "0.2.2", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
]
|
||||
dashboard = [
|
||||
{ name = "fastapi" },
|
||||
@@ -4989,8 +4989,8 @@ disagg = [
|
||||
{ name = "deep-gemm", version = "2.5.0+891d57b", source = { url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.1/deep_gemm-2.5.0+891d57b-cp312-cp312-linux_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "nixl", marker = "sys_platform == 'linux'" },
|
||||
{ name = "nixl-cu13", marker = "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'" },
|
||||
{ name = "vllm-router", version = "0.2.2", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_aarch64.whl" }, marker = "platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "vllm-router", version = "0.2.2", source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl" }, marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
]
|
||||
dynamo = [
|
||||
{ name = "ai-dynamo", marker = "sys_platform == 'linux'" },
|
||||
@@ -5123,9 +5123,9 @@ requires-dist = [
|
||||
{ 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 sys_platform == 'linux' and extra == 'disagg'", url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-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" },
|
||||
{ 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.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl" },
|
||||
{ name = "wandb", specifier = ">=0.26.1" },
|
||||
{ name = "wandb-workspaces", specifier = ">=0.4.3" },
|
||||
]
|
||||
@@ -5163,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.dev152" },
|
||||
{ name = "verifiers", specifier = ">=0.3.2.dev158" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -8157,8 +8157,8 @@ provides-extras = ["zen", "bench", "tensorizer", "fastsafetensors", "instanttens
|
||||
|
||||
[[package]]
|
||||
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" }
|
||||
version = "0.2.2"
|
||||
source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_aarch64.whl" }
|
||||
resolution-markers = [
|
||||
"platform_machine == 'aarch64' and sys_platform == 'linux'",
|
||||
]
|
||||
@@ -8171,7 +8171,7 @@ dependencies = [
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.1/vllm_router-0.2.1-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:0420aba42df1c970a78e1c4d4062eb00498e397f2dd506bade39eb915bf807b6" },
|
||||
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4e12c3e9e8123556b261b2ed79998ad256698b7e64da5afe4fe69e733e49b2d3" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
@@ -8190,8 +8190,8 @@ provides-extras = ["dev"]
|
||||
|
||||
[[package]]
|
||||
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" }
|
||||
version = "0.2.2"
|
||||
source = { url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl" }
|
||||
resolution-markers = [
|
||||
"platform_machine == 'x86_64' and sys_platform == 'linux'",
|
||||
]
|
||||
@@ -8204,7 +8204,7 @@ dependencies = [
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
wheels = [
|
||||
{ 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", hash = "sha256:046591cac21424997600d30b500bbaa3c450601e8b2b4fad6db9d142d1c36a0e" },
|
||||
{ url = "https://github.com/PrimeIntellect-ai/router/releases/download/v0.2.2/vllm_router-0.2.2-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2132bda10632efc5a726c69c7e3e7a18ea70731c5ca1ec2528227aa0fb634eb8" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
|
||||
Reference in New Issue
Block a user