From 3a8d954e0cd293a5f93ffcad94a911a7f6dd1a0f Mon Sep 17 00:00:00 2001 From: Jeff Bolz Date: Tue, 6 May 2025 23:08:39 -0500 Subject: [PATCH] vulkan: always use fp32 for scalar flash attention --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index 1b866253b..5bda2ee13 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -5726,9 +5726,9 @@ static void ggml_vk_flash_attn(ggml_backend_vk_context * ctx, vk_context& subctx assert(k->type == v->type); vk_pipeline *pipelines; - // XXX TODO other backends may be changing accumulator precision to default to f32 soon - bool f32acc = dst->op_params[3] == GGML_PREC_F32; bool scalar = !ctx->device->coopmat2; + // XXX TODO other backends may be changing accumulator precision to default to f32 soon + bool f32acc = scalar || dst->op_params[3] == GGML_PREC_F32; bool small_rows = N <= get_fa_num_small_rows(scalar); if (scalar) {