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

Method seq_keep

smallthinker/src/llama-kv-cache-unified.cpp:197–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void llama_kv_cache_unified::seq_keep(llama_seq_id seq_id) {
198 uint32_t new_head = cells.size();
199
200 for (uint32_t i = 0; i < cells.size(); ++i) {
201 if (cells.seq_keep(i, seq_id)) {
202 if (new_head == cells.size()) {
203 new_head = i;
204 }
205 }
206 }
207
208 // If we freed up a slot, set head to it so searching can start there.
209 if (new_head != cells.size() && new_head < head) {
210 head = new_head;
211 }
212}
213
214void llama_kv_cache_unified::seq_add(llama_seq_id seq_id, llama_pos p0, llama_pos p1, llama_pos shift) {
215 if (shift == 0) {

Callers 1

llama_kv_self_seq_keepFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected