Skip to content

feat(multimodal): AUT-2316 reapply vision token utilities - #7329

Merged
ko3n1g merged 2 commits into
NVIDIA:mainfrom
svcnemo-autobot:revert/multimodal-vision-7249
Sep 16, 2026
Merged

ko3n1g merged 2 commits into
NVIDIA:mainfrom
svcnemo-autobot:revert/multimodal-vision-7249

Conversation

@svcnemo-autobot

Copy link
Copy Markdown
Collaborator

Background

PR #7326 ("ci: Revert recently merged changes as they cause CI unit test failures") reverted three recently-merged changes. This PR re-applies one of them: "Add multimodal vision token utilities (#7249)", which was reverted by commit d0f6ed6.

What changed

This reverts the revert commit d0f6ed6b596748ea5c339bc888b256f16c58db99, restoring the multimodal vision token utilities in megatron/core/models/multimodal/utils.py and the corresponding CLIP ViT model support and unit tests (3 files, ~364 insertions).

Details

The change is the exact inverse of the #7326 revert commit, applied on top of current main. No new code is introduced beyond what was originally merged in #7249.

Tested

Re-applied cleanly (no conflicts) on main @ 78d917e6b. Tree diff verified to be the exact inverse of the revert commit. Local lint/test toolchain could not be provisioned in the rootless authoring workstation (no Python / no package install); GitHub CI is the authoritative gate.

Reapply "Add multimodal vision token utilities (NVIDIA#7249)".

This reverts the revert commit d0f6ed6
("Revert 'Add multimodal vision token utilities (NVIDIA#7249)'") from PR NVIDIA#7326,
restoring the original change.

Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 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.

@svcnvidia-nemo-ci
svcnvidia-nemo-ci marked this pull request as draft September 15, 2026 00:20
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically converted to draft because all PRs must start as drafts.

When you are ready for review, click Ready for Review to begin the review process. This will:

  1. Add the oncall reviewer (optional reviewer)
  2. Add required review teams based on your changes

See the contribution guide for more details.

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 458485d

The re-applied multimodal vision token utilities (NVIDIA#7249) import einops at
module scope. einops is an optional dependency that is absent from the
minimal environment used by the 'Pip - NGC PyTorch' import check, so
importing megatron.core.models.multimodal.utils raised ModuleNotFoundError.

Guard the import the same way the rest of megatron/core does (e.g.
transformer/attention.py): fall back to rearrange = None so the module
imports cleanly; the symbol is only exercised when the patchify helpers
actually run, where einops is installed.

Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test f5024ef

@tylerpoon
tylerpoon marked this pull request as ready for review September 15, 2026 14:09
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Final Review PR is in the "final review" stage label Sep 15, 2026
@tylerpoon
tylerpoon enabled auto-merge September 15, 2026 16:57
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the Final Review PR is in the "final review" stage label Sep 15, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Approved All necessary approvals have been made label Sep 15, 2026
@ko3n1g ko3n1g closed this Sep 16, 2026
auto-merge was automatically disabled September 16, 2026 17:40

Pull request was closed

@ko3n1g ko3n1g reopened this Sep 16, 2026
@ko3n1g
ko3n1g enabled auto-merge September 16, 2026 18:05
@ko3n1g
ko3n1g disabled auto-merge September 16, 2026 18:09
@ko3n1g
ko3n1g added this pull request to the merge queue Sep 16, 2026
@nemo-automation-bot

Copy link
Copy Markdown

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/35138258066

Merged via the queue into NVIDIA:main with commit cfa9e20 Sep 16, 2026
117 of 125 checks passed

This branch was previously deployed

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

Labels

Approved All necessary approvals have been made Run selective unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants