[draft] NVFP4 block-16 scale support for SM90 mixed-input grouped GEMM (CUTLASS 4.4.2)#1
Draft
changjonathanc wants to merge 2 commits into
Draft
[draft] NVFP4 block-16 scale support for SM90 mixed-input grouped GEMM (CUTLASS 4.4.2)#1changjonathanc wants to merge 2 commits into
changjonathanc wants to merge 2 commits 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.
Fold the duplicated 'chunk_size != 0' guard and the nested predicate into a single named condition; extract tile_k. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds optional NVFP4 (e2m1 data + e4m3 scale) block-16 scaling to the SM90 warp-specialized mixed-input grouped GEMM, so a weight-scaled W4A8 grouped GEMM works when the scale block size (16) is smaller than the GMMA K tile. All new behaviour is gated by
UseNvfp4Block16Scales/UseNvfp4Block16ScaleBroadcast, which are false for every pre-existing instantiation — so existing kernels are byte-for-byte unaffected.Targets the CUTLASS 4.4.2 base branch (
poolside-cutlass-v4.4.2).Why 4.4.2 (not 4.3.5)
Measured on H200 with a mixed-input W4A8 MoE grouped GEMM (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 a Marlin W4A16 baseline at large batch; 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 + an existing shared-memory workaround for an unnecessaryTensorMapStorageallocation (cherry-picked).UseNvfp4Block16Scales/UseNvfp4Block16ScaleBroadcast, false for every existing instantiation, so existing 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.