mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-11 13:30:35 +00:00
llama: remove redundant loop when constructing ubatch
This commit is contained in:
parent
63351143b2
commit
9e07236444
@ -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…
Reference in New Issue
Block a user