Why does an LLM server need continuous batching, a paged KV cache and CUDA graphs? Drag the sliders and watch it happen. Numbers tagged measured come from my own engine, mini-vllm, benchmarked on a Tesla T4. Anything tagged simulated is a model fitted to those measurements.
Static vs continuous batching simulated
Same 64 requests, same arrival times, same GPU model. Each row is a batch slot. Hatched time is a slot that finished its request but cannot take a new one.
time
Static batching
wait for a batch, run it until the longest reply ends
Continuous batching
a freed slot is refilled on the very next step
prefilldecode, long replydecode, short replyslot idle, waiting on batchrequests waiting in queue (bottom strip)
What I actually measured measured
Stage 4 of mini-vllm, the same mixed workload, 64 requests, all present at t=0 (closed loop). Goodput in tokens per second.
staticcontinuous
How well does the simulator match? (calibration check)
The simulator has four fitted constants (decode step time and prefill cost). Fitted on these runs, so this checks the fit, not an independent prediction. The ratio between the policies is the part to trust. Absolute levels drift at large batch sizes, where the real engine slows down more than the model does.
Contiguous slots vs paged blocks simulated snapshot
One memory pool, the same requests. Contiguous reserves a full max-length slot per request. Paged hands out small blocks sized to what each request needs. Each row below is 732 tokens wide, the engine's slot size.
Contiguous
Paged
tokens stored (one colour per request)reserved, still emptyblock rounding wastefree
This is a snapshot of a full pool, so it shows the best case for paging. In the real runs below the pool was not always full (traffic arrived over time), so the throughput gain was smaller, 1.1x to 1.7x.
Goodput by pool size measured
Stage 5, mixed workload. Same memory, different layout.
contiguouspaged
Block size trade-off measured
Bigger blocks mean fewer table lookups but more rounding waste. Goodput barely moved, rounding waste exploded.
Where did the KV pool actually go? measured
Stage 5 time-averaged share of the KV memory pool across all four pool budgets. Contiguous slots lock two-thirds or more of the pool as reserved-but-empty padding; paged blocks leave unused capacity genuinely free for incoming requests.
tokens storedreserved, emptyblock roundingnot handed out (free)
How fast can decode possibly go? published specs + formula
Each decode step reads every weight once plus every sequence's KV cache. Memory bandwidth sets the speed limit until compute saturates; memory capacity sets how many sequences fit.
When does a KV cache even win? measured
Stages 1 & 2 on Tesla T4 (Qwen2.5-0.5B, 128-token prompt). Because eager batch-1 decoding is launch-overhead bound, maintaining a KV cache is actually slower than recomputing the whole sequence for short outputs, crossing over only around 422–488 new tokens.
naive (recompute)with KV cache
Predict first: what changes on A100 and H100? analytical prediction
Same model, precision, and context as selected above, compared across Tesla T4 (measured copy BW) and the upcoming A100 / H100 cross-GPU benchmark targets in mini-vllm.
Closing the gap: Stage 12 → 13 → 14 vs vLLM measured
Tesla T4, same 64-request mixed trace replayed over HTTP. Stage 12 introduced the engine; Stage 13 folded GQA heads (moving 29% of attention bytes), refined buckets, and added eager fallback; Stage 14 replaced the gather copy with an in-place Triton paged-attention kernel.
Cross-GPU phase (planned): Controlled A100 and H100 runs against vLLM are the next benchmark phase in mini-vllm. See Tab 3's analytical ridge-point table for pre-benchmark predictions; T4 measurements remain plotted below.
The Graph-in-Batch paradox (Stage 12) measured
4 req/s open-loop median TPOT. On 1.5B, the uncaptured padded-bucket control (static) is just as slow as graph (2.28× slower than eager), proving fixed padded buckets — not CUDA graph capture — caused the regression.
eagerstatic buckets (uncaptured)CUDA graph
Ablations at 8 req/s measured
In-process median TPOT (ms) at 8 req/s on the selected model size. Lower is better.
Single request latency measured
No queueing, 128 new tokens, mean over three workloads (Stage 12 HTTP). Lower is better.
Capacity (90% SLO attainment) measured
Highest tested arrival rate where ≥90% of requests met latency targets. Sweep stopped at 8 req/s ("8+" means did not break yet). Stages 13 and 14 raised 1.5B capacity from 2 req/s to 8+ req/s (100% SLO in Stage 14).