LLM Inference: Memory Bandwidth Outpaces Compute as Latency Bottleneck
During the autoregressive decode phase of LLM inference, GPUs often spend more time fetching model weights and Key-Value (KV) cache data from memory than on actual computations, making memory bandwidth the primary latency bottleneck.
The top 3
- Quantization's Impact: Shrinking LLMs for Faster Inference: Quantization dramatically reduces LLM memory footprint and bandwidth needs by converting weights from high-precision (e.g., FP32) to lower-precision formats (e.g., INT4), enabling a 7B model to shrink from 28GB to around 3.5GB and speeding up token generation by up to 4x due to less data transfer.
- HBM vs. GDDR: Memory Architectures' LLM Latency Battle: High Bandwidth Memory (HBM) often outperforms GDDR in LLM inference due to its stacked dies and wider interfaces, providing substantially higher bandwidth crucial for memory-bound LLM workloads.
- KV Cache Optimization: Key to Unlocking LLM Speed: The Key-Value (KV) cache, storing attention states, is a major memory hog; techniques like PagedAttention and Grouped-Query Attention efficiently manage and reduce its memory footprint, boosting LLM throughput.
Sources
Open the full topic