Expand description
2026-09-25: The paged KV cache: the KvCacheDtype storage formats, the
per-layer block geometry in KvCacheConfig, and the PagedKvCache block
pool with its per-block reference counts.
Owner: cache. Invariants:
- Until
release, every attention layeri < num_layershas its own K pool and V pool ofnum_blocksblocks, sized by that layer’s K-side and V-side block bytes. - A block index is pushed back onto the free list only when a decrement
(
dec_ref,return_evicted_block) takes its count from 1 to 0. A decrement at 0 never pushes: it is logged, anddec_refalso panics in a debug build.
Structs§
- KvCache
Config - 2026-09-25: Geometry and formats of the paged KV cache.
- Paged
KvCache - 2026-09-25: Paged KV cache across all attention layers: the pools and the block free list with per-block reference counts.
Enums§
- KvCache
Dtype - 2026-09-25: KV cache storage format. A symmetric variant uses one format
for K and V; a
*K*Vvariant names the K format, then the V format (kv_pair).