Serving Large Language Models (LLMs) in production environments presents a radical departure from traditional stateless web microservices. Autoregressive text generation is memory-bandwidth bound during token generation (Decode phase) and compute-bound during prompt ingestion (Prefill phase).
Naive inference systems that batch requests statically suffer from the “curse of variable output lengths”: an entire GPU batch stalls, wasting up to 80% of its compute cycles, waiting for the single longest response to finish. Furthermore, pre-allocating contiguous memory buffers for the Key-Value (KV) cache wastes over 60% of expensive GPU High-Bandwidth Memory (HBM) due to internal and external fragmentation.
This module deconstructs modern LLM serving engines (vLLM, TensorRT-LLM, TGI): continuous iteration-level scheduling, PagedAttention virtual memory mapping, chunked prefill scheduling, speculative decoding, and production serving SLAs.