Running Llama 3.1 405B at full precision demands roughly 810 GB of VRAM. That's ten H100s. Most teams don't have that budget. vLLM's PagedAttention changes the math, letting you serve the model on a fraction of the hardware without sacrificing throughput.
Why Standard Attention Fails at Scale
Traditional attention allocates contiguous KV cache blocks per request. With 405B parameters and 128K context, a single sequence can consume 20+ GB. Fragmentation wastes 60-80% of reserved memory. Requests queue while GPUs sit half-empty. PagedAttention borrows from OS virtual memory: it splits KV cache into fixed-size pages (default 16 tokens) and maps logical blocks to physical pages on demand.
PagedAttention Mechanics
Each attention layer maintains a page table per sequence. When a new token arrives, vLLM appends to the logical sequence and allocates a fresh physical page only if needed. Prefix sharing across requests (system prompts, few-shot examples) becomes free — multiple sequences point to the same physical pages. Memory utilization jumps from ~40% to >90% on typical workloads.
Continuous Batching: The Throughput Multiplier
PagedAttention enables continuous batching. Instead of waiting for all sequences in a batch to finish, vLLM evicts completed requests and admits new ones every iteration. The scheduler treats each token generation step as a scheduling quantum. On 8x H100 (80GB), this delivers 2.3x higher throughput vs. static batching at identical latency targets.
| Config | VRAM/GPU | Tokens/s (Total) | Latency (ms/token) |
|---|---|---|---|
| Static batch, no paging | 78 GB | 1,840 | 45 |
| Continuous batch + PagedAttention | 72 GB | 4,210 | 38 |
| + Prefix caching (shared system prompt) | 68 GB | 5,100 | 35 |
Quantization Without Quality Loss
FP8 (E4M3) quantization cuts memory in half with <1% perplexity delta on Llama 3.1 405B. vLLM supports FP8 kernels natively on H100 via `--quantization fp8`. Combine with PagedAttention and you fit 405B on 4x H100 (320 GB total) at 128K context. Throughput drops ~15% vs BF16 but cost-per-token plummets.
Production Checklist
Deploy behind the OpenAI-compatible `/v1/chat/completions` endpoint. Enable `--enable-chunked-prefill` for long-context fairness. Monitor `vllm:request_queue_time_seconds` and `vllm:gpu_cache_usage_perc` via Prometheus. Set `max_num_seqs=256` and `max_num_batched_tokens=8192` as starting points; tune based on tail latency SLOs.
"PagedAttention is the first KV cache management scheme that makes serving 400B+ models economically viable for teams without hyperscaler budgets.
— Woosuk Kwon, vLLM co-creator
✦








