Skip to content

Commit e187119

Browse files
kylo5abydsx1986
authored andcommitted
src: make tail invalid when kv cell is intersection for mamba (ggml-org#9249)
1 parent 0a45368 commit e187119

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
@@ -3810,7 +3810,8 @@ static bool llama_kv_cache_seq_rm(
38103810
if ((0 < p0 && p0 <= cell.pos) || (0 < p1 && p1 <= cell.pos)) {
38113811
return false;
38123812
}
3813-
if (p0 <= cell.pos && p1 < cell.pos) {
3813+
// invalidate tails which will be cleared
3814+
if (p0 <= cell.pos && cell.pos < p1) {
38143815
tail_id = -1;
38153816
}
38163817
}

0 commit comments

Comments
 (0)