From f590564bf72af1f456e6b29623e09274daae60bf Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Tue, 17 Feb 2026 13:00:02 +0800 Subject: [PATCH] gemm multiple is only for cdna4 asm (#14814) * gemm multiple is only for cdna4 asm * move to backend * and arch * path --- .github/workflows/test.yml | 2 +- extra/gemm/asm/cdna/gemm.py | 2 +- test/{testextra => backend}/test_asm_gemm.py | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename test/{testextra => backend}/test_asm_gemm.py (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ccf1d1d74..8213b1cc9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -658,7 +658,7 @@ jobs: AMD: 0 run: | PYTHONPATH=. NULL=1 EMULATE=AMD python extra/mmapeak/mmapeak.py - PYTHONPATH=. NULL=1 EMULATE=AMD_CDNA4 python3 -m pytest -n=auto test/testextra/test_tk.py test/testextra/test_asm_gemm.py + PYTHONPATH=. NULL=1 EMULATE=AMD_CDNA4 python3 -m pytest -n=auto test/testextra/test_tk.py test/backend/test_asm_gemm.py - name: Run ASM matmul on MOCKGPU run: PYTHONPATH="." AMD=1 MOCKGPU=1 N=256 python3 extra/gemm/amd_asm_matmul.py - name: Run LLVM test diff --git a/extra/gemm/asm/cdna/gemm.py b/extra/gemm/asm/cdna/gemm.py index 547e133e46..2b569f0d9e 100644 --- a/extra/gemm/asm/cdna/gemm.py +++ b/extra/gemm/asm/cdna/gemm.py @@ -42,7 +42,7 @@ def can_use_asm_gemm(a:Tensor, b:Tensor) -> bool: else: dname = a.device arch = getattr(Device[dname].renderer, "arch", "") if batch not in {1, 2}: return todo(f"GEMM batch size {batch}") - if M % TILE_M != 0 or N % TILE_N != 0 or K % TILE_K != 0: + if (M % TILE_M != 0 or N % TILE_N != 0 or K % TILE_K != 0) and arch == "gfx950": return todo(f"GEMM shape ({M},{N},{K}) not a multiple of ({TILE_M},{TILE_N},{TILE_K})") return True diff --git a/test/testextra/test_asm_gemm.py b/test/backend/test_asm_gemm.py similarity index 100% rename from test/testextra/test_asm_gemm.py rename to test/backend/test_asm_gemm.py