Skip to content

Single group mxfp8 grouped mlp - #3267

Open
sraman-rgb wants to merge 12 commits into
NVIDIA:mainfrom
sraman-rgb:sraman/single-group-mxfp8-grouped-mlp
Open

Single group mxfp8 grouped mlp#3267
sraman-rgb wants to merge 12 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

The PR adds optimized single-group MXFP8 grouped-MLP execution.

  • Converts one-member grouped MXFP8 storage into regular quantized tensor views for dense forward and backward GEMMs.
  • Adds single-group split metadata handling, runtime-offset specialization, and weight-scale swizzling.
  • Extends grouped-MLP tests to cover one-group MXFP8 execution with bias and runtime-offset 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 Adds single-group MXFP8 tensor conversion, dense GEMM paths, metadata specialization, and corresponding backward handling.
tests/pytorch/test_grouped_mlp.py Adds single-group MXFP8 coverage and ensures the one-group fixture uses a nonempty token split.

Sequence Diagram

sequenceDiagram
  participant Caller
  participant GroupedMLP
  participant Quantizer
  participant Kernel
  Caller->>GroupedMLP: forward(input, one split)
  GroupedMLP->>GroupedMLP: prepare single-group metadata
  GroupedMLP->>Quantizer: quantize MXFP8 activations
  Quantizer-->>GroupedMLP: grouped quantized storage
  GroupedMLP->>Kernel: fused FC1 and activation
  Kernel-->>GroupedMLP: quantized activation
  GroupedMLP->>Kernel: dense single-group FC2 GEMM
  Kernel-->>Caller: output
  Caller->>GroupedMLP: backward(grad_output)
  GroupedMLP->>Kernel: dactivation, dgrad, and wgrad
  Kernel-->>Caller: input and parameter gradients
Loading

Reviews (5): Last reviewed commit: "Support older cuDNN grouped MLP APIs" | 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
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 5 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>
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.

2 participants