[KERNELS] Fix Blackwell NVFP4 x dense matmul tile selection - #11171
Open
amyyang-openai wants to merge 3 commits into
Open
[KERNELS] Fix Blackwell NVFP4 x dense matmul tile selection#11171amyyang-openai wants to merge 3 commits into
amyyang-openai wants to merge 3 commits into
Conversation
amyyang-openai
marked this pull request as ready for review
August 5, 2026 19:06
lyu-oai
approved these changes
Aug 6, 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.
Summary
block_n <= 128rule to NVFP4 activation × dense BF16/FP16 matmuls with 16-element activation microblocksblock_kand eight-warp selection remain untouchedRoot cause
For routed
M=256, N=256, K=128NVFP4 activation × dense BF16/FP16 weight matmuls with Blackwell-swizzled activation scales, upstreammainselectsBLOCK_M=128, BLOCK_N=256, BLOCK_K=256, num_warps=8. The persistent dot requires 640 tensor-memory columns, exceeding Blackwell's 512-column limit:The existing dense-RHS safeguard only recognizes 32-element MXFP activation microblocks; NVFP4 uses 16-element microblocks. Add a separate narrowly scoped predicate for Blackwell FP4 activations with 16-element microscaling, no RHS/output microscaling, and a BF16/FP16 RHS. Use that predicate only for the persistent
block_nsafety clamp. It deliberately does not participate in the existing MXFPblock_kornum_warpsdecisions, yielding the safe128 × 128 × 256, four-warp NVFP4 configuration.Validation
Base:
df7fa7bd086c01e2fdc91bd39676d02511b783f3(upstreammain, 2026-08-04).Before the fix, reproduced the exact
Required: 640, Hardware limit: 512exception for both BF16 and FP16 on both actual GPU generations.xenon-02-27/rl-scaling128 × 128 × 2560.00.0xenon-02-27/rl-scaling128 × 128 × 2560.007142842.79104e-5f60/mlexec128 × 128 × 2560.00.0f60/mlexec128 × 128 × 2560.007142842.79104e-5On each GPU:
CPU/interpreter coverage:
7 passed, 8 skipped. One focused, parameterized routed NVFP4 × BF16/FP16 Blackwell execution test covers the failure end to end. Explicit planner constraints, existing MXFP behavior, Hopper behavior, and the large routed NVFP4 × NVFP4 specialization remain unchanged.