KV Cache Memory Management
Overview This post is divided into five parts; they are: • Estimating Cache Capacity • Contiguous and Paged Allocation • Configuring the KV Cache in vLLM • A Block Allocator with Copy-on-Write • Reclamation, Offload, and Measurement Estimating Cache Capacity For a full-attention decoder with $L$ layers, $H_{KV}$ key-value heads, head dimension $D$, $N$ retained tokens, and $b$ bytes per cache…
We haven't written up this one. Machine Learning Mastery has the full story — the link below goes straight to it.
Source: machinelearningmastery.com