Chip Foundry Services Request Assessment

Batch

Batching and throughput optimization represents the operational discipline of aggregating disparate inference requests into synchronized parallel tensor operations, amortizing fixed memory-loading costs across multiple input streams to maximize hardware compute utilization. In standalone single-sequence generation, modern high-density GPUs (such as the NVIDIA H100) operate at less than 5% of their peak arithmetic capacity during autoregressive decoding: because each generated token requires reading every single layer weight from high-bandwidth memory (HBM) into on-chip SRAM just to compute a single vector-matrix product, execution is ruthlessly memory-bandwidth bound. Batching transforms these memory-bound vector-matrix multiplications ($y = Wx$) into compute-bound matrix-matrix multiplications ($Y = WX$), allowing the GPU's thousands of Tensor Cores to reuse loaded weights across $B$ concurrent sequences. Modern production serving architectures have evolved through four distinct generations: rigid static batching (padding requests to a uniform length and stalling until all sequences finish), dynamic batching (accumulating requests within a temporal timeout window), continuous or iteration-level batching (evicting completed sequences and inserting new prompts on every single decoding iteration), and disaggregated chunked-prefill architectures that physically isolate compute-bound prompt encoding from memory-bound autoregressive decoding. At a systems engineering level, the dynamic lifecycle of request scheduling, iteration-level slot allocation, and memory paging functions like this:

Asynchronous request ingestion
HTTP/gRPC API streams incoming prompts with heterogeneous sequence lengths
Tokenization & prompt queue
Fast Rust/C++ BPE encoders tokenize text into integer sequence tensors
Iteration-level continuous batching schedulerDynamic iteration step executed every 15-30ms
Chunked-prefill allocation
Partitions large prompt matrices into 512-token tiles to prevent decode stalls
PagedAttention virtual mapping
Maps physical KV cache pages in HBM dynamically without memory fragmentation
↻ Continuous 10x throughput serving loop
Instant slot eviction & injection
Releases pages of EOS tokens immediately; schedules new waiting prompts in the next cycle
Batched Tensor Core execution
Fuses multi-sequence matrix multiply-accumulate operations into single kernel launches
Detokenization & streaming SSE
Decoded tokens converted back to text and pushed over server-sent events
SLA & latency monitoring
Real-time tracking of Time-to-First-Token (TTFT) and Inter-Token-Latency (ITL)

A few principles are essential for understanding how batching dictates serving economics, why iteration-level scheduling eliminates execution bubbles, and how physical memory paging prevents catastrophic allocation failures:

Static batching wastes hardware capacity through sequence padding and execution bubbles. In legacy static batching frameworks, requests arriving within a brief time window are grouped into a fixed-dimension tensor $[B, S_{\text{max}}]$. Because real-world user queries exhibit extreme length heterogeneity (e.g., a 50-token query mixed with a 1,500-token document extraction), all sequences must be padded with dummy tokens to match the longest sequence. This structural rigidity introduces two catastrophic sources of efficiency collapse:
1. *Memory Padding Waste:* The GPU must compute attention matrices and store empty KV cache states for padding tokens, wasting up to 60% of available high-bandwidth memory on meaningless zeros.
2. *Execution Bubbles:* When shorter sequences generate an end-of-sequence (`<EOS>`) token early, their execution slots sit completely idle while the GPU continues running iterations for the single longest remaining sequence. New incoming queries cannot enter the batch, forcing GPU utilization to decay monotonically until the entire batch concludes. The timeline of this bubble waste is contrasted below:

Continuous Batching: Iteration-Level Dynamic Scheduling eliminating static padding bubbles by dynamically evicting finished sequences and inserting new requests at each token iteration GPU Slot 1: Req 1 (Tokens 0–100) ➔ Req 4 Inserted Instantly (Tokens 101–500) GPU Slot 2: Req 2 (Tokens 0–250) ➔ Req 5 Inserted GPU Slot 3: Req 3 Long Generation (Tokens 0–500) Zero Idle Bubble Waste (Orca / vLLM Continuous Engine) • In static batching, Slot 1 & Slot 2 remain idle up to 80% of total latency waiting for Req 3 • Continuous batching achieves 3×–5× higher serving throughput and eliminates queuing delays Decoding Iterations (Time Step t) → Step 0 Step 100 Step 250 Step 500 Iteration-level scheduling evicts finished tokens dynamically, maintaining near 100% GPU tensor core utilization

Continuous batching and PagedAttention resolve memory fragmentation. Pioneers of continuous batching (introduced in Orca and productionized by vLLM) recognized that token generation occurs incrementally step-by-step. Instead of scheduling requests at the coarse granularity of entire conversations, the serving engine executes scheduling decisions at each individual forward iteration:
- *Iteration-Level Scheduling:* As soon as a request generates an `<EOS>` token, its computational slot is vacated immediately, and an incoming prompt waiting in the queue is seamlessly spliced into the batch on the very next token iteration.
- *Virtual Memory KV Cache Paging:* In traditional serving, memory for a request's maximum potential sequence length (e.g., 4,096 tokens) had to be allocated contiguously in HBM upfront. Because actual sequence lengths cannot be predicted in advance, up to 70% of memory was locked in over-allocated internal fragmentation. PagedAttention borrows the classic operating system concept of virtual memory with page tables: KV cache states are partitioned into small, fixed-size physical blocks (typically 16 or 32 tokens per block). Logical pages map to physical blocks dynamically allocated on demand from a global block pool, slashing memory fragmentation to below 4% and enabling identical prefix prompt sharing across users:

PagedAttention: Virtual Memory KV Cache Architecture mapping logical sequence tokens to non-contiguous physical HBM blocks to eliminate fragmentation and over-allocation waste Logical KV Blocks (Continuous Request) Logical Block 0 Logical Block 1 Logical Block 2 16 tokens / block Block size B = 16 Block Translation Table (Page Table Mapping) Log 0 ➔ Phys 7 Log 1 ➔ Phys 3 Log 2 ➔ Phys 12 Dynamic pointer map Zero Over-Allocation Physical HBM Pool (Scattered GPU RAM) Physical Block 3 Physical Block 7 Physical Block 12 Non-contiguous pages Memory waste < 4% PagedAttention models OS paging inside GPU HBM, shrinking KV-cache memory waste from 70% to under 4%

The operational trade-offs of serving configurations. Choosing a batching strategy requires navigating the fundamental trade-off between batch throughput (tokens per second per GPU) and individual user latency (Time-to-First-Token and Inter-Token Latency):

Batching FrameworkScheduling GranularityMemory ManagementGPU Hardware UtilizationTypical Serving Throughput (Tokens/sec)Average Inter-Token Latency (ITL)
Single-Request ServingRequest-level (FIFO)Static contiguous arrayPoor ($<10\%$ Tensor Core utilization)50–85 tokens/sec15–20 ms/token (Fastest)
Static Batching ($B=8$)Request-level batchPadded contiguous matrixSub-optimal ($20–35\%$) due to idle bubbles250–400 tokens/sec35–45 ms/token
Dynamic Batching ($B=16$)Temporal timeout windowPadded contiguous matrixModerate ($40–50\%$)500–750 tokens/sec50–65 ms/token
Continuous Batching ($B=32$)Iteration / token levelFixed chunk allocationsHigh ($65–80\%$)900–1,400 tokens/sec45–60 ms/token
PagedAttention + vLLM ($B=64+$)Dynamic iteration stepNon-contiguous virtual pagingMaximum ($85–95\%$)1,800–2,800 tokens/sec55–75 ms/token

Disaggregated prefill and chunked execution. Modern frontier serving architectures resolve the interference between the compute-heavy prompt encoding phase (prefill) and the memory-bandwidth-bound token generation phase (decode):
- *The Prefill-Decode Clash:* A long 4,096-token prefill computation requires large matrix multiplications that saturate all SM ALUs for hundreds of milliseconds. If scheduled alongside active decoding streams, it causes severe jitter and spikes Inter-Token Latency (ITL) for streaming users.
- *Chunked Prefills and Prefill-Decode Disaggregation:* Frameworks like Sarathi-Serve and modern vLLM split incoming prompt prefills into discrete chunks (e.g., 512 tokens). These chunks are co-scheduled with ongoing decode steps, flattening compute surges. In bleeding-edge clusters, prefill and decode are physically disaggregated onto separate GPU worker pools connected via high-speed RDMA networks: dedicated prefill nodes process initial prompts at maximum compute density, then stream the completed KV cache states across InfiniBand to dedicated decoding nodes optimized purely for memory bandwidth.

Read batching through a *memory-bandwidth-amortization* lens rather than a *simple-concurrency* lens: on modern AI silicon, the cost of fetching model weights from HBM to SM registers is identical whether generating a token for 1 user or 32 users simultaneously. Batching is the operational lever that shifts execution from being throttled by the memory bus to being fully accelerated by arithmetic Tensor Cores. Without continuous batching and virtual memory paging, even the most powerful datacenter accelerator spends over 80 percent of its time waiting on idle memory lines; with them, the exact same hardware serves an order of magnitude more concurrent requests at a fraction of the cost per token.