An 8B support model (≈ 16 GB of BF16 weights) is served with a vLLM-style engine as shown below. At peak, the time per output token (TPOT) spikes and the engine logs preemptions. What is happening, and what is the most direct fix?
# one dedicated 80 GB GPU, nothing else runs on it
vllm serve /models/support-8b \
--gpu-memory-utilization 0.60 \
--max-model-len 32768 \
--max-num-seqs 128
# observed at peak traffic
GPU memory used 48 GB of 80 GB
engine log (paraphrased) WARN preempting request 9137 (mode=recompute): no free KV-cache blocks
p95 TPOT 38 ms -> 410 ms
typical request 2,000 prompt tokens + 400 output tokensShow the answer and explanation
Correct answer: B, Running sequences fill the paged KV cache, so the scheduler evicts some and later recomputes their KV; raise gpu-memory-utilization to about 0.9 so the engine can allocate more KV blocks.
Explanation Model Serving
A vLLM-style engine takes the memory budget gpu-memory-utilization × GPU memory, loads the weights, reserves activation workspace, and turns the rest into KV-cache blocks. Here that is 0.6 × 80 = 48 GB, minus ~16 GB of weights and some workspace, so roughly 30 GB of KV cache. The other 32 GB on the GPU is simply outside the engine's budget.
Demand at peak: a typical 8B model with grouped-query attention needs 2 (K, V) × 32 layers × 8 KV heads × 128 dims × 2 bytes ≈ 128 KB per token, so 128 sequences × ~2,400 tokens can need ~40 GB, more than the ~30 GB pool.
With paged attention, blocks are allocated on demand as each sequence grows. When running sequences need new blocks and none are free, the scheduler preempts some sequences: it frees their blocks and later rebuilds their KV by recomputing the prompt plus the tokens generated so far (some engines can instead swap blocks to CPU memory). Requests are not lost, but the recompute steps and the paused sequences show up as TPOT spikes.
On a dedicated GPU the direct fix is to give the cache the idle memory: at 0.9 the budget is 72 GB, so the KV cache grows from ~30 GB to ~54 GB, about 1.8× more blocks and enough for that peak. Other levers: cap max-num-seqs lower (trades throughput for stability), use an FP8 KV cache, or add replicas.
Why the distractors fail:
- Reserving the full
max-model-lenper sequence is the pre-paging behaviour; here blocks follow the real length (~2,400 tokens), so shrinking the limit does not reduce what these requests need. - Admitting more sequences into an already full cache causes more preemption.
- Preemption is internal rescheduling, not a failed request.
Interview tip: name the three knobs and what each controls: memory budget (gpu-memory-utilization), concurrency cap (max-num-seqs) and longest allowed context (max-model-len), and say you watch preemption counts and KV-cache usage on the dashboard.