KV Cache Management: Growing Memory Footprint

The Key-Value (KV) cache, which stores intermediate attention states to avoid recomputation, dynamically expands with sequence length and batch size, consuming significant memory and leading to memory-bound operations, particularly during the decode phase of token generation.

Sources

Open the full topic