Skip to content

batch : fix uninitialized has_cpl flag #14733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/llama-batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/llama-batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class llama_batch_allocr {
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
Expand Down
Loading