[CK Tile] UniversalGemmKernel silently rejects D tensors whose layout differs from CLayout

未關閉
#3,766 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
38/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cpp

研究方向

Start with universal_gemm_kernel.hpp:581-584 and cshuffle_epilogue.hpp:782, then compare the legacy GridwiseGemmMultiD row/column scale handling and the QuantGemmKernel RowColQuant path. Use a CK_TILE_LOGGING run to observe the current rejection. Done means either the D layout is supported in the CShuffle epilogue, the rejection identifies the D index and layout, or the supported RowColQuant route is documented.

由索引模型根據 Issue 內容生成。

描述

universal_gemm_kernel.hpp:581-584 rejects any D tensor whose layout is not CLayout — and does so silently: no log line, no assert message, the kernel simply does not run. Localizing it took a CK_TILE_LOGGING run plus a source read.

This blocks a natural and otherwise-supported composition: a weight-preshuffled GEMM plus a per-token/per-channel scale epilogue, expressed as two broadcast D tensors —

  • D0 = per-token A scale: an M-vector, ColumnMajor, stride 0 in N
  • D1 = per-channel B scale: an N-vector, RowMajor, stride 0 in M

D1 is accepted; D0 is not, because its layout differs from CLayout. Independently, cshuffle_epilogue.hpp:782 wraps every D window with the (M, N) distribution and has no handling for a column-layout D.

This is exactly the architecture CK's own legacy XDL path ships (GridwiseGemmMultiD with row/col scale Ds), so the operation is well-precedented; only the CK Tile universal path can't express it.

Asks, in increasing order of effort:

  1. make the rejection loud (a static_assert message or a log line naming the offending D index and layout);
  2. relax the check and add column-layout D distribution handling in the CShuffle epilogue;
  3. or, if RowColQuant is the intended route for this shape of problem, document that — it works (see the QuantGemmKernel RowColQuant path) and it is not obvious from the examples.

Context: found while wiring per-token/per-channel FP8 GEMMs on gfx950; the RowColQuant + weight-preshuffle route works and measured +8-11% over the flatmm path at three GEMM shapes, so the composition is worth having.

主要語言
C++
星號
552
分支
316
平均合併
3 天 14 小時
30 天內合併 PR
2

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ROCm/composable_kernel 的其他 Issue

查看 ROCm/composable_kernel 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。