Fix CK FP8 grouped GEMM dtype gating for columnwise operands#594
Open
aris134 wants to merge 9 commits into
Open
Fix CK FP8 grouped GEMM dtype gating for columnwise operands#594aris134 wants to merge 9 commits into
aris134 wants to merge 9 commits into
Conversation
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.
Description
During an E2E Qwen Megatron run, it was observed that certain FP8 grouped GEMM WGRAD paths were unexpectedly falling back from CK grouped GEMM to multi-stream hipBLASLt grouped GEMM. Further investigation showed that the CK backend was incorrectly rejecting certain FP8 WGRAD GEMMs due to dtype gating assuming row-wise tensor storage rather than the effective canonicalized operand.
This commit fixes the FP8 grouped GEMM dtype gating logic to use the effective operand dtype after canonicalization, eliminating erroneous fallback for columnwise FP8 operands. Additionally, this commit introduces support for FP8 padding when required to satisfy kernel requirements. Finally, this commit adds shape specialization for fully aligned operands.
Observed fallback warnings:
Number of fallback warnings originally: 7680
Number of fallback warnings after applying the fix from this PR: 960
Remaining fallbacks are due to lack of fp8 accumulate support.
These changes substantially reduce unintended fallback behavior in FP8 grouped GEMM execution paths while improving handling of padded FP8 grouped GEMM configurations.
Fixes # (16708)
Type of change
Optimizations attempted but excluded:
CK Pipeline changes (i.e., compute V3 --> V4 with double-buffered ping-pong). This change consistently resulted in considerable performance degradation.
Tried a larger tile (256x256x128) with k-padding, which also reduced performance.
Changes
Please list the changes introduced in this PR:
Checklist: