Files
llama.cpp/src
LumpiastyandClaude Opus 5.5 9d8a4ffc60 llama: KV host shadow of a released cache holds only the used cells (F4)
On an arbiter release with LLAMA_SLEEP_EVICT_KV the KV cache was copied
whole to the host shadow (about 2.6 GB for the 35B at ctx 131072) and
uploaded whole on restore. Only the rows of the cells below
used_max_p1() of each stream are captured now (K, and V when not
transposed); the restore clears the new buffer first, so the other cells
read as zero as after the first allocation. The to_host restore of the
disk cache scatters the ranges into a full-layout buffer.

Knob: LLAMA_SLEEP_KV_USED_ONLY=0 captures every cell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZz44SLQvTXMyWGio6t9DZ
2026-11-23 17:37:07 +01:00
..
2026-11-12 20:59:09 +02:00
2026-11-12 20:59:09 +02:00