Support FP32 output and dynamic M in row-scaled FP4 grouped GEMM - #461
Conversation
📝 WalkthroughWalkthroughThe change enables additional discrete grouped GEMM quantization configurations. It adds validation for weight layouts, conditional row-scale tensor creation, expanded cache and wrapper test coverage, fused bias cases, and empty-group reference handling. ChangesGrouped GEMM quantization
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@cudnn-ci-bot run |
|
Backend pipeline not launched Reason: PR base branch 'main' does not match 'develop' |
|
Thanks @zianglih for the contribution. |
|
@cudnn-ci-bot run |
|
Backend pipeline not launched Reason: PR base branch 'main' does not match 'develop' |
8313835 to
aefe2c4
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Compile discrete row scaling with symbolic M so cached kernels can serve changing token counts. Cover the TransformerEngine K64/N256 path for BF16 and FP32 outputs with and without bias. Signed-off-by: Ziang Li <ziangli@umich.edu>
aefe2c4 to
0444d32
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
@cudnn-ci-bot run |
|
@cudnn-ci-bot run oss |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-461-0444d32 |
Summary
@HumansAnd
Extend the SM100 grouped GEMM quant path added in #251 so row-scaled NVFP4 integrations can use a unified cuDNN backend for the full shape and output-dtype matrix exercised by NVIDIA/TransformerEngine#3042.
Two frontend limitations blocked that integration:
row_scale_tensorto the first runtime M. Its cache key intentionally treats M as dynamic, so reusing the cached kernel with another token count failed tensor-shape validation.Logical K=64 is already supported by the Blackwell kernel. This change adds exact production-path coverage for K=64, N=256 rather than introducing padding or another backend.
Changes
-infinitialization.Validation
python3 -m py_compile python/cudnn/gemm/cutedsl/grouped/quant/api.py test/python/fe_api/grouped_gemm/test_grouped_gemm_quant.py test/python/fe_api/grouped_gemm/test_grouped_gemm_quant_utils.pypre-commit run --files python/cudnn/gemm/cutedsl/grouped/quant/api.py test/python/fe_api/grouped_gemm/test_grouped_gemm_quant.py test/python/fe_api/grouped_gemm/test_grouped_gemm_quant_utils.py docs/fe-oss-apis/gemm_fusions/grouped_gemm_quant.md-> passed--queue helldevbox using the exact editable cuDNN Frontend 1.27.0 checkout, CUTLASS DSL 4.6.0, CUDA 13.0, and cuDNN 9.22:python3 -m pytest -q test/python/fe_api/grouped_gemm/test_grouped_gemm_quant.py -k 'discrete_wrapper_fp4_row_scale_small_k or discrete_wrapper_cache_dynamic_m_row_scale'5 passed, 315 deselectedpython3 -m pytest -q test/python/fe_api/grouped_gemm/test_grouped_gemm_quant.py::test_grouped_gemm_quant_discrete_compile_execute_fp4_row_scale test/python/fe_api/grouped_gemm/test_grouped_gemm_quant.py::test_grouped_gemm_quant_discrete_wrapper_fp4_row_scale2 passed14 passed17266 passed, 33922 skipped, 4 warningsNotes
pre-commit run --all-fileswas also attempted. Current hooks rewrote pre-existing vendored, benchmark, and notebook files outside this change; those unrelated rewrites were restored. All hooks for the changed files pass.Summary by CodeRabbit
New Features
Bug Fixes
Tests