Skip to content

Commit 69ebccf

Browse files
ggerganovfuryhawk
authored andcommitted
context : fix pos_min initialization upon error decode (ggml-org#14008)
ggml-ci
1 parent 24c15be commit 69ebccf

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
@@ -1058,7 +1058,10 @@ int llama_context::decode(llama_batch & inp_batch) {
10581058

10591059
if (!res) {
10601060
// the last ubatch failed or was aborted -> remove all positions of that ubatch from the KV cache
1061-
llama_pos pos_min[LLAMA_MAX_PARALLEL_SEQUENCES] = { std::numeric_limits<llama_pos>::max() };
1061+
llama_pos pos_min[LLAMA_MAX_PARALLEL_SEQUENCES];
1062+
for (int s = 0; s < LLAMA_MAX_PARALLEL_SEQUENCES; ++s) {
1063+
pos_min[s] = std::numeric_limits<llama_pos>::max();
1064+
}
10621065

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

0 commit comments

Comments
 (0)