SCENE 16 / 24 · SERVING MIDDLEWARE, FRAMEWORKS & SCHEDULING
Never leave a slot empty
A request finishes? Swap the next one in mid-generation.
MAKESPAN · 15 STEPSNEW ARRIVALS JOIN MID-FLIGHT
Static batching locks the group until the longest request finishes — padding wastes slots and arrivals wait outside. Continuous batching swaps finished requests for queued ones at iteration boundaries, which is why modern servers keep GPUs busy.
Static batching waits for every request in a batch to finish, padding finished sequences with zero-tokens until the longest request completes. Continuous batching (or iteration-level scheduling) operates per iteration: when a request emits [EOS], its slot is immediately reclaimed and a new request from the queue enters mid-generation.
Iteration-Level Scheduling
Instead of scheduling batch-by-batch, the engine reschedules the batch slots before every single decode step. Finished requests leave; queued prompts step into prefill or decode.
Zero Padding Waste
Because sequences are decoupled, padding tokens drop to zero. Memory and compute that would have been wasted on pad tokens become real generated tokens.
Synergy with PagedAttention
Dynamic slot swapping is only possible when KV memory can be allocated and freed in non-contiguous chunks — continuous batching relies directly on PagedAttention underneath.