Skip to content

Commit 58115a2

Browse files
committed
kv-cache : fix recurrent multi-user case
ggml-ci
1 parent 2bc7545 commit 58115a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/llama-kv-cache.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ int32_t llama_kv_cache_recurrent::s_copy(int i) const {
19361936

19371937
//////////////////////////////////////////////
19381938
// TODO: this should not mutate the KV cache !
1939-
kv_cell & cell = const_cast<kv_cell &>(cells[i]);
1939+
kv_cell & cell = const_cast<kv_cell &>(cells[cell_id]);
19401940

19411941
// prevent out-of-bound sources
19421942
if (cell.src < 0 || (uint32_t) cell.src >= size) {
@@ -1959,7 +1959,7 @@ float llama_kv_cache_recurrent::s_mask(int i) const {
19591959

19601960
//////////////////////////////////////////////
19611961
// TODO: this should not mutate the KV cache !
1962-
kv_cell & cell = const_cast<kv_cell &>(cells[i]);
1962+
kv_cell & cell = const_cast<kv_cell &>(cells[cell_id]);
19631963

19641964
float res = (float) (cell.src >= 0);
19651965

0 commit comments

Comments
 (0)