Part introduction
Part III - LLM Inference Systems
On this page
Training has produced a checkpoint: fixed weights, a matching tokenizer, and generation conventions. The next task is to use that checkpoint for many requests without confusing their state or exceeding their memory and latency limits. The prefill, decode, and KV calculations from Part I now become admission and scheduling decisions.
We begin with one request and then introduce batching, cache allocation, sampling, placement, and compression. The running configuration below keeps comparisons on the same model geometry. Part IV will open the kernels behind these operations; here we study the request path and the server that shares them.
The running service used throughout¶
Every section returns to one illustrative deployment so estimates stay comparable. Treat the numbers as a teaching configuration, not a product benchmark.
| Item | Value in this part |
|---|---|
| Model | dense 7B-class transformer: L = 32 layers, hidden D = 4096, GQA with H_kv = 8, head dim d = 128 |
| Weights | FP16, approximately 14 GB |
| KV cost | 2 * L * H_kv * d * 2 bytes = 128 KiB (about 131 kB) per cached token |
| Replica | one 80 GB accelerator (80,000,000,000 bytes), ~3 TB/s HBM, ~50 GB/s usable inter-node path |
| Non-KV reserve | 8 GiB for workspace, graph pools and allocator headroom; excluded from KV capacity |
| Workload | median prompt 2,000 tokens with a shared 500-token system prefix; median output 300 tokens; bursty arrivals |
| SLOs | streaming; p99 time to first token <= 1.5 s; p99 inter-token gap <= 100 ms |
The model geometry deliberately matches the running example of Part IV, so a reader moving between the parts sees the same tensors from the kernel side and from the service side.
The part combines worked traces with design exercises and solutions; the opening lifecycle chapter uses an executed streaming measurement as its diagnostic exercise.
Map of this part¶
| Section | Role in the story |
|---|---|
| Lifecycle and metrics | Define the request path and the measurements every later claim uses |
| Prefill, decode, modeling | Build the bytes-and-FLOPs model of one request on one replica |
| KV cache and prefix reuse | Manage the working set that decode carries between steps |
| Scheduling and admission | Share one replica across requests without breaking the contract |
| Sampling and speculation | Preserve decoding semantics while accelerating token selection |
| Parallel and disaggregated serving | Place phases and state across devices and pools |
| Quantization and adapters | Shrink bytes and multiply variants without changing the product |
| Production and reliability | Operate the whole system through failures and rollouts |
| Engines and cache backends | Read real implementations and run a controlled comparison |
Chapters in this part
- 18Request Lifecycle, Metrics, and Workload Models
- 19Prefill, Decode, and Performance Modeling
- 20KV Cache, Paging, and Prefix Reuse
- 21Scheduling, Batching, and Admission Control
- 22Sampling, Structured Output, and Speculative Decoding
- 23Parallel, Replicated, and Disaggregated Serving
- 24Quantization, Compression, and Adapter Serving
- 25Production Architecture, Capacity, and Reliability
- 26Serving Engines and Cache Backends in Practice