[draft] NVFP4 block-16 scale support for SM90 mixed-input grouped GEMM (CUTLASS 4.4.2)#2
Draft
changjonathanc wants to merge 1 commit into
Draft
[draft] NVFP4 block-16 scale support for SM90 mixed-input grouped GEMM (CUTLASS 4.4.2)#2changjonathanc wants to merge 1 commit into
changjonathanc wants to merge 1 commit into
Conversation
Adds optional NVFP4 (e2m1 + e4m3-scale) block-16 scaling to the SM90 mixed-input collectives for weight-scaled W4A8 grouped GEMM (scale block 16 < GMMA K tile). Gated by UseNvfp4Block16Scales/Broadcast (false for all existing instantiations, so existing kernels are byte-for-byte unaffected). Base: CUTLASS v4.4.2 + TensorMapStorage workaround. 4.4.2 is required: its mixed-input GEMM is ~5x faster than 4.3.5, making W4A8 ~2x faster than Marlin at large batch.
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.
Redo of #1 on a CUTLASS 4.4.2 base (the original #1 targeted 4.3.5).
Why 4.4.2 (not 4.3.5)
Measured on H200 with the Colonels W4A8 MoE kernel (capture-replay, isolated, locked-clock):
4.4.2's mixed-input grouped GEMM is ~5.3x faster than 4.3.5's. On 4.4.2 the W4A8 path
is ~2x faster than Marlin W4A16 at large batch (matching the kernel-benchmark premise); on
4.3.5 it is ~2.6x slower — i.e. building W4A8 against 4.3.5 is a net regression. So the
fork base must be 4.4.2.
Contents
poolside-cutlass-v4.4.2: NVIDIA CUTLASS v4.4.2 + the existing poolsideTensorMapStorage shared-memory workaround (cherry-picked from the 4.3.5 fork branch).
is gated by
UseNvfp4Block16Scales/Broadcast, false for every existing instantiation, soexisting kernels are byte-for-byte unaffected.
sm90_mma_array_tma_gmma_rs_warpspecialized_mixed_input.hpp:UseNvfp4Block16Scales/ScaleAtomM/ScaleAtomK; multi-columnSmemLayoutAtomScale; relaxedstatic_assert;grouped-GEMM init clamp; explicit
StrideScale; relaxedcan_implementchunk-size check.mixed_input_utils.hpp:UseNvfp4Block16ScaleBroadcast+get_mma_smem_layout_scale()broadcast view; refresh scales every k-block when multi-column.
Supersedes #1. The Colonels/Forge W4A8 extension builds against this branch.
🤖 Generated with Claude Code