Skip to content

Single group mxfp8 grouped mlp - #3267

Merged
vthumbe1503 merged 17 commits into
NVIDIA:mainfrom
sraman-rgb:sraman/single-group-mxfp8-grouped-mlp
Jul 29, 2026
Merged

Single group mxfp8 grouped mlp#3267
vthumbe1503 merged 17 commits into
NVIDIA:mainfrom
sraman-rgb:sraman/single-group-mxfp8-grouped-mlp

Conversation

@sraman-rgb

Copy link
Copy Markdown
Contributor

Description

Please include a brief summary of the changes, relevant motivation and context.

Fixes # (issue)

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
@sraman-rgb
sraman-rgb requested a review from timmoon10 as a code owner July 27, 2026 15:34
@github-actions github-actions Bot added the community-contribution PRs from external contributor outside the core maintainers, representing community-driven work. label Jul 27, 2026
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds single-group MXFP8 support to the fused grouped-MLP path.

  • Converts one-member grouped MXFP8/NVFP4 storage into ordinary quantized tensor views for dense FC2, dgrad, and wgrad GEMMs.
  • Adds cuDNN frontend-gated single-group runtime-offset handling and avoids allocating offset metadata for the optimized shared-expert path.
  • Preserves unit activation-scale behavior across forward and backward execution.
  • Adds single-group MXFP8 tests with bias and runtime-offset capability variants.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
transformer_engine/pytorch/ops/fused/grouped_mlp.py Extends the fused grouped-MLP forward and backward paths with single-group MXFP8 tensor conversion, dense GEMM dispatch, runtime offsets, and unit-scale handling.
tests/pytorch/test_grouped_mlp.py Adds single-group MXFP8 coverage across bias and simulated cuDNN runtime-offset support configurations.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Single-group grouped MLP input] --> B[Quantize as grouped MXFP8 storage]
  B --> C[FC1 fused GEMM and activation]
  C --> D[Convert one-member grouped activation to MXFP8 tensor view]
  D --> E[Dense FC2 GEMM]
  E --> F[MLP output]
  F --> G[Backward dactivation]
  G --> H[Dense single-group dgrad]
  G --> I[Dense single-group wgrad]
Loading

Reviews (9): Last reviewed commit: "Skip runtime-offset test with older cuDN..." | Re-trigger Greptile

@timmoon10 timmoon10 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.

Mostly fine as a hacky expedient. Remember that the single-group approach is a dead end and we should not put much more effort into it. The right approach is to implement a dense MLP fused op.

Comment thread transformer_engine/pytorch/ops/fused/grouped_mlp.py Outdated
Comment thread transformer_engine/pytorch/ops/fused/grouped_mlp.py Outdated
Comment thread transformer_engine/pytorch/ops/fused/grouped_mlp.py Outdated
Comment thread tests/pytorch/test_fusible_ops.py
sraman-rgb and others added 8 commits July 27, 2026 20:32
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
vthumbe1503
vthumbe1503 previously approved these changes Jul 28, 2026
@vthumbe1503

Copy link
Copy Markdown
Collaborator

/te-ci pytorch

Signed-off-by: Siddhartha Raman Sundara Raman <sraman@nvidia.com>
@sraman-rgb

Copy link
Copy Markdown
Contributor Author

/te-ci pytorch

1 similar comment
@vthumbe1503

Copy link
Copy Markdown
Collaborator

/te-ci pytorch

@vthumbe1503 vthumbe1503 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Although I agree with Tim, grouped_mlp has now become grouped_mlp+dense_mlp. We probably should consider migrating it to a seperate fused op soon.

@vthumbe1503
vthumbe1503 merged commit 3e7ae6c into NVIDIA:main Jul 29, 2026
21 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution PRs from external contributor outside the core maintainers, representing community-driven work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants