Skip to content

feat(video): enable canonical Nemotron Omni training for V2 MoE checkpoints - #5304

Merged
aroshanghias-nvd merged 1 commit into
mainfrom
ehsan/video-rl-gym-async-grpo
Aug 9, 2026
Merged

feat(video): enable canonical Nemotron Omni training for V2 MoE checkpoints#5304
aroshanghias-nvd merged 1 commit into
mainfrom
ehsan/video-rl-gym-async-grpo

Conversation

@ehosseiniasl

@ehosseiniasl ehosseiniasl commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable canonical Nemotron Omni video training for Nano Omni MoE checkpoints serialized with the historical NemotronH_Nano_VL_V2 architecture label.

  • Detect V2-labeled checkpoints with a MoE language configuration.
  • Route those checkpoints to the canonical expanded-sequence NemotronOmniModelProvider.
  • Use the canonical video-embedder, vision, MoE-router, expert, and shared-expert checkpoint mappings.
  • Preserve historical V2 image-delimiter token IDs when absent from the serialized configuration.
  • Prevent MCores 4-D causal attention mask from being interpreted as a media-token validity mask.
  • Preserve existing NemotronVLModel behavior and legacy mappings for dense V2 checkpoints.

Motivation

The Nano Omni checkpoint used for video RL is serialized with the historical NemotronH_Nano_VL_V2 architecture label. However, its MoE architecture and processor-expanded multimodal
sequence require the canonical NemotronOmniModel.

During media insertion, only a 2-D padding or token-validity mask may filter placeholders. MCores 4-D causal mask remains unchanged for language-model attention; treating it as a validity
mask produces incorrect visual-feature counts.

This change selects the canonical model and mappings for MoE-shaped V2 checkpoints while preserving backward compatibility for dense V2 checkpoints.

Validation

  • Added coverage verifying that V2-labeled MoE checkpoints select NemotronOmniModelProvider.
  • Added coverage for canonical video-embedder and MoE checkpoint mappings.
  • Added coverage confirming that dense V2 checkpoints retain the historical provider and mappings.
  • Added coverage ensuring that a 4-D MCore causal mask is not used for media-token filtering.
  • Passed 53 focused Nemotron Omni model, provider, conversion, and mapping tests.
  • Exercised through downstream synchronous and asynchronous NeMo RL video GRPO training.

Dependencies

The canonical Nemotron Omni implementation from MBridge #5007 is already present in the target branch.

This PR does not modify the Megatron-LM submodule pointer.

Downstream integrations

@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added area:model Model implementations and HF bridge logic feature New capabilities, enhancements, or enablement work full-test-suite needs-more-tests Requires additional L0 and L1 test coverage before merge waiting-on-customer Waiting on the original author to respond labels Aug 4, 2026
@ehosseiniasl
ehosseiniasl force-pushed the ehsan/video-rl-gym-async-grpo branch from e3dd310 to 49f70a7 Compare August 4, 2026 23:22
@ehosseiniasl ehosseiniasl self-assigned this Aug 4, 2026
@ehosseiniasl
ehosseiniasl force-pushed the ehsan/video-rl-gym-async-grpo branch from 49f70a7 to b10cfed Compare August 5, 2026 14:29
Route V2-labeled Nano Omni MoE configs through the canonical expanded-sequence bridge while preserving dense V2 behavior. Keep MCore causal masks out of media token-validity filtering to avoid broadcasted placeholder counts in dense training.

Signed-off-by: Ehsan Hosseini Asl <ehsan.hosseiniasl@gmail.com>
@ehosseiniasl
ehosseiniasl force-pushed the ehsan/video-rl-gym-async-grpo branch from b10cfed to bb0d604 Compare August 7, 2026 14:51
@ehosseiniasl ehosseiniasl changed the title feat(nemotron-omni): enable temporal video training feat(video): enable canonical Nemotron Omni training for V2 MoE checkpoints Aug 7, 2026

@cuichenx cuichenx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks for rebasing

@cuichenx

cuichenx commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

/ok to test bb0d604

@cuichenx cuichenx added ready-to-merge PR is approved, current, and only waiting for CI to pass before merge and removed needs-more-tests Requires additional L0 and L1 test coverage before merge full-test-suite labels Aug 7, 2026
@yaoyu-33 yaoyu-33 removed the waiting-on-customer Waiting on the original author to respond label Aug 7, 2026
@yaoyu-33 yaoyu-33 added full-test-suite needs-more-tests Requires additional L0 and L1 test coverage before merge labels Aug 8, 2026
@aroshanghias-nvd

Copy link
Copy Markdown
Contributor

LGTM too. Thanks for the fix.

@aroshanghias-nvd aroshanghias-nvd removed the needs-more-tests Requires additional L0 and L1 test coverage before merge label Aug 9, 2026
@aroshanghias-nvd
aroshanghias-nvd merged commit 012529a into main Aug 9, 2026
84 checks passed
@aroshanghias-nvd
aroshanghias-nvd deleted the ehsan/video-rl-gym-async-grpo branch August 9, 2026 10:36
ananthsub pushed a commit to NVIDIA-NeMo/Gym that referenced this pull request Aug 19, 2026
## Summary

Add video-input support to the NeMo Gym Responses API and vLLM model
backend for multimodal RL training.

  - Accept `input_video` and `video_url` content parts.
- Convert Responses API video inputs into vLLM-compatible chat content.
  - Reject video parts that do not contain a valid URL.
- Prefer prompt and generation token IDs returned by the generation
request.
- Preserve multimodal processor arguments when falling back to the
tokenize endpoint.
- Validate that generation token IDs and log probabilities have matching
lengths.
- Propagate token IDs, log probabilities, and optional training metadata
through Gym responses.
- Ensure component processes load their owning Gym checkout instead of a
stale container installation.

  ## Motivation

Video GRPO requires Gym to preserve video content and the exact prompt
and generation tokenization used by vLLM.

Using token IDs produced by a separate or differently configured
tokenization request can cause rollout and policy log probabilities to
reference different token sequences, resulting in
  incorrect training data and elevated TMPE.

  ## Validation

  - Added coverage for `input_video` and `video_url` conversion.
  - Added coverage for missing video URLs.
  - Added coverage for native vLLM prompt and generation token IDs.
- Added coverage for the tokenize fallback and multimodal processor
arguments.
  - Added coverage for token-ID and log-probability propagation.
- Added coverage ensuring component processes prefer the owning Gym
checkout.
- Exercised through downstream synchronous and asynchronous NeMo RL
video GRPO training.

  ## Dependencies

  None.

  ## Related integrations

- NVIDIA-NeMo/Megatron-Bridge#5304 `feat(video): enable canonical
Nemotron Omni training for V2 MoE checkpoints`
- NVIDIA-NeMo/RL#3500 `feat(video): add Gym support for sync and async
GRPO`

---------

Signed-off-by: Ehsan Hosseini Asl <ehsan.hosseiniasl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model implementations and HF bridge logic feature New capabilities, enhancements, or enablement work full-test-suite ready-to-merge PR is approved, current, and only waiting for CI to pass before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants