What does the vLLM-style continuous-batching scheduler actually do at each step?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.