fix batch decoding and dynamic batching

This commit is contained in:
Li, Zonghang 2025-06-07 00:53:56 +04:00
parent e56be76bdf
commit 22a6ddef13

View file

@ -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) {