]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
tests : add -INF blocks to the KQ mask in the FA tests (llama/16380)
authorGeorgi Gerganov <redacted>
Tue, 7 Oct 2025 05:22:35 +0000 (08:22 +0300)
committerGeorgi Gerganov <redacted>
Sun, 12 Oct 2025 08:16:23 +0000 (11:16 +0300)
* tests : add -INF blocks to the KQ mask in the FA tests

* cont : bump -INF block size to 64

Co-authored-by: Jeff Bolz <redacted>
* ggml : prevent division by zero in FA CPU op

---------

Co-authored-by: Jeff Bolz <redacted>
ggml/src/ggml-cpu/ops.cpp

index 6275c8305a971336a0eda39daacac61a75530382..8e1a2de14f9833163489cfab24eb39b8d3195e95 100644 (file)
@@ -8135,7 +8135,7 @@ static void ggml_compute_forward_flash_attn_ext_f16(
         }
 
         // V /= S
-        const float S_inv = 1.0f/S;
+        const float S_inv = S == 0.0f ? 0.0f : 1.0f/S;
         ggml_vec_scale_f32(DV, VKQ32, S_inv);
 
         // dst indices