Add row-scale support to grouped GEMM quant - #251
Conversation
|
@cudnn-ci-bot run |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-251-dee5400 |
dee5400 to
ec7924d
Compare
|
Thanks for the PR @zianglih, I have launched an internal review. I will let you know on its progress. |
Signed-off-by: Ziang Li <ziangli@umich.edu>
ec7924d to
8a9bbb4
Compare
Signed-off-by: Ziang Li <ziangli@umich.edu>
|
@cudnn-ci-bot run |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-251-55ae251 |
saltyminty
left a comment
There was a problem hiding this comment.
Approved but please see above comment about dynamic shapes.
| stride=self.prob_desc.stride, | ||
| assumed_align=16, | ||
| ) | ||
| row_scale_tensor = self._make_fake_cute_tensor_from_desc(self.row_scale_desc, assumed_align=16) |
There was a problem hiding this comment.
I believe the fake tensor needs to also be constructed with symbolic valid_m as the 0th dimension, similar to prob_tensor above.
|
Follow-up from validating the row-scale integration in NVIDIA/TransformerEngine#3042 on B200: The
With those conversions applied temporarily, the cuDNN discrete FP4 row-scale control and all 8 focused TE integration cases pass. The TE PR intentionally includes no scheduler workaround or fallback and remains draft pending a cuDNN-side fix. |
Summary
@HumansAnd
Add an optional
row_scale_tensorinput to the SM100 grouped GEMM quant path. The new tensor is a contiguous FP32 vector with one scale per valid output row. When provided, the epilogue multiplies FP32 accumulators byalpha[expert] * row_scale[m]before output conversion.This is intended for integrations that need an additional per-row accumulator scale, such as row-scaled NVFP4. The immediate motivation is TransformerEngine's row-scaled NVFP4 work in NVIDIA/TransformerEngine#2931. The kernel treats
row_scale_tensoras an epilogue multiplier and does not interpret how the caller produced those values.The existing bias and probability semantics are preserved: the row scale applies only to the accumulator path, while fused bias keeps the existing
bias * probbehavior.Changes
sample_row_scale/row_scale_tensorplumbing toGroupedGemmQuantSm100.Validation
Current upstream-facing branch:
python3 -m py_compile python/cudnn/grouped_gemm/grouped_gemm_quant/api.py python/cudnn/grouped_gemm/grouped_gemm_quant/grouped_gemm_quant.py python/cudnn/grouped_gemm/moe_sched_extension.py test/python/fe_api/test_grouped_gemm_quant.py test/python/fe_api/test_grouped_gemm_quant_utils.pygit diff --check upstream/develop...HEADpython3 -m pytest -q test/python/fe_api/test_grouped_gemm_quant.py -k row_scale --tb=short->5 passed, 309 deselectedNotes:
pre-commit run --all-filesis unavailable in this checkout because.pre-commit-config.yamlis not present.