Skip to content

Fix CK FP8 grouped GEMM dtype gating for columnwise operands#594

Open
aris134 wants to merge 9 commits into
devfrom
amartin/ck-fp8-tuning
Open

Fix CK FP8 grouped GEMM dtype gating for columnwise operands#594
aris134 wants to merge 9 commits into
devfrom
amartin/ck-fp8-tuning

Conversation

@aris134
Copy link
Copy Markdown
Contributor

@aris134 aris134 commented May 21, 2026

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

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

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:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@aris134 aris134 requested review from matthiasdiener and sudhu2k May 21, 2026 03:52
@aris134 aris134 self-assigned this May 21, 2026
@aris134 aris134 added the ci-level 1 CI test level 1 label May 21, 2026
@aris134 aris134 marked this pull request as ready for review May 27, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-level 1 CI test level 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant