Modern serving systems combine four major optimizations to extract usable throughput from frontier models. Knowing what each does is essential for choosing a stack and debugging performance.
Flash Attention 2/3
Already covered in Track 4. Tile attention so the (n × n) score matrix never materializes in HBM. 2-4× attention throughput vs naive. FA3 supports FP8 + warp specialization on H100 (~740 TFLOPs/s).
GQA / MQA
Architecture-level. Reduces KV cache by sharing K, V across query heads. Llama 3.3's 8 KV heads (vs 64 Q heads) shrink the cache 8×. Allows long context to fit in less GPU memory.
Speculative decoding
Use a small draft model to generate K candidate tokens; verify them in one forward pass of the target (large) model. Accept the longest matching prefix. 2-3× wall-clock speedup with identical output distribution. Implementations: Llama-cpp, vLLM, MLC-LLM.
PagedAttention (vLLM)
Manage KV cache like an OS virtual-memory system: fixed-size pages, block tables mapping logical to physical, copy-on-write for shared prefixes. Reduces fragmentation waste from 60-80% to ~4%, increasing the number of concurrent requests per GPU dramatically.
Continuous batching
Iteration-level scheduling: at each decoding step, sequences that have finished are removed and new requests slotted in. Reduces GPU idle time from ~40% to under 10%. 5-23× throughput improvement vs static batching.
| Technique | What it solves | Speedup |
|---|---|---|
| Flash Attention | Memory bandwidth in attention | 2-4× |
| GQA / MQA | KV cache size | 2-8× cache reduction |
| Speculative decoding | Sequential decode bottleneck | 2-3× wall-clock |
| PagedAttention | Memory fragmentation | ~20× more requests/GPU |
| Continuous batching | GPU idle time | 5-23× throughput |