Memory Bandwidth: The LLM Performance Bottleneck
LLM inference, especially during the decoding phase, is predominantly memory-bound rather than compute-bound, meaning performance is limited by data transfer speed, not raw processing power. For instance, an NVIDIA H100 SXM5 with 3.35 TB/s bandwidth still takes approximately 42 milliseconds to transfer the 140GB required for a Llama 2 70B FP16 model per token generation, highlighting how memory access dictates latency and throughput.
The top 3
- HBM vs. GDDR: The LLM Memory Bandwidth Showdown: High Bandwidth Memory (HBM), such as HBM3/HBM3E/HBM4, offers superior bandwidth (e.g., HBM4 up to 22 TB/s aggregate) through 2.5D/3D stacking and wider interfaces, making it ideal for data center LLMs, while GDDR (e.g., GDDR7 448 GB/s) used in consumer GPUs has a significant bandwidth gap due to narrower bus widths.
- LLM Decoding and KV Cache: The Memory Bandwidth Choke Points: The auto-regressive 'decode phase' of LLM inference, generating tokens one-by-one, is heavily memory-bound as it repeatedly accesses model weights and the growing Key-Value (KV) cache, which can exceed model size with long contexts. This contrasts with the often compute-bound 'prefill phase'.
- Next-Gen Memory: Breaking the LLM Bandwidth Wall: Emerging memory technologies like Compute Express Link (CXL), Processing-in-Memory (PIM), and advanced 3D stacking aim to surpass current HBM/GDDR limitations by bringing computation closer to data or expanding memory capacity and bandwidth for future LLMs.
Open the full topic