llama.cpp
ce94c097 - kv-cache : reuse SWA cells shared by several sequences once masked for all of them (#32309)

Commit
1 day ago
kv-cache : reuse SWA cells shared by several sequences once masked for all of them (#32309) In a unified KV cache, cells that are shared between sequences (e.g. a common prompt copied with llama_memory_seq_cp) were never considered by find_slot, which only recycled SWA-masked cells with a single owner. The shared cells stayed occupied forever and the SWA cache, sized as n_swa*n_seq_max + n_ubatch, ran out of slots once the shared prefix grew past the padding. Allow find_slot to reuse a shared cell once it is SWA-masked for all of its sequences, and let apply_ubatch purge the overwritten positions for each of them. Fixes #32258 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Author
Parents
Loading