Continuous Batching
Continuous batching is an inference scheduling technique that adds and removes requests from a GPU batch every decoding step, instead of waiting for all requests in a static batch to finish.
AIDOLS Research Team · Editorial standards
Full definition
Static batching wastes GPU cycles because short requests sit idle waiting for long ones. Continuous batching (also called iteration-level scheduling, introduced in Orca, OSDI 2022) evicts finished requests every step and admits new ones into the freed slots. Orca reported 36.9x the throughput of NVIDIA FasterTransformer at the same latency on GPT-3 175B; in Anyscale's 2023 benchmark, continuous batching alone delivered up to 8x the throughput of naive static batching, and up to 23x combined with vLLM's paged attention, while also lowering median latency.
Why it matters
Continuous batching is now table stakes for any serious LLM inference stack (vLLM, TensorRT-LLM, SGLang, TGI). Buyers comparing self-hosted GPU economics should ask which serving engine the vendor uses; teams still on static batching can pay several times more per token on the same hardware (Anyscale measured 8x the throughput from continuous batching alone over naive static batching, and up to 23x with vLLM).
Example
A SaaS company switches from a custom Triton server to vLLM for Llama 3 70B serving; throughput rises from 600 to 4,800 tokens/sec on the same 8xH100 node, cutting cost per million tokens eightfold, from about $11.57 to $1.45 at $25/hr for the node.
Next steps
Related terms
- Paged AttentionPaged attention is a KV-cache memory-management technique that stores attention keys and values in fixed-size blocks, addressed via a page table — analogous to virtual memory in operating systems.
- KV CacheThe KV (Key-Value) cache stores the attention keys and values from already-processed tokens so an LLM can generate each new token without recomputing past work — the single largest consumer of GPU memory during LLM inference, and the primary lever for serving throughput.
- Model ServingModel serving is the runtime infrastructure that hosts a trained model and exposes it as an API for low-latency online inference at scale, handling batching, autoscaling, GPU sharing, versioning, and routing.
- Inference CostInference cost is the dollar cost of running a trained AI model in production — per request, per user, or per business outcome — and the operating expense that determines whether an AI feature has positive unit economics at scale.
More infrastructure terms
- Model ParallelismModel parallelism is a distributed-training and inference technique that splits a single neural network across multiple devices when the model does not fit on one device, in contrast to data parallelism (which replicates the model).
- Tensor ParallelismTensor parallelism is a model-parallelism strategy that splits individual matrix multiplications across multiple GPUs along the hidden dimension, recombining results with all-reduce or all-gather collectives.
Source & further reading
Primary source: Yu et al. — "Orca: A Distributed Serving System for Transformer-Based Generative Models" (OSDI) (2022).
Citation policy: this entry is part of the AIDOLS AI Implementation Glossary and may be quoted for research, journalism, and education with attribution to aidolsgroup.com/en/glossary/continuous-batching/.