]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama: remove redundant loop when constructing ubatch (#9574)
authorShankar <redacted>
Sun, 22 Sep 2024 02:30:34 +0000 (19:30 -0700)
committerGitHub <redacted>
Sun, 22 Sep 2024 02:30:34 +0000 (04:30 +0200)
src/llama.cpp

index af8afd8456b22aa34c71ee15bb5af034ad09df2b..bc4e408e010d09d87cff97f9a7066b87d897db44 100644 (file)
@@ -3056,18 +3056,14 @@ struct llama_sbatch {
         } else {
             // simple split
             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 {
                 for (size_t i = 0; i < length; ++i) {
                     ubatch.n_seq_id[ubatch.n_seqs + i] = 1;
                 }
             }
             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 {
                 for (size_t i = 0; i < length; ++i) {
                     ubatch.seq_id[ubatch.n_seqs + i] = &seq.all_seq_id;