Efficient Memory Management for Large Language Model Serving with PagedAttention
An LLM server can run out of room for requests while most of its KV cache memory holds nothing. Follow the three kinds of reservation waste, the block table that places 16-token blocks anywhere on the GPU, copy-on-write sharing, and the batch-size evidence behind vLLM's 2 to 4 times throughput.
Reading focus: Why contiguous worst-case reservation left only 20.4 to 38.2 percent of KV cache memory holding tokens in the paper's baselines. How a per-request block table, on-demand blocks, and reference-counted copy-on-write bound waste to the last block and share prompts across samples. Why a 20 to 26 percent slower attention kernel still serves 2 to 4 times more requests, and where the reimplemented baselines limit the claim.
SOSP 2023. Woosuk Kwon et al.. 16 min read, hard difficulty.