diff --git a/llama.cpp b/llama.cpp index a7d53d890..ff467c575 100644 --- a/llama.cpp +++ b/llama.cpp @@ -9036,7 +9036,7 @@ static int llama_decode_internal( //llama_synchronize(&lctx); // decide if we need to defrag the kv cache - if (cparams.defrag_thold >= 0.0f) { + if (cparams.causal_attn && cparams.defrag_thold >= 0.0f) { const float fragmentation = kv_self.n >= 128 ? 1.0f - float(kv_self.used)/float(kv_self.n) : 0.0f; // queue defragmentation for next llama_kv_cache_update