Predict the throughput and per-request latency behaviour as batch size grows past saturation
A serving system measures the following on an H100 with a 7B model: - At batch=1: throughput = 80 tok/s, TPOT (per-request) = 12.5 ms/tok - At batch=8: throughput = 600 tok/s, TPOT = 13.3 ms/tok - At batch=32: throughput = 2200 tok/s, TPOT = 14.5 ms/tok - At batch=128: throughput = 6400 tok/s, TPOT = 20 ms/tok - At batch=256: throughput = ? - At batch=512: throughput = ? The critical batch (compute roof) is reached around batch=128. Predict the throughput and TPOT for batch=256 and batch=512, given that the system is now compute-bound. Express each throughput as tokens/second and each TPOT in ms/tok.
Past the compute roof throughput plateaus near 7000 tok/s, so batch=256 and batch=512 barely climb, while per-request TPOT grows linearly to roughly 37 ms and 73 ms.
Picture a bus that leaves the stop on a fixed timer no matter how full it is. While seats are empty, adding riders is free: more people move per trip and nobody waits longer. That is the memory-bound phase, where serving more requests per step lifts throughput almost linearly. Once every seat is full, the bus is at capacity. Cramming more people aboard does not move them any faster, the trip still takes the same time, so the count delivered per hour stops rising. That is the compute roof. Worse, the extra riders have to wait for room, so each person's door to door time grows. For an LLM server, adding requests past saturation means each request waits longer for its next token while total throughput barely budges.
Detailed answer & concept explanation~8 min readEverything 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. 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.
Verify the bandwidth-slope scaling from the measured points, locate the elbow at batch=128, project throughput and TPOT past saturation, then state the production rule of capping batch just below the critical batch to protect tail latency.
| Batch | Throughput (tok/s) | TPOT (ms/tok) | Regime |
|---|---|---|---|
| 1 | 80 | 12.5 | Bandwidth-bound |
| 8 | 600 | 13.3 | Bandwidth-bound |
| 32 | 2200 | 14.5 | Bandwidth-bound |
| 128 | 6400 | 20 | Near compute roof |
| 256 | ~7000 | ~37 | Compute-bound |
| 512 | ~7000-7400 | ~73 | Compute-bound |
Real products, models, and research that use this idea.
- vLLM exposes max_num_seqs (commonly 256 on H100), set just below the critical batch so continuous batching maximizes throughput without wrecking tail latency.
- TensorRT-LLM and Hugging Face TGI both ship max-batch caps in the 128 to 256 range as production defaults for 7B class models.
- Anyscale's LLMPerf benchmarks plot exactly this knee for Llama 4 on H100, showing throughput flattening while TPOT climbs.
- SGLang serving Qwen 3 under burst load uses the same cap below the elbow policy to keep P99 time per token bounded.
What an interviewer would ask next. Try answering before peeking at the approach.
QCompute the critical batch for a 7B model on H100 from first principles.
QHow does enabling INT4 weight quantization move the curve?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Extrapolating the early near-linear region forever and predicting batch=256 doubles throughput to about 12800 tok/s. Past the roof throughput is flat; only latency moves.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.