Skip to content

Commit 5248b16

Browse files
committed
caontext : fix pos_min initialization upon error decode
ggml-ci
1 parent 3ac6753 commit 5248b16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/llama-context.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,10 @@ int llama_context::decode(llama_batch & inp_batch) {
10191019

10201020
if (!res) {
10211021
// the last ubatch failed or was aborted -> remove all positions of that ubatch from the KV cache
1022-
llama_pos pos_min[LLAMA_MAX_PARALLEL_SEQUENCES] = { std::numeric_limits<llama_pos>::max() };
1022+
llama_pos pos_min[LLAMA_MAX_PARALLEL_SEQUENCES];
1023+
for (int s = 0; s < LLAMA_MAX_PARALLEL_SEQUENCES; ++s) {
1024+
pos_min[s] = std::numeric_limits<llama_pos>::max();
1025+
}
10231026

10241027
for (uint32_t i = 0; i < ubatch.n_tokens; ++i) {
10251028
const auto & seq_id = ubatch.seq_id[i][0];

0 commit comments

Comments
 (0)