Nine pages on this stack (#4905, #4979 and #5115), one question each. This one: how a NeMo-Gym call runs through Dynamo vs the native vLLM server.
Before
With policy.generation.dynamo: true, any NeMo-Gym run was refused at startup
(base nemo_gym.py).
Gym talked only to each vLLM shard's own OpenAI server.
This PR
Gym calls one Dynamo frontend URL in a new "Dynamo dialect". Dynamo's own renderer applies the chat template, and the same vLLM workers run a copy of the native capture steps on the token ids.
Status
Open: changes requested, not merged. Rewards match the native server on the author's small runs, but the
published review found these gaps, none fixed yet:
the prefix splice counts fewer turn-end tokens than native (C16, below);
forest training fails (C26);
score centering fails (C29);
Dynamo's renderer can build different prompts than vLLM (C28);
images can be processed twice (C30).
The proposed fix is one shared copy of the steps, run by NeMo RL's own chat engine inside the Dynamo frontend
(C27, picture).
Background.Dynamo
puts one HTTP frontend in front of all vLLM engines and sends each request to the engine that already
holds most of its prompt in cache. NeMo-Gym
needs more than text back: the exact prompt and generated token ids and their log-probs, so training sees the
same tokens the model produced. A multi-turn call also sends back the earlier turns' exact tokens
(the echoed prefix),
which the server splices in place of its own re-rendered history. Dotted words have a short explanation: hover or tap them.
Natively, Gym gets one URL per vLLM shard and calls that shard's
/v1/chat/completions.
With Dynamo, client_base_urls
hands Gym the frontend URL instead, and
_apply_dynamo_dialect
turns on Gym's dialect. The frontend renders and tokenizes the chat, so the engine sees only token ids plus
Gym's annotations. _generate_gym
then redoes, on tokens, what the native chat endpoint does on messages.
One Gym call, two paths
Where they meet, and what still differs
The two paths join at the vLLM worker. On-policy sampling, the context clamp, generation, token capture and
the token-field helpers are the same code. Everything before that differs, because the frontend renders the chat and the
engine never sees messages.
Native: Gym picks a shard. Dynamo: the frontend routes by cached prefix, and a capture session stays on one engine for up to session_affinity_ttl_secs (300 s).
Where the echoed prefix ends
differs
Native renders the history and counts turn-end tokens in it. Dynamo counts them in Gym's own prefix, and counts only the tokenizer EOS.
Native merges server defaults under each request's kwargs. Dynamo has Gym send them, so a key a Gym YAML also sets loses to the default (documented in the guide).
Stop strings
differs
Dynamo refuses more than 4 stop strings or stop_token_ids (HTTP 500).
Why keep both. The native server needs no extra services and renders the history itself.
Dynamo adds prefix-aware routing across the whole fleet behind one URL, which is the point of running it, but
it needs etcd, NATS and the frontend, and it rejects a few settings at startup (the generation router,
top_logprobs > 0, extra_body.bad_words). The PR shows matching rewards and
gen_kl_error on small 2-GPU runs. No speed comparison is posted yet, and the review asks for one
swe1 run at head, Dynamo vs native.