]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
kv-cache : extend cache quantization checks (#21586)
authorErik Scholz <redacted>
Wed, 8 Apr 2026 13:08:57 +0000 (15:08 +0200)
committerGitHub <redacted>
Wed, 8 Apr 2026 13:08:57 +0000 (16:08 +0300)
to also check for enabled flash attention, instead of just auto.

src/llama-context.cpp

index a808e3e454294d3a15593409c423933eae231dad..cf29bad8eaaefc156230d5fbf518445b230857db 100644 (file)
@@ -2942,7 +2942,7 @@ llama_context * llama_init_from_model(
         params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_DISABLED;
     }
 
-    if (params.flash_attn_type == LLAMA_FLASH_ATTN_TYPE_AUTO && ggml_is_quantized(params.type_k)) {
+    if (params.flash_attn_type != LLAMA_FLASH_ATTN_TYPE_DISABLED && ggml_is_quantized(params.type_k)) {
         const uint32_t blck_size = ggml_blck_size(params.type_k);
         for (uint32_t il = 0; il < model->hparams.n_layer; ++il) {
             if (model->hparams.n_embd_head_k(il) % blck_size != 0) {
@@ -2953,7 +2953,7 @@ llama_context * llama_init_from_model(
         }
     }
 
-    if (params.flash_attn_type == LLAMA_FLASH_ATTN_TYPE_AUTO && ggml_is_quantized(params.type_v)) {
+    if (params.flash_attn_type != LLAMA_FLASH_ATTN_TYPE_DISABLED && ggml_is_quantized(params.type_v)) {
         const uint32_t blck_size = ggml_blck_size(params.type_v);
         for (uint32_t il = 0; il < model->hparams.n_layer; ++il) {
             if (model->hparams.n_embd_head_v(il) % blck_size != 0) {