Skip to content

Commit 4e8f9a0

Browse files
committed
src: make tail invalid when kv cell is intersection for mamba
1 parent 7ea8d80 commit 4e8f9a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llama.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,8 @@ static bool llama_kv_cache_seq_rm(
36893689
if ((0 < p0 && p0 <= cell.pos) || (0 < p1 && p1 <= cell.pos)) {
36903690
return false;
36913691
}
3692-
if (p0 <= cell.pos && p1 < cell.pos) {
3692+
// invalidate tails which will be cleared
3693+
if (p0 <= cell.pos && cell.pos < p1) {
36933694
tail_id = -1;
36943695
}
36953696
}

0 commit comments

Comments
 (0)