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

Method split_simple

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

Source from the content-addressed store, hash-verified

146}
147
148llama_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
161llama_ubatch llama_sbatch::split_equal(size_t n_ubatch) {
162 n_ubatch = n_tokens < n_ubatch ? n_tokens : n_ubatch;

Callers 3

init_batchMethod · 0.80
init_batchMethod · 0.80
encodeMethod · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected