mlprep
Medium15 min·2 rounds·Batching & Scheduling

How does continuous batching work and why does static batching waste GPU utilization?

Written by the mlprep team · Updated

Interviewer Mode
Interviewer

Walk me through how continuous batching works in LLM serving engines like vLLM or TensorRT-LLM. Why does traditional static batching waste so much GPU capacity on autoregressive generation?

Ready to compare your reasoning?
Interviewer

What happens when a newly admitted request has a 4,000-token prompt (prefill) and joins a batch of 30 decode requests that each only need 1 token computed? How do serving engines prevent prefill from stalling decode latency?

Ready to compare your reasoning?

The key takeaway unlocks after you reveal an expert answer.

Follow-up Questions to Test Yourself

Interviewers often pivot here once you cover the core concept.

  • How do you decide between recomputation vs. CPU-RAM swapping when KV cache memory runs out under continuous batching?
  • How does prefix caching interact with chunked prefill when multiple requests share a large system prompt?
  • At what batch size does decode transition from memory-bandwidth-bound to compute-bound on an H100?

How confident do you feel explaining this?

Track your understanding or flag it to revisit before your next loop.

Related Questions