Repository navigation
[Common] Requantize grouped MXFP8 tensors with 128x128 tiles - #3656
Merged
phu0ngng merged 3 commits intoOct 9, 2026
Merged
Conversation
nvte_group_requantize turns a row-wise MXFP8 grouped tensor, such as tokens dispatched in FP8, into its column-wise copy with GEMM-swizzled scaling factors. Its kernel runs one 32x128 tile per 128-thread CTA, binary-searches the group offsets in thread 0 before the tile can finish, and writes both scale outputs one byte at a time; on a capacity-sized buffer every tile past the live rows still costs a CTA. Add a kernel for the fast-math case without a dequantized output, the case the grouped MLP uses. A CTA owns a 128x128 tile and keeps it in registers, loading and storing coalesced 128-byte row segments; each swizzled scale output is one contiguous 512-byte block per tile; and the CTAs of a persistent grid walk the tiles in row-block order, so they stop at the first tile past the live rows. The arithmetic is that of the existing kernel and the outputs are bit-identical. Other cases keep the existing kernel. Signed-off-by: Siddhartha Raman S <sraman@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Collaborator
|
/te-ci L1 Pytorch |
Collaborator
|
/te-ci |
phu0ngng
approved these changes
Oct 9, 2026
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.
nvte_group_requantize turns a row-wise MXFP8 grouped tensor, such as tokens dispatched in FP8, into its column-wise copy with GEMM-swizzled scaling factors. Its kernel runs one 32x128 tile per 128-thread CTA, binary-searches the group offsets in thread 0 before the tile can finish, and writes both scale outputs one byte at a time; on a capacity-sized buffer every tile past the live rows still costs a CTA.
Add a kernel for the fast-math case without a dequantized output, the case the grouped MLP uses. A CTA owns a 128x128 tile and keeps it in registers, loading and storing coalesced 128-byte row segments; each swizzled scale output is one contiguous 512-byte block per tile; and the CTAs of a persistent grid walk the tiles in row-block order, so they stop at the first tile past the live rows. The arithmetic is that of the existing kernel and the outputs are bit-identical. Other cases keep the existing kernel.
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: