MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / split_seq

Method split_seq

smallthinker/src/llama-batch.cpp:188–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188llama_ubatch llama_sbatch::split_seq(size_t n_ubatch) {
189 n_ubatch = n_tokens < n_ubatch ? n_tokens : n_ubatch;
190 llama_ubatch ubatch = reserve_ubatch(n_ubatch, /* has_embd */ batch->embd != nullptr);
191 if (!seq.empty()) {
192 llama_sbatch_seq & s = seq[seq.size() - 1];
193 size_t length = s.length < n_ubatch ? s.length : n_ubatch;
194 GGML_ASSERT(s.n_seq_id > 0); // should not be mixed with simple splits
195 add_seq_to_ubatch(ubatch, s, length);
196 }
197 return ubatch;
198}
199
200llama_sbatch::llama_sbatch(const llama_batch & batch, size_t n_embd, bool simple_split, bool logits_all) {
201 GGML_ASSERT(batch.n_tokens >= 0);

Callers 1

init_batchMethod · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected