> This page is for version v1.7.0.
> For other versions, use one of these documentation indexes:
> - Latest (v1.6.2) (default): https://docs.nvidia.com/dynamo/latest/llms.txt
> - dev: https://docs.nvidia.com/dynamo/dev/llms.txt
> - v1.6.2: https://docs.nvidia.com/dynamo/v1.6.2/llms.txt
> - v1.7.0: https://docs.nvidia.com/dynamo/v1.7.0/llms.txt
> - v1.6.1: https://docs.nvidia.com/dynamo/v1.6.1/llms.txt
> - v1.6.0: https://docs.nvidia.com/dynamo/v1.6.0/llms.txt
> - v1.5.1: https://docs.nvidia.com/dynamo/v1.5.1/llms.txt
> - v1.5.0: https://docs.nvidia.com/dynamo/v1.5.0/llms.txt
> - v1.4.2: https://docs.nvidia.com/dynamo/v1.4.2/llms.txt
> - v1.4.1: https://docs.nvidia.com/dynamo/v1.4.1/llms.txt
> - v1.4.0: https://docs.nvidia.com/dynamo/v1.4.0/llms.txt
> - v1.3.0: https://docs.nvidia.com/dynamo/v1.3.0/llms.txt
> - v1.2.1: https://docs.nvidia.com/dynamo/v1.2.1/llms.txt
> - v1.2.0: https://docs.nvidia.com/dynamo/v1.2.0/llms.txt
> - v1.1.1: https://docs.nvidia.com/dynamo/v1.1.1/llms.txt
> - v1.1.0: https://docs.nvidia.com/dynamo/v1.1.0/llms.txt
> - v1.0.2: https://docs.nvidia.com/dynamo/v1.0.2/llms.txt
> - v1.0.1: https://docs.nvidia.com/dynamo/v1.0.1/llms.txt
> - v1.0.0: https://docs.nvidia.com/dynamo/v1.0.0/llms.txt
> - v0.9.1: https://docs.nvidia.com/dynamo/v-0-9-1/llms.txt
> - v0.9.0: https://docs.nvidia.com/dynamo/v-0-9-0/llms.txt
> - v0.8.1: https://docs.nvidia.com/dynamo/v-0-8-1/llms.txt
> - v0.8.0: https://docs.nvidia.com/dynamo/v-0-8-0/llms.txt
> - v0.7.1: https://docs.nvidia.com/dynamo/v-0-7-1/llms.txt
> - v0.7.0: https://docs.nvidia.com/dynamo/v-0-7-0/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.nvidia.com/dynamo/llms.txt. For full content including API reference and SDK examples, see https://docs.nvidia.com/dynamo/llms-full.txt.

# verl Integration

**Experimental.** verl-recipe provides an asynchronous Dynamo rollout backend with a shared frontend, vLLM workers, routing, and colocated policy updates. Use the upstream recipe as the implementation source of truth; this page covers the shortest Dynamo workflow and its support boundary.

<Warning>
The pinned snapshot and the install and launch commands below are a historical reference for `ai-dynamo[vllm]==1.4.*` with vLLM `0.26.0`.
They are not a supported setup for Dynamo 1.7.0. See [Prepare the Source](#prepare-the-source) for the known blockers and the reported run with local patches.
</Warning>

## Integration Shape

| Concern | Current path |
|---|---|
| Training and rollout orchestration | verl and verl-recipe |
| Generation | Dynamo vLLM workers behind one shared frontend |
| Routing | Native Dynamo router when ThunderAgent is disabled; ThunderAgent when explicitly enabled |
| Policy update | Recipe-owned Ray/ZMQ control with colocated CUDA IPC |
| Service discovery | Recipe-managed etcd and NATS |
| Deployment | Local or multi-node Ray processes; Kubernetes is not required |

The native router and ThunderAgent are different scheduling paths. Choose one before building the environment and do not compare their results as if only a router flag changed.

## Prerequisites

- A Linux GPU environment that satisfies the selected verl, Dynamo, vLLM, CUDA, and PyTorch versions
- `git`, Python, `etcd`, and `nats-server`
- `flash-attn`, installed explicitly as its own step under Prepare the Source. The selected verl core reaches `flash_attn.bert_padding` through `verl/utils/attention_utils.py` on the CUDA path with no fallback, but declares the dependency in neither `requirements.txt` nor `pyproject.toml`, and the installer does not add it. Without it the training iteration stops at `ModuleNotFoundError: No module named 'flash_attn'`
- Model and dataset paths visible on every participating node
- Enough GPUs for the trainer and rollout layout; the validation smoke is not a full training run

## Prepare the Source

`ai-dynamo[vllm]==1.7.0` pins vLLM `0.33.0`. Its upstream [CUDA requirements](https://github.com/vllm-project/vllm/blob/v0.33.0/requirements/cuda.txt) pin PyTorch `2.14.0`, and its [common requirements](https://github.com/vllm-project/vllm/blob/v0.33.0/requirements/common.txt) require Transformers `>=5.16.1,<5.21.0`. These are package requirements, not a claim that every allowed version was tested with verl.

The reviewed recipe snapshot is `461b830c`, and its `REQUIRED_VERL.txt` selects the matching core verl commit. The core commit records an older recipe submodule, so use the installer and then set the nested recipe checkout to the same reviewed snapshot:

```bash
git clone https://github.com/verl-project/verl-recipe.git
git -C verl-recipe checkout 461b830cfee4f5a67c21edc300c24373230babc7

cd verl-recipe
./install_verl.sh --recipe dynamo --method git --dest ../verl

git -C ../verl/recipe fetch origin 461b830cfee4f5a67c21edc300c24373230babc7
git -C ../verl/recipe checkout 461b830cfee4f5a67c21edc300c24373230babc7
test -f ../verl/recipe/dynamo/main_dynamo.py
```

The recipe does not pin a complete Dynamo/vLLM image for the native-router path. Build one clean environment, record its immutable image and package versions, and keep the Dynamo and nested recipe checkouts clean during validation.

<Info>
The following blockers apply to the referenced snapshots:

- **Model import:** Build the historical environment on vLLM `0.26.0`, which is what `ai-dynamo[vllm]==1.4.*` pins. The verl core selected by recipe `461b830c` imports `FusedMoE` from `vllm.model_executor.layers.fused_moe.layer` in `verl/utils/vllm/vllm_fp8_utils.py`. vLLM renamed it to `FusedMoEFactory` in `0.27.0`, so the import fails on later versions, including `0.33.0`. On Dynamo 1.5.0 / vLLM `0.28.0`, loading this backend raises `ImportError: FP8 quantization not available` before the Dynamo stack starts.
- **Tied embeddings:** Starting with vLLM `0.29.0`, `load_weights` checks tied aliases within each call. The selected verl core loads each CUDA IPC bucket separately. Qwen2.5 fails its first policy update when `lm_head.weight` and `model.embed_tokens.weight` arrive in separate buckets: the loader reports that the tied weight is uninitialized. Both tensors exceed the default 64 MiB bucket size, so each is sent alone. verl drops the redundant alias starting with [verl-project/verl#7973](https://github.com/verl-project/verl/pull/7973), and in the FP8 path with [verl-project/verl#8064](https://github.com/verl-project/verl/pull/8064). Recipe `461b830c` and recipe `98de2b9b` (which selects verl `6cbca9ce`) predate these fixes. Raising the bucket size is not a supported fix.
- **Pausing for policy updates:** vLLM `0.32.0` removed `wait_for_inflight_requests` from `AsyncLLM.pause_generation`, which now accepts `mode` and `clear_cache`. [Recipe `98de2b9b`](https://github.com/verl-project/verl-recipe/blob/98de2b9b/dynamo/dynamo_async_server.py) and the verl core it selects (`6cbca9ce`) still pass the removed argument, causing `TypeError: AsyncLLM.pause_generation() got an unexpected keyword argument 'wait_for_inflight_requests'`. [verl `3255f6b1`](https://github.com/verl-project/verl/blob/3255f6b1/verl/workers/rollout/vllm_rollout/vllm_async_server.py) already uses `mode="abort"` on vLLM `0.32.0` or later; the recipe's own caller still needs that change.
- **Worker discovery at startup:** Recipe `98de2b9b` counts workers from `/health` without requesting instance details. On Dynamo 1.7.0, it must use `/health?instances=true`; otherwise it sees no workers and waits until the startup timeout. See the [health endpoint contract](/dynamo/v1.7.0/reference/observability/health-checks).

A Dynamo 1.7.0 setup needs a verl core with the pause and tied-alias fixes, plus a recipe with both its pause call and health query updated.
</Info>

A locally patched Dynamo 1.7.0 RC5 run has been reported with Qwen3.5-35B-A3B on 16 B200 GPUs for eight training steps, using verl `6cbca9ce` and recipe `242c73fc` with patches to the health query, pause call, and Bridge. This is evidence for that patched setup; the unpatched commits are not supported pins, and the run does not establish the full recovery checks below.

Check this page and the [release history](/dynamo/reference/releases) for future validated Dynamo 1.7.x guidance. This page does not provide a supported 1.7.0 pair.

### Install flash-attn

`install_verl.sh` does not install `flash-attn`, so add it to the same environment before running anything below:

```bash
pip install packaging psutil ninja
MAX_JOBS=4 pip install flash-attn --no-build-isolation
```

Run this after PyTorch is installed. `--no-build-isolation` is what lets the build compile against the PyTorch already in the environment; upstream requires PyTorch `2.2` or newer and CUDA `12.0` or newer. Confirm `ninja --version` exits `0` first — a broken `ninja` leaves the build single-threaded and it can then take hours instead of minutes. Lower `MAX_JOBS` if the machine runs out of RAM during the build. See the [FlashAttention project](https://github.com/Dao-AILab/flash-attention) for platform notes and prebuilt wheels.

The selected verl also lists `flash-attn` in the `gpu` extra of its `setup.py` (`GPU_REQUIRES`), so `pip install -e '.[gpu]'` from the verl checkout is an equivalent route that additionally installs `liger-kernel`. Neither installer path the recipe uses requests that extra.

## Run the Validation Smoke

Run the upstream validation-only smoke from the resulting verl checkout:

```bash
cd ../verl

MODEL_PATH=/models/Qwen2.5-0.5B-Instruct \
TRAIN_FILE=/data/dapo-math-17k.parquet \
TEST_FILE=/data/aime-2024.parquet \
RAY_DATA_HOME=/data/verl \
bash recipe/dynamo/smoke_dynamo_v1.sh \
  actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=1 \
  actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=1 \
  actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=1
```

The three overrides are required because the selected verl leaves `use_dynamic_bsz` at `false` and defaults every micro-batch field to `null`, and neither the smoke script nor the recipe's trainer configuration sets one, so the trainer rejects the run during config validation. The smoke script forwards any extra arguments to the trainer, so pass them on the command line instead of editing the upstream script. Use the `_per_gpu` form: upstream marks the global form deprecated.

The smoke starts recipe-managed etcd, NATS, a Dynamo vLLM worker, and the shared frontend. `PASS: Dynamo validation smoke completed` confirms the validation command completed; it does not prove an optimizer step or policy refresh.

## Run a Training Iteration

After the smoke passes, run at least one optimizer step with the same environment. Use the pinned upstream [Dynamo trainer configuration](https://github.com/verl-project/verl-recipe/blob/461b830cfee4f5a67c21edc300c24373230babc7/dynamo/config/dynamo_trainer.yaml) as the baseline, then make the model, data, resource, and routing overrides required for your environment. This example selects the native Dynamo router explicitly:

```bash
export VERL_USE_EXTERNAL_MODULES=recipe.dynamo.register
export VERL_DYNAMO_WORKER_METRICS_DIR=/tmp/verl-dynamo/workers
mkdir -p "$VERL_DYNAMO_WORKER_METRICS_DIR"

python3 recipe/dynamo/metrics_sidecar.py \
  --endpoints-glob "$VERL_DYNAMO_WORKER_METRICS_DIR/*.endpoints" \
  --output /tmp/verl-dynamo/kv-metrics.jsonl \
  --label dynamo-kv \
  --interval 30 &
METRICS_SIDECAR_PID=$!
trap 'kill "$METRICS_SIDECAR_PID" 2>/dev/null || true' EXIT

python3 -m recipe.dynamo.main_dynamo \
  algorithm.adv_estimator=grpo \
  data.train_files=/data/gsm8k/train.parquet \
  data.val_files=/data/gsm8k/test.parquet \
  actor_rollout_ref.model.path=Qwen/Qwen2.5-0.5B-Instruct \
  actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=1 \
  actor_rollout_ref.rollout.name=dynamo \
  actor_rollout_ref.rollout.mode=async \
  actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
  actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=1 \
  actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=1 \
  actor_rollout_ref.rollout.engine_kwargs.dynamo.router_mode=kv \
  ++actor_rollout_ref.rollout.engine_kwargs.dynamo.thunderagent.enabled=false \
  ++actor_rollout_ref.rollout.engine_kwargs.dynamo.enable_worker_system_metrics=true \
  trainer.n_gpus_per_node=2 \
  trainer.nnodes=1 \
  trainer.total_training_steps=2
```

The three micro-batch overrides are required here for the same reason they are required in the smoke. `actor_rollout_ref.rollout.tensor_model_parallel_size=2` states the selected verl's own default rather than changing it: this example runs one rollout that is tensor-parallel across both requested GPUs. Set it to `1` for two independent rollout workers instead.

Adjust model, data, and resource values for your environment. A passing run must include rollout generation, reward or advantage computation, an actor update, policy synchronization, and generation after the update.

## Verify the Run

Check three boundaries before scaling:

1. **Generation correctness:** The completion token IDs and selected log probabilities consumed by verl match in length and order. Record terminal and canceled attempts separately.
2. **Policy update:** Every intended rollout shard receives the same trainer step through the recipe's CUDA IPC path, stale KV state is handled, and post-update generation succeeds.
3. **Routing:** With ThunderAgent disabled, compare `round-robin` and `kv` using the same prompts, concurrency, cache state, and update cadence. Report useful framework output, not only request throughput.

Set `request_completion_token_ids=true` when the framework must score the exact engine tokens. Use [RL Integration Reference](/dynamo/v1.7.0/reinforcement-learning/rl-integration-reference#preserve-token-authority) for the shared response checks and [KV-Aware Load Balancing for RL Rollouts](/dynamo/v1.7.0/reinforcement-learning/kv-aware-load-balancing) for the routing experiment.

## Observe and Recover

The training command above enables worker system metrics and starts the provided sidecar before workers come online. The sidecar rediscovers endpoint files throughout the run and writes per-worker snapshots to `/tmp/verl-dynamo/kv-metrics.jsonl`; starting it only after training leaves no live workers to scrape.

| Symptom | Check first |
|---|---|
| Frontend never becomes ready | etcd/NATS health, worker logs, port reachability, and expected registration count |
| Trainer token scores differ | Completion token IDs, logprob alignment, tokenizer/model version, and response adaptation |
| One shard remains stale | Ray actor, ZMQ bridge, CUDA rank mapping, and per-shard update acknowledgements |
| Cache reuse drops after update | Cache reset, worker wake-up, and the warm-up boundary |
| Shutdown leaves processes | Recipe watchdog and frontend, worker, NATS, then etcd teardown |

See [Profile and Simulate RL Rollouts](/dynamo/v1.7.0/reinforcement-learning/rl-profiling-and-simulation) for request tracing and [Distribute and Update Rollout Weights](/dynamo/v1.7.0/reinforcement-learning/rollout-weight-updates#verl-colocated-update) for the policy-update boundary.

## Current Limitations

- The recipe does not provide one complete native-path Dynamo/vLLM image pin.
- The documented policy update is the recipe's colocated CUDA IPC path, not public Dynamo worker discovery or ModelExpress.
- Policy updates for tied-embedding models on vLLM `0.29.0` or later need the tied-alias fixes described under [Prepare the Source](#prepare-the-source).
- No supported Dynamo 1.7.0 / vLLM `0.33.0` pair is provided here; see [Prepare the Source](#prepare-the-source) for the snapshot blockers and the reported run with local patches.
- Multi-node and large-model layouts require separate topology and failure validation.
- Supported status requires an independent run with token correctness, policy refresh, post-update generation, and request, worker, and update recovery.

## Upstream Resources

- [Dynamo rollout backend](https://github.com/verl-project/verl-recipe/tree/461b830cfee4f5a67c21edc300c24373230babc7/dynamo)
- [Dynamo trainer configuration](https://github.com/verl-project/verl-recipe/blob/461b830cfee4f5a67c21edc300c24373230babc7/dynamo/config/dynamo_trainer.yaml)
- [Required verl version](https://github.com/verl-project/verl-recipe/blob/461b830cfee4f5a67c21edc300c24373230babc7/dynamo/REQUIRED_VERL.txt)
- [Validation smoke](https://github.com/verl-project/verl-recipe/blob/461b830cfee4f5a67c21edc300c24373230babc7/dynamo/smoke_dynamo_v1.sh)