From ad57d3edd2f48cf6dc41a98fd9b303435ecb4fb0 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 17 Jul 2025 09:45:54 +0300 Subject: [PATCH] batch : fix uninitialized has_cpl flag (#14733) ggml-ci --- src/llama-batch.cpp | 2 ++ src/llama-batch.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/llama-batch.cpp b/src/llama-batch.cpp index f8227777f..eb15d2c41 100644 --- a/src/llama-batch.cpp +++ b/src/llama-batch.cpp @@ -157,6 +157,8 @@ bool llama_batch_allocr::init( n_outputs += batch.logits[i] != 0; } + has_cpl = false; + // determine coupled sequences // these are pairs of sequences that have at least one token in the input batch that is assigned to both of them for (int32_t i = 0; i < batch.n_tokens; ++i) { diff --git a/src/llama-batch.h b/src/llama-batch.h index 1a24440ba..c811aef43 100644 --- a/src/llama-batch.h +++ b/src/llama-batch.h @@ -117,7 +117,7 @@ private: using seq_cpl_t = std::vector; // helper flag to quickly determine if there are any coupled sequences in the batch - bool has_cpl; + bool has_cpl = false; std::vector seq_pos; // seq_pos[s]: the set of positions in sequence s std::vector seq_cpl; // seq_cpl[s0][s1]: if sequence s0 is coupled to sequence s1