Repository navigation
[release_v2.22] Backport compact MXFP8 scale safety (#3710) - #3970
Open
vthumbe1503 wants to merge 1 commit into
Open
vthumbe1503 wants to merge 1 commit into
vthumbe1503 wants to merge 1 commit into
Conversation
Backport NVIDIA#3710 without the activation-table changes from NVIDIA#3761. Preserve the release kernel signature and pass scale-row bounds through all three existing CUDA launches. Retain the independent CuTeDSL fallback guard. (cherry picked from commit 0c4a13f) Signed-off-by: zhaoye <772971548@qq.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Varun Thumbe <vthumbe@nvidia.com> Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
Contributor
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryBackports bounds checks and safe kernel selection for compact MXFP8 scale buffers.
No actionable issues were found. This review checked source code; it did not independently run GPU tests. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MXFP8 quantization request] --> B{CuTeDSL enabled and layout supported?}
B -->|Yes| C[CuTeDSL kernel]
B -->|No| D[CUDA scale shape checks]
D --> E{Specialized kernel requirements met?}
E -->|Yes| F[Specialized CUDA kernel]
E -->|No| G[Generic CUDA kernel with bounded scale writes]
C --> H[FP8 data and scales]
F --> H
G --> H
Reviews (2) · Last reviewed commit: "[Common] Backport compact MXFP8 scale sa..." · Reviewed by Greptile |
Collaborator
Author
|
/te-ci L0 |
fheinecke
approved these changes
Dec 1, 2026
7 of 13 tasks
Collaborator
Author
|
Pipeline: 86747956 |
vthumbe1503
marked this pull request as draft
December 1, 2026 01:53
vthumbe1503
marked this pull request as ready for review
December 1, 2026 01:54
ptrendx
approved these changes
Dec 1, 2026
This branch has not been deployed
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.
Backports #3710 to
release_v2.22without bringing in #3761.Compact unswizzled MXFP8 scale buffers can otherwise be written past their bounds, and unaligned scale views can reach vectorized stores that require alignment. This backport bounds generic scale stores, validates canonical scale widths, preserves dbias workspace queries, and sends unsupported layouts to the CUDA fallback. It includes the upstream C++ and PyTorch regression tests and C API documentation.
The release branch already has CuTeDSL MXFP8 dispatch, so the original 19-line fallback guard is retained. That guard applies independently of #3761; dropping it would leave compact or unaligned buffers exposed when CuTeDSL is enabled. The only release-specific adaptation is passing the new scale-row bounds through the release's three existing CUDA kernel launches, without adding activation-table parameters or functionality.
Source:
0c4a13f48b01bf2b06f9bcf4b3b44d2b3f5766b0(#3710).Release base:
539ec727fd68eed39053b5c9c7bd3565271bd142.Validation
Tested head:
8a15512b1c5f95b3f8f9f7cf16a4efde98e022c5.The unmodified release base fails the first new PyTorch regression case (
aligned-False-rowwise-dtype0-shape0, FP32, 32 x 256) by writing past the rowwise scale buffer. The backport passes the full compact-scale suites with both backend settings.All listed candidate runs completed successfully: 9,434 passing test executions, zero failures. Counts include rerunning suites with both backend settings. The unmodified-base failure above is the expected bug reproduction, not a candidate failure.
Skip reasons are existing suite restrictions: disabling CuTeDSL skips its 1,522-case Python suite (all 1,522 pass in the separate enabled run); the other 229 Python skips cover unsupported grouped warp-tile BF16/layout combinations and TMA scale strides. Each C++ run skips 1,198 inapplicable activation/method combinations, 288 grouped-dbias configurations with varying last dimensions, and 46 one-dimensional configurations not supported by those test paths.
Environment: one NVIDIA GB200 GPU (SM100), CUDA 13.5, PyTorch 2.16.0a0, Python 3.14, cuDNN 9.29.0 / Frontend 1.33.0, CUTLASS DSL 4.9.0.dev1, and TVM FFI 0.1.16. The common library and PyTorch extension were rebuilt from the tested checkout with
NVTE_WITH_CUTEDSL=1andNVTE_CUDA_ARCHS=100a. Tests toggleNVTE_ENABLE_CUTEDSL_BACKEND=0/1;NVTE_REPORT_IF_CUTEDSL_BACKEND_NOT_CHOSEN=ERRORis set.git diff --checkpasses; independent static review found no additional dependency.Focused test commands
Run from the built checkout, with the checkout's Python/native libraries on the import and library paths: