Trace how one slow request stalls every co-batched generation step.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
On a continuous-batching server, a single pathological request causes p99 latency to spike across all in-flight sequences, even ones that should be unaffected. Explain the mechanism that couples them, name the most common culprits, and describe how you would isolate the slow path so co-batched requests are not held hostage.
Continuous batching advances every sequence on one shared step thread, so any CPU hook or grammar check that blocks the step holds every co-batched request hostage.
Picture a tour bus that stops at every passenger's chosen station, but only moves when everyone has finished boarding or disembarking. If one passenger fumbles with a heavy suitcase at door, the whole bus waits, even passengers who already sat down. The bus is the GPU step. Each passenger is a request in the batch. The fumble is some slow CPU task that runs between forward passes: turning token IDs into text, checking a complicated grammar, or scoring extra log-probabilities. The driver cannot leave any passenger behind, so one slow passenger sets the speed for everyone. The fix is to move the slow tasks off the bus itself, onto helpers waiting at the curb, and to put a hard timer on each boarding step so a stuck passenger gets dropped rather than freezing the route.
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.
3 min: step thread as shared barrier + CPU hooks that block it + structured-output grammar tail + worker-pool isolation + per-step timeout + replica-level workload split.
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.
Blaming the GPU when the real culprit is a CPU-side hook running on the step thread. The GPU finishes in milliseconds while a Python detokenizer or grammar check holds the barrier.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.