Skip to content

v0.11.1.dev67

@hallerite hallerite tagged this 27 Nov 02:29
Stacked on #4800 (ModelExpress with Dynamo). Includes
PrimeIntellect-ai/renderers#226 (merged): the renderers submodule points
at its merge commit.

## Summary

RL rollouts through Dynamo failed on main for both weight transports.
With this PR, prime-rl runs end to end through Dynamo 1.7.0: generation
goes through the Dynamo frontend, and weight updates through NCCL or
ModelExpress.

**Dynamo 1.4.2 → 1.7.0, in the same environment as vLLM 0.34 and
ModelExpress 0.8.0.**
- 1.7.0 ships the RL listener, which reports `admin_base_url` and
`world_size` in discovery, and the Rust vLLM sidecar.
- It requires `aisim`, a simulator only Dynamo's planner, replay and
mocker use. A plain relock pulls JAX, Flax, Orbax and TensorStore into
the lock and downgrades `tyro` workspace-wide via `google-vizier[jax]`.
A `[[tool.uv.dependency-metadata]]` override drops it, the same pattern
the repo already uses. `dynamo.frontend` and `dynamo.vllm.sidecar`
import with `aisim` blocked.
- The ai-dynamo-runtime 1.4.2 override is gone; 1.7.0 carries the same
pydantic bound.
- `ai-dynamo` and `ai-dynamo-runtime` are exempt from the 7-day
cooldown, since 1.7.0 was published on 2026-11-24.

**`prl_replay` only for truncated sampling.** Every policy request
carried `sampling_params.extra_args: {"prl_replay": false}`, and the
Dynamo sidecar rejects any `extra_args`. prime-rl's own server treats a
missing flag as false, so its behavior is unchanged. Truncated sampling
(`top_p` < 1, `top_k`) still needs prime-rl's engine extension and still
fails on Dynamo.

**`usage` when the engine reports none** (renderers#226). Dynamo's
`/inference/v1/generate` has no `usage` field, and verifiers requires
one. The renderers client now fills exact prompt and completion counts
from the token ids.

**Config check for what Dynamo can't serve.** Policy train sources with
truncated sampling (sampling replay) or a logprob head (compact
logprobs, also requested by score centering) send `extra_args` the
Dynamo sidecar rejects. Every rollout used to fail and the run spun on
failed episodes until a timeout. Validation now rejects both with
Dynamo: in the orchestrator config, and again in the rl config after
score centering sets its logprob head. The README documents the
constraint.

**Example:** the launch commands in `examples/extra/dynamo/README.md`
now use the frontend, the Rust vLLM engine and the RL sidecar, with file
discovery (no etcd or NATS).

## Validation

**Unit tests:** `tests/unit/test_configs.py`,
`tests/unit/inference/test_dynamo.py`, `tests/unit/orchestrator` and
`tests/unit/transports`: 662 passed. The config check adds 5 tests
(truncation by `top_p` and `top_k`, a logprob head, score centering at
launch, and plain or non-Dynamo sampling still accepted);
`test_configs.py` and `test_config_update.py`: 430 passed, including
validation of every shipped config. Changes:
- new `test_only_truncated_policy_sources_request_replay`;
- the frozen-change test now uses `top_p = 1.5`, because its old edit
only failed validation through the stale `prl_replay: false`.

**End to end** with every rollout through the Dynamo frontend,
Qwen3-0.6B, `examples/extra/dynamo/rl.toml` (5 steps, batch 32, group
size 8):

| | NCCL | ModelExpress |
|---|---|---|
| Workers | 1 | 2 |
| Steps | 5/5 | 5/5 |
| Failed model calls | 0 | 0 |
| Mismatch KL | 0.0002–0.0007 | 0.0002–0.0006 |
| Installs | v0–v5 applied | v0–v5 on both workers (v0 30 s, then about
5 s) |
| Weights | changed after every update | both workers end on the same
fingerprint |
| Rollouts | — | split evenly over the two workers |

**Not covered:**
- multi-host Dynamo, TP or DP > 1 per worker, and P/D through Dynamo;
- truncated sampling, score centering and logprob-head requests through
Dynamo: they need `extra_args` the sidecar rejects, and config
validation now rejects them up front;
- Dynamo emits no per-token weight versions, so staleness falls back to
each rollout's dispatch version.

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Dependency and launch-path changes for external Dynamo inference plus
new config gates that change which sampling modes work with Dynamo;
behavior is clearer but misconfiguration now fails at validate time
rather than at runtime.
> 
> **Overview**
> **Enables end-to-end RL through Dynamo 1.7** by bumping `ai-dynamo` to
**1.7.0**, refreshing the lock/metadata (including blocking `aisim` from
the JAX closure via `dependency-metadata` and cooldown exemptions), and
rewriting **`examples/extra/dynamo/README.md`** for the three-process
layout: frontend with `/inference/v1/generate`, `vllm-rs` engine with
Prime-RL weight extensions, and the RL sidecar with file-based
discovery.
> 
> **Dynamo-compatible sampling.** Because the Dynamo sidecar rejects
`extra_args`, `resolve_sampling_replay` now sets `prl_replay` **only
when** policy sampling is truncated (`top_p`/`top_k`), instead of on
every policy request. **Orchestrator and RL validators** fail fast at
config time when Dynamo is enabled but sampling needs replay or a
logprob head (including after score centering auto-sets `logprobs`). The
example README documents “plain sampling” and token staleness behavior.
> 
> **Tests** cover replay injection, Dynamo rejection cases, and a frozen
live-update case that now surfaces validation errors for invalid
`top_p`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c615929dfbe6d15910cd888b97f0666cd1cf847a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Assets 2
Loading