mirror of
https://github.com/RYDE-WORK/llama.cpp.git
synced 2026-01-29 19:53:16 +08:00
llama: remove redundant loop when constructing ubatch (#9574)
This commit is contained in:
parent
2a63caaa69
commit
ecd5d6b65b
@ -3056,18 +3056,14 @@ struct llama_sbatch {
|
|||||||
} else {
|
} else {
|
||||||
// simple split
|
// simple split
|
||||||
if (batch->n_seq_id) {
|
if (batch->n_seq_id) {
|
||||||
for (size_t i = 0; i < length; ++i) {
|
ubatch.n_seq_id = batch->n_seq_id + seq.offset;
|
||||||
ubatch.n_seq_id = batch->n_seq_id + seq.offset;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < length; ++i) {
|
for (size_t i = 0; i < length; ++i) {
|
||||||
ubatch.n_seq_id[ubatch.n_seqs + i] = 1;
|
ubatch.n_seq_id[ubatch.n_seqs + i] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (batch->seq_id) {
|
if (batch->seq_id) {
|
||||||
for (size_t i = 0; i < length; ++i) {
|
ubatch.seq_id = batch->seq_id + seq.offset;
|
||||||
ubatch.seq_id = batch->seq_id + seq.offset;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < length; ++i) {
|
for (size_t i = 0; i < length; ++i) {
|
||||||
ubatch.seq_id[ubatch.n_seqs + i] = &seq.all_seq_id;
|
ubatch.seq_id[ubatch.n_seqs + i] = &seq.all_seq_id;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user