In this article, you will learn how LLM inference works on a GPU, and which techniques and metrics engineers use to make serving faster, cheaper, and more reliable.
Topics we will cover include:
How prefill, decode, the roofline model, and the KV cache determine where inference time and GPU memory go.
How batching, paged and prefix caching, chunked prefill, quantization, speculative decoding, and FlashAttention raise throughput and cut latency.
How to choose an inference engine and parallelism strategy, measure TTFT, TPOT, and goodput, and tune a deployment against latency targets.
Introduction
Training and serving a language model put different demands on the same GPU. Training cares about how many tokens a cluster processes over several days.…