From e6ad29341b11eaa94b4b8f1f3464c8a4329c5bac Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Thu, 27 Nov 2025 01:02:19 +0800 Subject: [PATCH] disable FA for clip test --- ggml/src/ggml-cuda/fattn-wmma-f16.cu | 6 +++--- ggml/src/ggml-cuda/fattn.cu | 7 ++++++- gpttype_adapter.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ggml/src/ggml-cuda/fattn-wmma-f16.cu b/ggml/src/ggml-cuda/fattn-wmma-f16.cu index f7981ceb5..f8f8a33ad 100644 --- a/ggml/src/ggml-cuda/fattn-wmma-f16.cu +++ b/ggml/src/ggml-cuda/fattn-wmma-f16.cu @@ -612,7 +612,7 @@ void ggml_cuda_flash_attn_ext_wmma_f16(ggml_backend_cuda_context & ctx, ggml_ten ggml_cuda_flash_attn_ext_wmma_f16_case<256, cols_per_block, half>(ctx, dst); break; default: - GGML_ABORT("fatal error"); + GGML_ABORT("fatal error: %d", Q->ne[0]); break; } return; @@ -641,7 +641,7 @@ void ggml_cuda_flash_attn_ext_wmma_f16(ggml_backend_cuda_context & ctx, ggml_ten ggml_cuda_flash_attn_ext_wmma_f16_case<256, cols_per_block, half>(ctx, dst); break; default: - GGML_ABORT("fatal error"); + GGML_ABORT("fatal error: %d",Q->ne[0]); break; } return; @@ -668,7 +668,7 @@ void ggml_cuda_flash_attn_ext_wmma_f16(ggml_backend_cuda_context & ctx, ggml_ten ggml_cuda_flash_attn_ext_wmma_f16_case<256, cols_per_block, half>(ctx, dst); break; default: - GGML_ABORT("fatal error"); + GGML_ABORT("fatal error: %d",Q->ne[0]); break; } } diff --git a/ggml/src/ggml-cuda/fattn.cu b/ggml/src/ggml-cuda/fattn.cu index 4c96dab47..4928f3902 100644 --- a/ggml/src/ggml-cuda/fattn.cu +++ b/ggml/src/ggml-cuda/fattn.cu @@ -322,7 +322,12 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const //kcpp: always force WMMA for Turing and Volta if above check fails, fix "FlashAttention without tensor cores only supports head sizes 64 and 128." if (cc == GGML_CUDA_CC_TURING || cc == GGML_CUDA_CC_VOLTA) { - return BEST_FATTN_KERNEL_WMMA_F16; + if(Q->ne[0] != 40 && Q->ne[0] != 72 && Q->ne[0] != 576) //kcpp: these sizes not supported in wmma + { + return BEST_FATTN_KERNEL_WMMA_F16; + } else { + return BEST_FATTN_KERNEL_NONE; + } } //kcpp: patch from previous version for my sanity. it worked before, idk it should work now. if (Q->ne[1] <= 8 || Q->ne[0] == 256) { diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 9df8a4178..aacc29222 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -2470,7 +2470,7 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in } clip_context_params ctx_clip_params { /* use_gpu */ true, - /* flash_attn_type */ (kcpp_data->flash_attn?CLIP_FLASH_ATTN_TYPE_ENABLED:CLIP_FLASH_ATTN_TYPE_DISABLED), + /* flash_attn_type */ CLIP_FLASH_ATTN_TYPE_DISABLED, /* image_min_tokens */ -1, /* image_max_tokens */ -1, };