]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
src: make tail invalid when kv cell is intersection for mamba (#9249)
authorZhenwei Jin <redacted>
Mon, 2 Sep 2024 17:53:23 +0000 (01:53 +0800)
committerGitHub <redacted>
Mon, 2 Sep 2024 17:53:23 +0000 (13:53 -0400)
src/llama.cpp

index 4e203471ce724586c4bc79691ae2a86af8cdcb60..883559716a4cb1b6c8666746c75aae9b528d4058 100644 (file)
@@ -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;
                 }
             }