What is KV cache?
Memory in LLM inference holding the attention keys and values of already processed tokens. It avoids recomputation but grows with context length and batch size.
Field: AI Hardware & Software Stack
Memory in LLM inference holding the attention keys and values of already processed tokens. It avoids recomputation but grows with context length and batch size.
Field: AI Hardware & Software Stack
That store is the KV cache.
What is the role of the KV cache in LLM inference?Inference also needs memory for intermediate results and, for large language models, the KV cache.
If a 7-billion-parameter (7B) model's weights are held in F…Memory for intermediate results and the KV cache also grows with batch size.
What is a drawback of making the inference batch size too l…Batch size Throughput AI compiler AI inference All-reduce Arithmetic intensity Attention mechanism Backpropagation Computational graph Data parallelism