Skip to content

Commit ad57d3e

Browse files
authored
batch : fix uninitialized has_cpl flag (#14733)
ggml-ci
1 parent 1ba45d4 commit ad57d3e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/llama-batch.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ bool llama_batch_allocr::init(
157157
n_outputs += batch.logits[i] != 0;
158158
}
159159

160+
has_cpl = false;
161+
160162
// determine coupled sequences
161163
// these are pairs of sequences that have at least one token in the input batch that is assigned to both of them
162164
for (int32_t i = 0; i < batch.n_tokens; ++i) {

src/llama-batch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class llama_batch_allocr {
117117
using seq_cpl_t = std::vector<bool>;
118118

119119
// helper flag to quickly determine if there are any coupled sequences in the batch
120-
bool has_cpl;
120+
bool has_cpl = false;
121121

122122
std::vector<pos_set_t> seq_pos; // seq_pos[s]: the set of positions in sequence s
123123
std::vector<seq_cpl_t> seq_cpl; // seq_cpl[s0][s1]: if sequence s0 is coupled to sequence s1

0 commit comments

Comments
 (0)