Roofline Analysis for LLM Serving
Back-of-the-envelope method for estimating LLM serving latency by comparing compute time against memory-fetch time.
Key points
- Pope models decode time as at least the maximum of compute time and memory time [src-042].
- Compute time scales with batch size and active parameters divided by chip FLOPs [src-042].
- Memory time includes weight fetches over total parameters plus KV-cache fetches over batch size, context length, and bytes per token, divided by memory bandwidth [src-042].
- This simple model explains why serving can shift between compute-bound and memory-bound regimes as batch size or context length changes [src-042].
- The model also explains why the “Goldilocks” context length matters: beyond the balance point, dense attention makes KV-cache memory bandwidth dominate [src-042].
Related concepts
- LLM Inference Economics
- LLM Serving Batching
- KV Cache
- Memory Wall for Long Context
- Mixture-of-Experts Serving
Source references
- [src-042] Dwarkesh Patel — “How GPT, Claude, and Gemini are actually trained and served – Reiner Pope” (2026-04-29)
Recommended next
Keep reading from this thread
From 491 indexed pages and articles.
- Wiki concept LLM Inference Economics The cost and latency structure of serving large language models, driven by compute throughput, memory bandwidth, batch size, context length, KV-cache storage, and Related by LLMs
- Wiki concept Nvidia Blackwell NVL72 Rack-scale Nvidia GPU system used in [src-042] as the running example for LLM roofline analysis. Related by roofline
- Insight AI Beyond POCs How enterprise AI moves beyond proofs of concept through ownership, governance, measurement, adoption, and production operating models Readers have engaged with this next