Skip to content

Commit 2c41dff

Browse files
committed
llama : fix llama_decode return code when could not find KV slot
ggml-ci
1 parent eb5518f commit 2c41dff

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

examples/parallel/parallel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ int main(int argc, char ** argv) {
106106

107107
common_params params;
108108

109+
params.n_predict = 128;
110+
109111
if (!common_params_parse(argc, argv, params, LLAMA_EXAMPLE_PARALLEL)) {
110112
return 1;
111113
}

src/llama-context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ int llama_context::decode(llama_batch & inp_batch) {
12981298
{
12991299
if (!kv_self->find_slot(ubatch)) {
13001300
LLAMA_LOG_ERROR("%s: failed to prepare ubatch\n", __func__);
1301-
return -3;
1301+
return 1;
13021302
}
13031303

13041304
if (!kv_self->recurrent) {

src/llama-kv-cache.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ bool llama_kv_cache_unified::seq_rm(llama_seq_id seq_id, llama_pos p0, llama_pos
204204
return false;
205205
}
206206
}
207+
208+
return true;
207209
}
208210

209211
for (uint32_t i = 0; i < size; ++i) {

0 commit comments

Comments
 (0)