mxfp8: add swizzled-scale fast path for cast-only quantization - #3338
Open
WanZzzzzz wants to merge 2 commits into
Open
mxfp8: add swizzled-scale fast path for cast-only quantization#3338WanZzzzzz wants to merge 2 commits into
WanZzzzzz wants to merge 2 commits into
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 a Blackwell MXFP8 cast-only fast path that writes GEMM-swizzled rowwise and columnwise scales directly, avoiding a separate swizzle launch while retaining generic fallback behavior.
Confidence Score: 5/5The PR appears safe to merge; no concrete changed-code failure remains after checking specialized dispatch, scale indexing, padding, and noop behavior. Reachable specialized shapes keep rowwise shared-memory accesses within their per-CTA scale storage, while padding initialization and noop-aware fallback preserve the existing output contract. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MXFP8 quantize request] --> B{Cast-only specialization supported?}
B -->|No| G[Generic quantization kernel]
B -->|Yes| C{Shape chunks and grid supported?}
C -->|No| G
C -->|Yes| D{Device noop pointer absent?}
D -->|No| G
D -->|Yes| E{GEMM-swizzled scales requested?}
E -->|No| F[Specialized compact-scale cast]
E -->|Yes| H[Specialized direct-swizzled cast]
H --> I[GEMM-ready FP8 data and scales]
F --> I
G --> I
Reviews (1): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
Collaborator
|
/te-ci |
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.
Produce GEMM-ready scales directly in the specialized cast-only kernels to avoid separate scale-swizzle launches while preserving generic fallbacks for unsupported shapes.
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: