From d2c9fdddcb9ed2884fc75e1be7d505088cd93a83 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 25 Aug 2025 11:06:48 +0800 Subject: [PATCH] old gpu fattn fix --- ggml/src/ggml-cuda/fattn.cu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ggml/src/ggml-cuda/fattn.cu b/ggml/src/ggml-cuda/fattn.cu index 3440ed287..f8b492f8c 100644 --- a/ggml/src/ggml-cuda/fattn.cu +++ b/ggml/src/ggml-cuda/fattn.cu @@ -415,6 +415,11 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const return BEST_FATTN_KERNEL_WMMA_F16; } + //kcpp: always force WMMA for older gpus, fix issues like "FlashAttention without tensor cores only supports head sizes 64 and 128." + if (ggml_cuda_highest_compiled_arch(cc) <= GGML_CUDA_CC_TURING || cc == GGML_CUDA_CC_TURING) { + return BEST_FATTN_KERNEL_WMMA_F16; + } + // If there is no suitable kernel for tensor cores or small batch sizes, use the generic kernel for large batch sizes: if (prec == GGML_PREC_DEFAULT && fast_fp16_available(cc)) { return BEST_FATTN_KERNEL_TILE_F16;