Skip to content

Support GEMM + Swiglu fused MLP#3890

Merged
yaox12 merged 10 commits into
NVIDIA:devfrom
ksivaman:ksivaman/fused_grouped_mlp_mxfp8
Mar 20, 2026
Merged

Support GEMM + Swiglu fused MLP#3890
yaox12 merged 10 commits into
NVIDIA:devfrom
ksivaman:ksivaman/fused_grouped_mlp_mxfp8

Conversation

@ksivaman

Copy link
Copy Markdown
Member

What does this PR do ?

This PR supports GEMM + Swiglu fused MLP via Transformer Engine sequential ops.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
@ksivaman ksivaman requested review from a team as code owners March 16, 2026 19:19
@copy-pr-bot

copy-pr-bot Bot commented Mar 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.

@ko3n1g

ko3n1g commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

/ok to test 86d4097

@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Mar 16, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown

Cherry-pick to main failed

The cherry-pick encountered conflicts and could not be completed automatically.

Next steps:

  1. Manually create a PR with these changes to main
  2. Resolve any conflicts

Comment thread megatron/core/transformer/moe/experts.py Outdated
Comment thread megatron/core/transformer/moe/moe_utils.py Outdated
Comment thread megatron/core/transformer/moe/experts.py Outdated
Comment thread megatron/core/transformer/moe/experts.py Outdated
Comment thread megatron/core/transformer/moe/experts.py
Comment thread megatron/core/transformer/transformer_config.py
Comment thread megatron/core/transformer/moe/experts.py
Comment thread megatron/core/transformer/moe/experts.py
@yaox12

yaox12 commented Mar 17, 2026

Copy link
Copy Markdown
Member

/claude review

Comment thread megatron/core/transformer/moe/experts.py Outdated
Comment thread megatron/core/transformer/moe/experts.py
Comment thread megatron/core/transformer/transformer_config.py
Comment thread megatron/core/transformer/moe/experts.py Outdated
@yaox12

yaox12 commented Mar 18, 2026

Copy link
Copy Markdown
Member

Can you add unit tests for the numerics of the fusion, and the remapping of parameter keys?

@ksivaman

Copy link
Copy Markdown
Member Author

@yaox12 The unit test for both the checkpoint loading as well as specifically the fusion numerics are included in NVIDIA/TransformerEngine#2769. I think adding them separately would be a duplicate. Unless you mean an e2e test?

@yaox12 yaox12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. UTs are covered in TE.

@yaox12

yaox12 commented Mar 19, 2026

Copy link
Copy Markdown
Member

/ok to test 14f63ad

@yaox12 yaox12 enabled auto-merge March 19, 2026 14:36
@svcnvidia-nemo-ci

Copy link
Copy Markdown

Cherry-pick to main failed

The cherry-pick encountered conflicts and could not be completed automatically.

Next steps:

  1. Manually create a PR with these changes to main
  2. Resolve any conflicts

Signed-off-by: Xin Yao <xiny@nvidia.com>
@yaox12 yaox12 added this pull request to the merge queue Mar 19, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown

🔄 Merge queue validation started!

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

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 19, 2026
@yaox12 yaox12 added this pull request to the merge queue Mar 20, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown

🔄 Merge queue validation started!

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

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 20, 2026
@yaox12 yaox12 added this pull request to the merge queue Mar 20, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown

🔄 Merge queue validation started!

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

Merged via the queue into NVIDIA:dev with commit c72c459 Mar 20, 2026
75 of 80 checks passed
@ksivaman ksivaman mentioned this pull request Mar 20, 2026
5 tasks
copy-pr-bot Bot pushed a commit that referenced this pull request Mar 20, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
@nanz-nv nanz-nv mentioned this pull request Mar 30, 2026
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 5, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 5, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 7, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 8, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 11, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 12, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 12, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 12, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY pushed a commit to Connor-XY/Megatron-LM that referenced this pull request May 13, 2026
Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
Signed-off-by: ksivamani <ksivamani@nvidia.com>
Connor-XY added a commit to Connor-XY/Megatron-LM that referenced this pull request May 14, 2026
…r hunk

The `_cached_param_buffer_shards_grad_enabled` field, its read site in
`start_param_sync()`, and the `with torch.no_grad()` wrap around the
coalescing manager all originated in NVIDIA#3890 on the dev branch. The dev
sync merge `79aeecfe0` (Mar 25 2026) explicitly removed the read site
and the no_grad wrap during conflict resolution when it pulled in the
layerwise-optimizer code from main — only the field init survived as an
orphan in `__init__`. The active logic was deliberately dropped, no
regression was reported on dev or main in the intervening months, and
zhongbozhu flagged this exact block on this PR (r3211212707) noting it
was removed in dev.

For a PR targeting main, resurrecting a hunk that was specifically
dropped during a merge — without a fresh repro proving main needs it —
is the wrong default. Remove all three pieces (the orphan init, the
read site, the no_grad wrap) so this file matches main's shape except
for the changes that are genuinely part of this PR's scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

6 participants