Skip to content

[model] feat: Add limited Gemma4 dense model support#3885

Merged
kamran-nvidia merged 6 commits into
NVIDIA-NeMo:mainfrom
pavelgein:gemma4_31b
May 23, 2026
Merged

[model] feat: Add limited Gemma4 dense model support#3885
kamran-nvidia merged 6 commits into
NVIDIA-NeMo:mainfrom
pavelgein:gemma4_31b

Conversation

@pavelgein

Copy link
Copy Markdown
Contributor

What does this PR do ?

Current implementation of Gemma4VL Bridge supports only MoE models.
This restrictions is loosed to support Gemma4 31B model, since it does not have a per-layer embeddings

Changelog

  • Add specific line by line info of high level changes in this PR.

GitHub Actions CI

See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

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 add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

@copy-pr-bot

copy-pr-bot Bot commented May 19, 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 waiting-on-maintainers Waiting on maintainers to respond labels May 19, 2026
@kamran-nvidia kamran-nvidia requested a review from yaoyu-33 May 20, 2026 18:23
yaoyu-33
yaoyu-33 previously approved these changes May 20, 2026
@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and only waiting for CI to pass before merge and removed waiting-on-maintainers Waiting on maintainers to respond labels May 20, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/claude review

Comment thread src/megatron/bridge/models/gemma/gemma4_provider.py Outdated
Comment thread src/megatron/bridge/models/gemma_vl/gemma4_vl_bridge.py
Comment thread tests/functional_tests/test_groups/models/gemma_vl/test_gemma4_vl_conversion.py Outdated
@claude

claude Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Light Review - Issues found: (1) Typo gemma4_provider.py:349 decided base on should be decided based on (2) Missing space in error message gemma4_vl_bridge.py:83 f-string period has no trailing space so text runs together (3) Confusing error wording gemma4_vl_bridge.py:81 or model without hidden_size_per_layer_input is hard to parse (4) Copy-paste docstring test_gemma4_vl_conversion.py:300 says MoE bridge should say Dense bridge. See inline comments for code suggestions. Suggested test cases: No perf tests impacted.

@kamran-nvidia

Copy link
Copy Markdown
Contributor

@pavelgein Please address Claude's comments. Thanks

@kamran-nvidia

Copy link
Copy Markdown
Contributor

/ok to test f6f5420

@kamran-nvidia kamran-nvidia added waiting-on-customer Waiting on the original author to respond and removed ready-to-merge PR is approved, current, and only waiting for CI to pass before merge labels May 21, 2026
@kamran-nvidia

Copy link
Copy Markdown
Contributor

@pavelgein Please address the CI failures. I will run the CI again once addressed.

@kamran-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 8ea504c

@kamran-nvidia kamran-nvidia added ready-to-merge PR is approved, current, and only waiting for CI to pass before merge and removed waiting-on-customer Waiting on the original author to respond labels May 21, 2026
kamran-nvidia
kamran-nvidia previously approved these changes May 21, 2026
pavelgein added 5 commits May 22, 2026 11:22
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
@pavelgein

Copy link
Copy Markdown
Contributor Author

I have added support for dense Gemma4 model (not VLM one), so could you please review once again?

@kamran-nvidia kamran-nvidia requested a review from yaoyu-33 May 22, 2026 12:01
@kamran-nvidia kamran-nvidia added needs-review PR is ready for code review and waiting on a reviewer and removed ready-to-merge PR is approved, current, and only waiting for CI to pass before merge labels May 22, 2026
@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and only waiting for CI to pass before merge and removed needs-review PR is ready for code review and waiting on a reviewer labels May 22, 2026
@kamran-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 2305b42

@kamran-nvidia kamran-nvidia merged commit 9e19852 into NVIDIA-NeMo:main May 23, 2026
73 checks passed
vasunvidia pushed a commit to vasunvidia/Megatron-Bridge that referenced this pull request Jun 10, 2026
Signed-off-by: Pavel Gein <pavel.gein@gmail.com>
Co-authored-by: Kamran Jafari <kjafarisadeg@nvidia.com>
Signed-off-by: Vasudevan Rengasamy <vrengasamy@nvidia.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 community-request feature New capabilities, enhancements, or enablement work 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