Design KV offload to CPU memory. When does fetching blocks back over PCIe beat recomputing them?
Recomputing a prefix costs FLOPs proportional to the model, fetching it costs bytes proportional to the cache. One ratio decides it, and the answer shows by how much fetching wins and the three situations where it still loses.
Updated Oct 2026 · Worked answers on inference mechanisms, with calculations, implementation details, and follow-up questions.
Recomputing a prefix costs FLOPs proportional to the model, fetching it costs bytes proportional to the cache. One ratio decides it, and the answer shows by how much fetching wins and the three situations where it still loses.
At batch 1 the step reads every weight once to produce one token per sequence, so arithmetic intensity sits near 1 FLOP per byte and the tensor cores idle.