Skip to content

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

Draft
aris134 wants to merge 5 commits into
devfrom
amartin/ck-fp8-tuning
Draft

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

Conversation

@aris134
Copy link
Copy Markdown
Contributor

@aris134 aris134 commented May 21, 2026

Description

E2E Qwen benchmarking initially suggested that multi-stream hipBLASLt grouped GEMM was outperforming CK FP8 grouped GEMM. Further investigation showed that the CK backend was incorrectly rejecting certain FP8 WGRAD GEMMs due to dtype gating using raw tensor storage rather than the effective canonicalized operand (e.g. columnwise FP8 data used in delayed scaling backward paths). This caused unintended fallback to hipBLASLt grouped GEMM in affected cases.

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 simple shape specialization heuristics based on N/K sizes for CK Tile FP8 grouped GEMM dispatch.

After applying the dtype gating fix, rerunning the benchmark sweep (see https://github.com/ROCm/frameworks-internal/issues/16708#issuecomment-4504614857) with fallback warnings enabled (NVTE_CUTLASS_GROUPED_GEMM_WARN_FALLBACK=1) produced no grouped GEMM fallback warnings in the tested CK FP8 paths.

Benchmark results and benchmarking script found here: https://github.com/ROCm/frameworks-internal/issues/16708#issuecomment-4504614857

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

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
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