]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
batch : fix uninitialized has_cpl flag (#14733)
authorGeorgi Gerganov <redacted>
Thu, 17 Jul 2025 06:45:54 +0000 (09:45 +0300)
committerGitHub <redacted>
Thu, 17 Jul 2025 06:45:54 +0000 (09:45 +0300)
ggml-ci

src/llama-batch.cpp
src/llama-batch.h

index f8227777f19de83eb6ed6b302165b32bb49fc8a5..eb15d2c41f1e26b5728da89630709ed6d7c0fe3d 100644 (file)
@@ -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) {
index 1a24440ba7562e6111c4835c981e065f9e6a46f4..c811aef439588455ed92ab5dcbf3845075792b0a 100644 (file)
@@ -117,7 +117,7 @@ private:
     using seq_cpl_t = std::vector<bool>;
 
     // helper flag to quickly determine if there are any coupled sequences in the batch
-    bool has_cpl;
+    bool has_cpl = false;
 
     std::vector<pos_set_t> seq_pos; // seq_pos[s]: the set of positions in sequence s
     std::vector<seq_cpl_t> seq_cpl; // seq_cpl[s0][s1]: if sequence s0 is coupled to sequence s1