graph : fix equal_seq() check (#14986)

ggml-ci
This commit is contained in:
Georgi Gerganov
2025-08-01 06:38:12 +03:00
committed by GitHub
parent 2860d479b4
commit ba42794c9e
3 changed files with 16 additions and 2 deletions

View File

@@ -423,7 +423,9 @@ struct llm_graph_params {
(!ubatch.embd && !other.ubatch.embd)
);
if (can_reuse_ubatch && !ubatch.equal_seqs()) {
// when we split the batch using "equal_seqs" we have to verify that the participating sequences are the same
// the reason is because the set of attention streams would be different for different sequences
if (can_reuse_ubatch && ubatch.equal_seqs()) {
if (!ubatch.data) {
// if the old ubatch does not own it's data, then we cannot guarantee that it is still alive, and
// therefore we cannot perform the sequence id check. normally should never happen