Files
tilelang/testing/python/amd
sijieli2 9d819c3fc3 [BugFix] Fix MFMA DataType args causing compilation failure on ROCm (#2726)
Fix MFMA dtype args passed as DataType instead of str

When local_size is 1, compute_a_dtype/compute_b_dtype/compute_out_dtype
are assigned directly from self.a_dtype etc., which are tvm_ffi DataType
objects (a str subclass). The TVM FFI C++ layer dispatches DataType before
str in its type conversion, so these never get auto-converted to StringImm
(a PrimExpr). This causes MFMA GEMM compilation to fail on ROCm with:

  TypeError: Expected Array<ir.PrimExpr> but got Array[index 3: DataType]

The bug only triggers when local_size == 1 (e.g. float32 GEMM), because
when local_size > 1 the f-string produces a plain str.

Fix: convert dtype attrs to str() before building compute dtype strings.

Add test: testing/python/amd/test_mfma_dtype_str_bug.py
2026-07-22 16:28:11 +08:00
..