Skip to content

Commit 652e9b0

Browse files
committed
llama : fix T5 segfault again
1 parent 702e199 commit 652e9b0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/llama.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -15482,12 +15482,13 @@ static int llama_encode_internal(
1548215482
float * embd_out = lctx.embd_enc.data();
1548315483

1548415484
ggml_backend_tensor_get_async(backend_embd, embd, embd_out, 0, n_tokens*n_embd*sizeof(float));
15485+
GGML_ASSERT(!ubatch.equal_seqs); // TODO: handle equal splits
1548515486

1548615487
// remember the sequence ids used during the encoding - needed for cross attention later
1548715488
lctx.seq_ids_enc.resize(n_tokens);
1548815489
for (uint32_t i = 0; i < n_tokens; i++) {
15489-
for (int s = 0; s < batch.n_seq_id[i]; s++) {
15490-
llama_seq_id seq_id = batch.seq_id[i][s];
15490+
for (int s = 0; s < ubatch.n_seq_id[i]; s++) {
15491+
llama_seq_id seq_id = ubatch.seq_id[i][s];
1549115492
lctx.seq_ids_enc[i].insert(seq_id);
1549215493
}
1549315494
}
@@ -15512,8 +15513,10 @@ static int llama_encode_internal(
1551215513
auto & embd_seq_out = lctx.embd_seq;
1551315514
embd_seq_out.clear();
1551415515

15516+
GGML_ASSERT(!ubatch.equal_seqs); // TODO: handle equal splits
15517+
1551515518
for (uint32_t i = 0; i < n_tokens; i++) {
15516-
const llama_seq_id seq_id = batch.seq_id[i][0];
15519+
const llama_seq_id seq_id = ubatch.seq_id[i][0];
1551715520
if (embd_seq_out.find(seq_id) != embd_seq_out.end()) {
1551815521
continue;
1551915522
}

0 commit comments

Comments
 (0)