Skip to content

[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
poolside-cutlass-v4.4.2from
nvfp4-w4a8-v4.4.2
Draft

[draft] NVFP4 block-16 scale support for SM90 mixed-input grouped GEMM (CUTLASS 4.4.2)#1
changjonathanc wants to merge 2 commits into
poolside-cutlass-v4.4.2from
nvfp4-w4a8-v4.4.2

Conversation

@changjonathanc

Copy link
Copy Markdown

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

  • Base branch poolside-cutlass-v4.4.2: NVIDIA CUTLASS v4.4.2 + an existing shared-memory workaround for an unnecessary TensorMapStorage allocation (cherry-picked).
  • This PR (two headers): the NVFP4 block-16 mixed-input patch. All new behaviour is gated by 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-column SmemLayoutAtomScale; relaxed static_assert;
grouped-GEMM init clamp; explicit StrideScale; relaxed can_implement chunk-size check.
mixed_input_utils.hpp: UseNvfp4Block16ScaleBroadcast + get_mma_smem_layout_scale()
broadcast view; refresh scales every k-block when multi-column.

changjonathanc and others added 2 commits June 9, 2026 15:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant