From 2b7fcbf52782f8729fd6ce6c9ab803617d72897b Mon Sep 17 00:00:00 2001 From: Gabriel Wu <13583761+lucifer1004@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:25:29 +0800 Subject: [PATCH] [Kernel] SM120: stop routing misaligned-M blockwise FP8 GEMMs to the small-M swapAB config (#52775) Signed-off-by: Zihua Wu <13583761+lucifer1004@users.noreply.github.com> --- .../w8a8/cutlass/c3x/scaled_mm_blockwise_sm120_fp8_dispatch.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm120_fp8_dispatch.cuh b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm120_fp8_dispatch.cuh index a9008ce442..8795326250 100644 --- a/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm120_fp8_dispatch.cuh +++ b/csrc/libtorch_stable/quantization/w8a8/cutlass/c3x/scaled_mm_blockwise_sm120_fp8_dispatch.cuh @@ -250,7 +250,7 @@ void cutlass_gemm_blockwise_sm120_fp8_dispatch(torch::stable::Tensor& out, torch::stable::Tensor const& b_scales) { int M = a.size(0); // more heuristic tuning can be done here by checking N/K dimensions as well - bool swap_ab = (M <= 64) || (M % 4 != 0); + bool swap_ab = (M <= 64); if (!swap_ab) { if (M <= 256) {