Skip to content

feat(dynamo): start every vLLM recipe Dynamo renders and parses as natively - #4954

Draft
jthomson04 wants to merge 8 commits into
NVIDIA-NeMo:jthomson04/dynamo-gymfrom
jthomson04:jthomson04/dynamo-chat-parity
Draft

jthomson04 wants to merge 8 commits into
NVIDIA-NeMo:jthomson04/dynamo-gymfrom
jthomson04:jthomson04/dynamo-chat-parity

Conversation

@jthomson04

@jthomson04 jthomson04 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #4979 (NeMo-Gym through Dynamo), which is stacked on #4905 and #4978, with Gym pinned to NVIDIA-NeMo/Gym#5161 (itself stacked on Gym#4817). Its base is jthomson04/dynamo-gym, a copy of #4979's branch, so the diff shows only this PR's two feat(dynamo) commits.

What

policy.generation.dynamo: true should start any vLLM recipe that runs natively on the SingleController. A sweep of all 276 shipped vLLM recipes, each converted to its SingleController form, found 9 VLM NeMo-Gym recipes that native vLLM starts but Dynamo refused. The cause in every case was one of two of our own config checks, not anything Dynamo can't serve. This PR fixes those checks and adds two smaller parity fixes:

  • Parser plugins. A configured plugin no longer blocks a parser it doesn't provide. Most of these recipes inherit nano_v3_reasoning_parser.py from a base config while selecting deepseek_r1 or nemotron_v3, which are vLLM built-ins that Dynamo also ships. Startup now applies only Dynamo's renames. Engine registration imports the plugin the way the native server does (shared import_parser_plugins) and refuses a name only when the plugin provides it.
  • chat_template_content_format. This is now checked by what actually renders differently, not by its name. Dynamo's renderer keeps string content as strings and passes content arrays to the template. For text, and for one media item per message, that matches vLLM's auto, string and openai. string is refused only when vllm_kwargs.limit_mm_per_prompt allows several items of a modality: in that case vLLM puts all the placeholders first, while the template places them.
  • deepseek_r1 with enable_thinking: false is now refused. vLLM's parser returns the turn as reasoning; Dynamo's parsers return it as content.
  • nano_v3 honors force_nonempty_content, as Dynamo's and Megatron's Nemotron v3 parsers already do.
  • NeMo-Gym template kwargs and affinity (second commit, Gym#5161).
    • The native server's default template kwargs go to Gym's new lowest-precedence default_chat_template_kwargs. Merging them into chat_template_kwargs let them override a Gym YAML's own kwargs and drop its extra_body kwargs, the opposite of native.
    • Gym sends x-dynamo-session-id on every Dynamo call, not just on token-capture calls.

The two Nemotron-Omni video recipes (limit_mm_per_prompt.image: 32 with string) stay refused. A Dynamo content-format option with vLLM's semantics would lift that; the work is upstream and doesn't block this PR.

Guard

test_vllm_recipes_start_with_dynamo_where_they_start_natively runs every shipped vLLM recipe through the SingleController's config checks, natively and with dynamo: true. It fails if Dynamo refuses a recipe the native path accepts. The only allowed refusals are those the native path hits too, just later at runtime:

It takes about 30 s on CPU for all recipes.

Verification

  • Unit tests:

    • base lane: 1813 passed, including the new guard (260 recipes pass); NeMo-Gym environments: 179 passed, plus 80 in the --nemo-gym-only lane;
    • vLLM lane, test_dynamo_native_engine.py: 34 passed.
  • Lint and lock: ruff 0.9.9 clean; pyrefly 0.24.2 reports 0 errors; uv lock --check passes with the new Gym pin.

  • Nemotron Omni 30B-A3B, one engine, greedy NeMo-Gym calls, native endpoint vs Dynamo frontend, chat_template_content_format: string:

    Call Prompt, generation tokens and content
    System + one image identical (max |Δlogprob| = 0)
    Second turn, one image per message (two in the prompt, prefix splice) identical
    Two images in one message differ, which is the case the new rule refuses

🤖 Generated with Claude Code

…tively

`dynamo: true` refused 9 VLM NeMo-Gym recipes that it serves as native vLLM
does:

- A parser plugin no longer blocks a parser it does not provide. Startup
  only applies Dynamo's renames; engine registration imports the plugin as
  the native server does (shared `import_parser_plugins`) and refuses a name
  only when the plugin provides it.
- `chat_template_content_format` is checked by what renders differently,
  not by name. Dynamo's renderer matches vLLM's `auto`, `string` and `openai`
  for text and one media item per message. `string` is refused only when
  `limit_mm_per_prompt` allows several items of a modality, where vLLM puts
  their placeholders first.
- `reasoning_parser: deepseek_r1` with `enable_thinking: false` is refused:
  vLLM's parser returns the turn as reasoning, Dynamo's as content.
- NeMo RL's `nano_v3` parser honors `force_nonempty_content`, as Dynamo's and
  Megatron's Nemotron v3 parsers do.

A config-validation test checks every shipped vLLM recipe, in its
SingleController form, starts with `dynamo: true` wherever it starts
natively, apart from refusals native vLLM shares at runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04 jthomson04 added the CI:L1 Run doctests, unit tests, and functional tests label Oct 27, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 4fbea55

@github-actions github-actions Bot added Documentation Improvements or additions to documentation CI Relating to CI labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 4fbea55 (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

…ery Gym rollout

Re-pins Gym to NVIDIA-NeMo/Gym#5161 (e6800bb), on top of Gym#4817, and uses it:

- The native server's default chat template kwargs now go to Gym's new
  `default_chat_template_kwargs`, which Gym applies under every other source
  of template kwargs. Writing them into `chat_template_kwargs` overrode a Gym
  YAML's own kwargs through Gym's config merge, and dropped its
  `extra_body.chat_template_kwargs`, the opposite of the native server.
- Gym sends `x-dynamo-session-id` on every Dynamo call, not only on token
  capture calls, so the frontend keeps each rollout on one engine; the engine
  splices the echoed prefix after routing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test dd0f9ca

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: dd0f9ca (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

Brings in NVIDIA-NeMo#4905's merge of upstream main (b3cd664). No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test e95b722

jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 28, 2026
Brings in NVIDIA-NeMo#4954's restack onto NVIDIA-NeMo#4905's merge of upstream main (e95b722).
No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: e95b722 (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

NVIDIA-NeMo#4905 was split at review request: the vLLM refactor is NVIDIA-NeMo#4978, NVIDIA-NeMo#4905 is
now Dynamo core, and NeMo-Gym through Dynamo is NVIDIA-NeMo#4979. This PR now stacks
on NVIDIA-NeMo#4979. Gym is re-pinned to Gym#5161's head aa808b7, rebased onto Gym
main 5911d628c on top of Gym#4817's b0e681c.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 29, 2026
Restacks onto NVIDIA-NeMo#4954 after NVIDIA-NeMo#4905's split (vLLM refactor NVIDIA-NeMo#4978, Dynamo core
NVIDIA-NeMo#4905, NeMo-Gym through Dynamo NVIDIA-NeMo#4979) and the Gym#4817/#5161 rebase.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 779d3aa

Brings in NVIDIA-NeMo#4978's review fixes through NVIDIA-NeMo#4905 and NVIDIA-NeMo#4979.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 6a16c7e (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

Restacks onto NVIDIA-NeMo#4979's review fixes. Gym is re-pinned to Gym#5161's head
05101d0 (on Gym#4817 a7be5c5). Conflicts: the affinity TTL takes NVIDIA-NeMo#4979's
300 default and bound with this PR's every-call session; the guide keeps
this PR's default-template-kwargs behaviour (Gym applies them under every
source, so NVIDIA-NeMo#4979's "extra_body kwargs are dropped" note no longer applies)
and adds the 4-stop limit; the dialect test keeps both PRs' checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 29, 2026
Restacks onto NVIDIA-NeMo#4954 after NVIDIA-NeMo#4979's review fixes and the Gym#4817/#5161 restack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: dbd5123 (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

Restacks onto NVIDIA-NeMo#4979 after NVIDIA-NeMo#4905's rollout-only split (NVIDIA-NeMo#4979 now carries the
general OpenAI path). The guide keeps this PR's every-rollout session
affinity and chat-setting refusals with NVIDIA-NeMo#4905's reworded EP>TP, api-key and
direct-routing entries; the frontend tokenizer row is gone with its knobs.
The recipe sweep matches NVIDIA-NeMo#4905's reworded EP>TP refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 29, 2026
Restacks onto NVIDIA-NeMo#4954 after NVIDIA-NeMo#4905's rollout-only split and NVIDIA-NeMo#4979's restack. The
frontend-path test is NVIDIA-NeMo#4905's folded one; this PR's fleet-health tests and
guide wording are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: a21e2f3 (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: c9faa4c (PR #4954 from jthomson04/dynamo-chat-parity)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

@jthomson04
jthomson04 changed the base branch from main to jthomson04/dynamo-gym November 2, 2026 04:09
@terrykong terrykong removed Documentation Improvements or additions to documentation CI Relating to CI labels Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants