Skip to content

feat(nemotron-omni): add Megatron Nano image GRPO support#3227

Open
aroshanghias-nvd wants to merge 8 commits into
NVIDIA-NeMo:mainfrom
aroshanghias-nvd:aroshanghias/nemotron-omni-main-migration
Open

feat(nemotron-omni): add Megatron Nano image GRPO support#3227
aroshanghias-nvd wants to merge 8 commits into
NVIDIA-NeMo:mainfrom
aroshanghias-nvd:aroshanghias/nemotron-omni-main-migration

Conversation

@aroshanghias-nvd

@aroshanghias-nvd aroshanghias-nvd commented Jul 16, 2026

Copy link
Copy Markdown

What does this PR do ?

Add Megatron-based Nemotron Nano Omni image-GRPO support using a dedicated, model-owned multimodal packing path.

Cross-repository dependency: This draft depends on NVIDIA-NeMo/Megatron-Bridge#4885. The submodule is temporarily pinned to that PR's head (ccf4b09e). After the MBridge PR merges, this PR must be updated to the resulting commit on MBridge main before it is marked ready for review.

The integration follows the same high-level boundary used by other maintained VLMs: NeMo-RL supplies the full processor-expanded sequence and multimodal inputs, while the MBridge NemotronOmniModel inserts media embeddings and owns sequence packing and context-parallel sharding. It does not use the historical Nemotron Omni LLaVAModel collapse/expand path.

The PR includes:

  • capability-based dispatch for model-owned sequence and MTP-mask packing;
  • a clear error for legacy LLaVA-layout Nemotron Omni checkpoints;
  • dynamic-resolution and historical tiled-image metadata handling;
  • NeMo-side generation compatibility for raw policy logprobs, context-length capping, RADIO LayerScale initialization, and cached bad_words tokenization;
  • maintained single-node Clevr and four-node MMPR Nano image-GRPO recipes.

No external vLLM source code or vLLM dependency pin is changed. The vLLM compatibility behavior is implemented in NeMo-RL's existing integration and runtime-patch layer.

Issues

No public issue.

Usage

The maintained recipes added by this PR are:

  • examples/configs/recipes/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-1n8g-megatron-tp8ep8.v1.yaml
  • examples/configs/recipes/vlm/vlm_grpo-nemotron-omni-30ba3b-mmpr-4n8g-megatron-tp8ep16.v1.yaml

Validation

  • Matched production-shaped Omni-versus-main Nano image-GRPO runs exercised generation, rewards, policy logprobs, training, repeated vLLM refit, and checkpointing. Results are available in the Nemotron Omni main-migration W&B project.
  • Focused default-lane changed tests: 28 passed.
  • Focused vLLM backend tests: 4 passed.
  • The changed MCore data-path tests passed before the existing local test environment reached its missing megatron.energon dependency. The corresponding exact-head MBridge change is separately covered by 89 focused unit tests and a ten-iteration functional recipe in the dependency PR. Protected NeMo-RL CI remains required before this draft is marked ready.
  • Pre-commit formatting, Ruff, Markdown filename, and recipe-minimization hooks: passed. Pyrefly is currently blocked by three pre-existing W&B type-stub errors in files not changed by this PR.
  • git diff --check: passed.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Updated docs/guides/nemotron-3-nano-omni.md with the Megatron architecture, supported scope, checkpoint compatibility, recipes, and usage.

Additional Information

This PR is intentionally a draft. It must remain draft until the MBridge dependency merges, the submodule is repinned to MBridge main, and protected CI passes.

Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 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.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Jul 16, 2026
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: cf54287 (PR #3227 from aroshanghias/nemotron-omni-main-migration)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@aroshanghias-nvd
aroshanghias-nvd requested a review from yfw July 16, 2026 00:31
@aroshanghias-nvd
aroshanghias-nvd force-pushed the aroshanghias/nemotron-omni-main-migration branch from cf54287 to b8f0e97 Compare July 16, 2026 00:32
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: b8f0e97 (PR #3227 from aroshanghias/nemotron-omni-main-migration)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
@aroshanghias-nvd aroshanghias-nvd added the CI:L1 Run doctests, unit tests, and functional tests label Jul 16, 2026
@aroshanghias-nvd

Copy link
Copy Markdown
Author

/ok to test 31d577b

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 31d577b (PR #3227 from aroshanghias/nemotron-omni-main-migration)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@aroshanghias-nvd
aroshanghias-nvd marked this pull request as ready for review July 16, 2026 01:13
@aroshanghias-nvd
aroshanghias-nvd requested review from a team as code owners July 16, 2026 01:13
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
@aroshanghias-nvd
aroshanghias-nvd requested a review from a team as a code owner July 16, 2026 18:32
@aroshanghias-nvd

Copy link
Copy Markdown
Author

/ok to test cbe1333

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: cbe1333 (PR #3227 from aroshanghias/nemotron-omni-main-migration)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: a2f0c95 (PR #3227 from aroshanghias/nemotron-omni-main-migration)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

for t in non_none_tensors
]

return torch.cat(non_none_tensors, dim=self.dim_to_pack).to(device)

@rohitrango rohitrango Jul 17, 2026

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.

seems a little specific for 2d images. will it generalize to video frames, audio embeddings, etc.? as_tensor is called for all types of tensors imo

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 Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants