[Common] MXFP8: Add swizzled-scale fast path for cast-only quantization - #3338
Merged
Merged
Conversation
Produce GEMM-ready scales directly in the specialized cast-only kernels to avoid separate scale-swizzle launches while preserving generic fallbacks for unsupported shapes. Signed-off-by: qiyuw <qiyuw@nvidia.com>
for more information, see https://pre-commit.ci
Contributor
Greptile SummaryThe PR adds GEMM-swizzled scale output to specialized MXFP8 cast-only kernels, avoiding a separate scale-swizzle launch while retaining generic fallbacks.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MXFP8 cast-only quantization] --> B{Supported dtype, shape, grid, and no noop tensor?}
B -->|Yes: rowwise| C[Specialized rowwise kernel]
B -->|Yes: bidirectional| D[Specialized bidirectional TMA kernel]
B -->|No| E[Generic MXFP8 kernel]
C --> F[Write FP8 data and GEMM-swizzled row scales]
D --> G[Write rowwise and colwise FP8 data and swizzled scales]
E --> H[Preserve generic and noop-aware behavior]
F --> I[GEMM-ready quantized tensor]
G --> I
H --> I
Reviews (3): Last reviewed commit: "merge main and fix conflicts" | Re-trigger Greptile |
Collaborator
|
/te-ci |
Signed-off-by: qiyuw <qiyuw@nvidia.com>
Signed-off-by: qiyuw <qiyuw@nvidia.com>
Collaborator
|
/te-ci |
Oleg-Goncharov
self-requested a review
August 11, 2026 11:12
Oleg-Goncharov
approved these changes
Aug 11, 2026
Oleg-Goncharov
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Pipeline #62101472 passed without errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Produce GEMM-ready scales directly in the specialized MXFP8 cast-only kernels. When GEMM-optimized scales are requested, eligible rowwise and bidirectional casts now write scale inverses directly in the GEMM-swizzled layout.
This avoids separate scale-swizzle kernel launches and reduces intermediate scale-memory traffic. Unsupported shapes and configurations, including noop-aware calls, continue to use the generic implementation to preserve existing behavior.
Irregular but supported shapes are handled by zero-initializing padded scale regions before the specialized kernel writes valid scale values.
Fixes: N/A
Type of change
Changes
Checklist: