Use cuDNN for row-scaled NVFP4 grouped GEMM#3042
Draft
zianglih wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Ziang Li <ziangli@umich.edu>
Signed-off-by: Ziang Li <ziangli@umich.edu>
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
Required dependency
This PR explicitly requires the corresponding cuDNN Frontend feature in NVIDIA/cudnn-frontend#251. It requires a cudnn-frontend version whose
cudnn.grouped_gemm_quant_wrapper_sm100(...)acceptsrow_scale_tensor; without that cudnn-fe PR feature, this TransformerEngine PR is expected to fail on the row-scaled grouped GEMM path.Motivation
Related to the row-scaled NVFP4 work in #2931. This PR is intended to land only after TransformerEngine can depend on a cudnn-fe version containing the row-scaled grouped GEMM quant feature.
Validation
python3 -m py_compile transformer_engine/pytorch/cpp_extensions/gemm.py tests/pytorch/nvfp4/test_nvfp4_gemm_exact.pygit diff --check -- transformer_engine/pytorch/cpp_extensions/gemm.py tests/pytorch/nvfp4/test_nvfp4_gemm_exact.pypre-commit run --all-filesrow_scale_tensoris ingrouped_gemm_quant_wrapper_sm100NVTE_FRAMEWORK=pytorch NVTE_CUDA_ARCHS=100a MAX_JOBS=4pytest -q tests/pytorch/nvfp4/test_nvfp4_gemm_exact.py::test_nvfp4_row_scaled_grouped_gemm_uses_cudnn_quant_wrapper --tb=shortpassed: 2 passedtest_nvfp4_row_scaled_grouped_gemm_matches_per_gemm[mae_err-default-single_output-no_bias-torch.bfloat16-torch.bfloat16-torch.bfloat16-m_splits4-1024-1024]test_nvfp4_row_scaled_grouped_gemm_matches_per_gemm[mae_err-default-list_output-no_bias-torch.float32-torch.float32-torch.float32-m_splits0-128-128]python3 -m pylint transformer_engine/pytorch/cpp_extensions/gemm.pypassed: 10.00/10