What does the vLLM-style continuous-batching scheduler actually do at each step?
Describe the responsibilities of a vLLM-style continuous-batching scheduler at each decode iteration. Be specific about admission, eviction, preemption, and what happens when KV memory is over-committed.
Each iteration the scheduler reaps finished requests, recomputes the KV-block budget, admits waiting work up to it, preempts under pressure via swap or recompute, then runs one batched decode step.
Picture a busy restaurant kitchen with one shared stove. Every few seconds the head chef checks it. Finished dishes come off and free up burners. New orders waiting at the pass get started, but only as many as the freed burners can hold. If the kitchen is jammed and one long order is hogging space, the chef sets a dish aside, either keeping its half-cooked food warm in the fridge to resume later, or scraping it and re-prepping from scratch when room opens up. Then the chef pushes every active dish one step forward together, in a single sweep, before checking again. The stove is the GPU, the burners are KV memory, and that constant per-step reshuffle is continuous batching.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: the five per-step responsibilities, reap-before-admit and head-of-line blocking, KV-block budget as the admission gate, swap versus recompute preemption, then chunked prefill and prefix-sharing refcounts.
Real products, models, and research that use this idea.
- vLLM (UC Berkeley) pairs continuous batching with paged attention and is the reference scheduler most open-source serving builds on in 2026.
- SGLang adds prefix-aware scheduling so requests sharing a long system prompt are admitted together and reuse cached blocks.
- TensorRT-LLM (NVIDIA) ships in-flight batching, its name for the same iteration-level scheduler, with chunked prefill on H100 and B200.
- Hugging Face TGI implements continuous batching with a token-budget scheduler for serving Llama 4 and Mistral Large 3.
- Anthropic and OpenAI production stacks combine iteration-level scheduling with prefix caching so common system prompts skip prefill across requests.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does decode push a batch into over-commit even when admission was within budget?
QHow does the scheduler decide between swap and recompute for a preemption victim?
QWhat does chunked prefill solve that plain prefill-then-decode does not?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Describing it as static batching that pads to the longest sequence. The whole point is iteration-level scheduling, where finished requests leave and new ones join every step, with no head of line blocking.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.