From: Zhenwei Jin Date: Mon, 2 Sep 2024 17:53:23 +0000 (+0800) Subject: src: make tail invalid when kv cell is intersection for mamba (#9249) X-Git-Tag: upstream/0.0.4488~829 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=f1485161e58d562099dd050f8ac3a9ea9f4cd765;p=pkg%2Fggml%2Fsources%2Fllama.cpp src: make tail invalid when kv cell is intersection for mamba (#9249) --- diff --git a/src/llama.cpp b/src/llama.cpp index 4e203471..88355971 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -3810,7 +3810,8 @@ static bool llama_kv_cache_seq_rm( if ((0 < p0 && p0 <= cell.pos) || (0 < p1 && p1 <= cell.pos)) { return false; } - if (p0 <= cell.pos && p1 < cell.pos) { + // invalidate tails which will be cleared + if (p0 <= cell.pos && cell.pos < p1) { tail_id = -1; } }