From 22a6ddef13c3611ac474ebb3cfe85994b52f6616 Mon Sep 17 00:00:00 2001 From: "Li, Zonghang" <870644199@qq.com> Date: Sat, 7 Jun 2025 00:53:56 +0400 Subject: [PATCH] fix batch decoding and dynamic batching --- src/llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index 5531ddcc..0e615b67 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -18282,8 +18282,8 @@ static int llama_decode_internal( if (meta.seq_id != nullptr) { batch_all.seq_id = (llama_seq_id **) malloc(cparams.n_ctx * sizeof(llama_seq_id *)); for (size_t i = 0; i < cparams.n_ctx; ++i) { - batch_all.seq_id[i] = (llama_seq_id *) malloc(meta.n_seq_id[i] * sizeof(llama_seq_id)); - std::memcpy(batch_all.seq_id[i], meta.seq_id[i], meta.n_seq_id[i] * sizeof(llama_seq_id)); + batch_all.seq_id[i] = (llama_seq_id *) malloc(sizeof(llama_seq_id)); + batch_all.seq_id[i][0] = meta.seq_id[i][0]; } } if (meta.logits != nullptr) {