Roofline Analysis for LLM Serving

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

Source references

  • [src-042] Dwarkesh Patel — “How GPT, Claude, and Gemini are actually trained and served – Reiner Pope” (2026-04-29)

Robin Cartier perspective

This page is part of Robin Cartier's working AI knowledge graph: a practical research layer for production AI, recommendation systems, experimentation, GEO, and agentic web readiness.

The useful next step is to connect this concept back to applied product leadership and operating models.

Recommended next

Keep reading from this thread

From 491 indexed pages and articles.

  1. 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
  2. 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
  3. 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