Tuning vLLM: What Every Setting Does to the Arithmetic
vLLM's V1 scheduler unifies prompt and output token budgeting into a single token-count map, eliminating the old prefill/decode phase separation and enabling features like chunked prefill, prefix caching, and speculative decoding to compose without conflict Only six settings truly matter for production tuning, and most defaults are already well-calibrated for typical workloads `--max-num-seqs` controls concurrency ceiling (not batch size), with defaults of 1024 on H100/H200/B200 and 256 on A100/
Analysis
TL;DR
- vLLM's V1 scheduler unifies prompt and output token budgeting into a single token-count map, eliminating the old prefill/decode phase separation and enabling features like chunked prefill, prefix caching, and speculative decoding to compose without conflict
- Only six settings truly matter for production tuning, and most defaults are already well-calibrated for typical workloads
--max-num-seqscontrols concurrency ceiling (not batch size), with defaults of 1024 on H100/H200/B200 and 256 on A100/L40S or cards under 70 GiB--gpu-memory-utilizationsets a memory fence (default 0.92); pushing to 0.95 reallocates 3% of GPU memory directly into KV cache with minimal risk--max-num-batched-tokensis the latency dial (default 8,192 through API server on H100), prioritizing decode tokens before prefill, and--kv-cache-dtype fp8halves cache cost while recovering 97-98% of baseline accuracy
Why It Matters
This article reframes vLLM tuning from a checklist of flags into a physics-based understanding of what each setting actually controls, which is critical for practitioners who have likely inherited default configurations without understanding their trade-offs. The unified scheduler architecture is the foundational change that makes modern vLLM nearly configuration-free, meaning most tuning advice online is outdated. For production LLM serving, recognizing which knobs move which levers prevents misdiagnosis of latency, throughput, and memory issues.
Technical Details
- Unified token budget scheduler: The V1 scheduler maintains a single
{request_id: num_tokens}map where prompt and output tokens consume the same budget, replacing the old two-phase prefill/decode model. This enables chunked prefill (splitting long prompts across steps), prefix caching, and speculative decoding to stack without conflicting special cases. --max-num-seqsas concurrency ceiling: Defaults are tiered by GPU: 1024 on H100/H200/B200, 256 on A100/L40S/under 70 GiB. The actual batch size is determined byvllm:num_requests_running, not this ceiling. Lowering it trades arithmetic intensity for bounded batch size and faster per-token response.--gpu-memory-utilizationas a memory fence: At 0.92, vLLM allocates no more than 92% of GPU memory after accounting for CUDA context and NCCL buffers. The KV cache receives whatever remains after weights, activation peaks, and CUDA graph buffers are reserved. Raising to 0.95 directly increases cache capacity.--max-num-batched-tokensas the latency control: Defaults split by deployment mode and GPU tier (e.g., 8,192 API-server on H100 vs 16,384 offline). Decode tokens are served first from the budget, so prefill gets only the remainder. Smaller values protect TTFT for existing requests at the cost of new request latency.--kv-cache-dtype fp8: Halves KV cache memory per token, potentially doubling concurrent conversations. vLLM's April 2026 study showed 97-98% AUC recovery at 128K on needle-in-a-haystack across models from Llama-3.1-8B to Kimi-K2.5, with a 1-2 point reasoning trade-off. Backend compatibility must be verified at startup.
Industry Insight
- Most published vLLM tuning guides are obsolete because the V1 scheduler redesign made the majority of flags redundant; practitioners should audit their configurations against the six key settings rather than applying generic optimization checklists.
- The
--performance-modeflag (throughput vs balanced vs interactivity) silently doubles certain defaults, so teams must verify actual running values rather than assuming documented baselines apply to their deployment. - FP8 KV cache is production-ready for throughput-bound dense and MoE models, but teams should validate backend selection and re-run quality evaluations, as the default backend may change when FP8 is enabled.
Disclaimer: The above content is generated by AI and is for reference only.