Skip to content

refactor(mimo): reuse shared dynamic-resolution pixel shuffle - #6482

Draft
cuichenx wants to merge 2 commits into
NVIDIA:mainfrom
cuichenx:agent/fix-pixel-shuffle-spatial-grouping
Draft

refactor(mimo): reuse shared dynamic-resolution pixel shuffle#6482
cuichenx wants to merge 2 commits into
NVIDIA:mainfrom
cuichenx:agent/fix-pixel-shuffle-spatial-grouping

Conversation

@cuichenx

@cuichenx cuichenx commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What does this PR do?

Make the MIMO RADIO dynamic-resolution adapter reuse the shared spatial pixel
shuffle corrected by #6255.

The MIMO wrapper still owns the operation it uniquely needs: splitting one
packed variable-resolution stream into individual tiles and concatenating the
results. It no longer carries a second copy of the spatial rearrangement.
Instead, every tile calls
llava_model.pixel_shuffle(..., h=..., w=...), the same primitive used by
non-MIMO LLaVA.

The accompanying mixed 2x4/4x4 regression compares the packed MIMO wrapper
directly with calls to the shared function, preventing the two paths from
silently diverging again.

Stacked dependency

This PR is intentionally stacked on #6255 and preserves that earlier PR's
implementation. Its parent is the exact #6255 head commit
c01991408020ae7c6d9bc77e98196e04e21bac73; this PR adds one commit touching
only:

  • examples/mimo/model_providers/radio_encoder.py
  • tests/unit_tests/models/mimo/test_radio_encoder.py

Because #6255 comes from another fork, GitHub cannot select its head branch as
this PR's displayed base. Until #6255 merges, the Files changed view against
NVIDIA/Megatron-LM:main also shows #6255's primitive and temporal-video
changes. Those changes are byte-identical to #6255 and are not being proposed
as alternatives here. After #6255 lands, this branch will be rebased onto the
updated main so the PR displays only the two-file MIMO delta.

Issue tracking

Depends on #6255.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests (not needed; focused GPU unit forward/backward coverage is included)
  • I have added proper typing to my code (no public API was added)
  • I have added relevant documentation
  • I have run the formatter and linters on all changed files

Validation

The exact stacked tree (#6255 head + MIMO commit) was validated on one H100:

python -m torch.distributed.run --nproc-per-node=1 -m pytest -q \
  tests/unit_tests/models/mimo/test_radio_encoder.py
5 passed

This covers the mixed-size delegation regression, all fixed-resolution flag
variants, and the dynamic-resolution RADIO GPU forward/backward path.

Signed-off-by: Ehsan Hosseini Asl <ehsan.hosseiniasl@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 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.

Signed-off-by: Chen Cui <chcui@nvidia.com>
@cuichenx
cuichenx force-pushed the agent/fix-pixel-shuffle-spatial-grouping branch from 6b0dde3 to c7e3eff Compare August 12, 2026 15:14
@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 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.

@cuichenx cuichenx changed the title fix(multimodal): unify dynamic-resolution pixel shuffle refactor(mimo): reuse shared dynamic-resolution pixel shuffle Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants