How a NeMo RL rollout reaches vLLM through Dynamo, before and after this PR
NVIDIA-NeMo/RL #4905
(stacked on #4978, under
#4979).
Permalinks pin head 44671d3b; removed code is linked at the base 1fe249f6.
Nine pages on this stack (#4905, #4979 and #5115), one question each. This one: the old Dynamo backend vs the new one.
Before
backend: dynamo started Dynamo's own vLLM (python -m dynamo.vllm) in a separate venv, one process per GPU group, and refit its weights over HTTP.
This PR
backend: vllm + dynamo: true. NeMo RL's own vLLM workers register with the Dynamo frontend and serve each rollout with the same method the native path uses.
Status
In review, not merged. CI is green on the functional and unit lanes. The review found no correctness bug; its asks are about test coverage and small guards (bottom of the page).
Background.Dynamo
puts one HTTP frontend in front of all generation engines. Its KV router
sends each request to the engine that already has most of the prompt cached. A
rollout
here is one prompt in, and generated token ids plus their log-probs out. Below, [t0 … tP-1] means the prompt's P token ids, and G is the number of generated tokens. Dotted words have a short explanation: hover or tap them.
Before, the driver's DynamoGeneration
set the sampling settings in the HTTP request, and a separate dynamo.vllm process did the work.
After, VllmGeneration._generate_through_dynamo
sends only the prompt and a tag. The tag tells
NativeVllmEngine,
which runs inside NeMo RL's own vLLM worker, to sample the request from its generation config, exactly as
native generate_async does.
One rollout, two paths
Where they meet, and what still differs
After this PR, the Dynamo path and the native path become the same code at
_serve_rollout
(step 4) and use the same output builder (step 5). For a text prompt both hand vLLM the same token ids.
What still differs is only how the request reaches the worker, and a short list of settings Dynamo cannot serve yet.
Piece
Before (backend: dynamo)
After (dynamo: true)
Which vLLM runs
Dynamo's own, in /opt/dynamo_venv with its own lock file
NeMo RL's vLLM. Only Dynamo's backend SDK is added, and it imports no vLLM. vLLM venvs pin pydantic 2.13.0 for Dynamo.
Refit, pause, quantization, speculative decoding
Refit and pause went over HTTP /engine/* routes; anything else had to be ported to dynamo.vllm
The worker's own; nothing to port
Who picks the engine
KV router
KV router (native: the driver picks a shard)
Rejected at startup
—
colocated, fleet health, NeMo-Gym (until #4979), EP > TP, API key, router_mode: direct
Why it matters. Dynamo now costs one config flag and no second vLLM, so a vLLM bump no longer waits on Dynamo's copy, and the PR removes about 12,500 lines while adding 2,600.
CI runs the SingleController math and reload-refit tests through Dynamo and checks that every rollout was routed and KV events were applied.
The review's open asks: a CI test for examples/run_grpo.py with dynamo: true (its only one was deleted), an upstream Dynamo issue for the logging takeover, and native-vs-Dynamo timing from the existing runs.