| 146 | } |
| 147 | |
| 148 | llama_ubatch llama_sbatch::split_simple(size_t n_ubatch) { |
| 149 | n_ubatch = n_tokens < n_ubatch ? n_tokens : n_ubatch; |
| 150 | llama_ubatch ubatch = reserve_ubatch(n_ubatch, /* has_embd */ batch->embd != nullptr); |
| 151 | ubatch.equal_seqs = false; |
| 152 | if (!seq.empty()) { |
| 153 | llama_sbatch_seq & s = seq[0]; |
| 154 | size_t length = s.length < n_ubatch ? s.length : n_ubatch; |
| 155 | GGML_ASSERT(seq.size() == 1 && s.n_seq_id == 0); // don't mix with other splits |
| 156 | add_seq_to_ubatch(ubatch, s, length); |
| 157 | } |
| 158 | return ubatch; |
| 159 | } |
| 160 | |
| 161 | llama_ubatch llama_sbatch::split_equal(size_t n_ubatch) { |
| 162 | n_ubatch = n_tokens < n_ubatch ? n_tokens : n_ubatch; |
no test coverage detected