Unit 8 of 12 · about 5 hours · measure
Single-request baselines, concurrency and rate sweeps, and a shape matrix
One prompt at one concurrency is an anecdote. Sweeps over rate and shapes turn it into a baseline that later changes can be tested against.
You'll be able to
- Measure a single-request latency baseline with fixed lengths, warmup and raw per-request results.
- Sweep concurrency and request rate through saturation and report the knee, not the collapse.
- Cover a length-by-batch shape matrix with the workload contract fixed in every cell.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Phase and endpoint baselines with the bench CLIvLLM Benchmark CLI (v0.31.0)
Online Benchmark with the vllm bench serve example and its Serving Benchmark Result format; Offline Throughput Benchmark with the vllm bench throughput example; Load Pattern Control Parameters for request-rate, burstiness and max-concurrency
- Sweeps to the knee and past itTime to First Token - Measurement and Load-Testing Sessions
Week 5: the concurrency sweep at 1, 2 and 4 up to 128 with two-tool cross-checks, the session past 1000 concurrent runs, and the preemption-point decision rule
- Synthetic datasets with fixed shapesTensorRT-LLM Benchmarking Guide
Preparing a Dataset with the
task_id,promptorinput_idsandoutput_tokensschema, and thetoken-norm-distsynthetic example at input mean 128 with output mean 128 (page read 2026-10-05)
Focus on
- The single-request cell comes first and stays fixed: one prompt shape, warmed state, identical-output contract, raw per-request results kept.
- Sweep one variable at a time: concurrency with fixed rate, then rate with fixed concurrency. The knee where throughput stops rising while latency degrades is the result; points past preemption are not publishable.
- Every matrix cell fixes input length, output length, batch size, sampling and cache state. A cell that changes two of them explains nothing.
- Keep TTFT and ITL separate in every cell and every sweep. Blended latency hides whether the limit is prefill, decode or queueing.
Common mistakes · 3
- Measuring at the preemption point and reporting it as capacity. When waiting requests climb and TTFT spikes, stop and tune admission and chunking first.
- Sweeping with uniform synthetic lengths and claiming production coverage. Fixed shapes give comparability, but real distributions still need their own run.
- Changing output length across cells to save time. Shorter outputs do less decode work, so the cells are no longer comparable.
Try it yourself
Closed-book, before checking anything
vllm bench latency --input-len 32 --output-len 128 --batch-size 1.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What makes the single-request baseline a baseline rather than an anecdote?Answer
Fixed lengths, warmup, the identical-output contract and retained raw results, so any later change can rerun the same cell.
2.Throughput flattens while p99 climbs steeply with concurrency. Where are you?Answer
At the saturation knee. Report the knee; further points measure overload behavior, not serving capacity.
3.Why sweep rate and concurrency separately instead of together?Answer
They stress different limits: rate stresses arrivals and queueing, concurrency stresses resident batch and memory. Joint sweeps confound them.
4.What does vllm bench latency fix that vllm bench serve leaves open?Answer
Latency runs one fixed batch of fixed input and output lengths for phase timing. Serve replays arrivals over time for endpoint behavior under load.
You're done when
Your matrix reruns cell-for-cell with identical contracts, and you can point to the knee in your own sweep data.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 9 more in the section
- vLLM Benchmark CLI (v0.31.0)vLLM Project · required
Use
vllm bench latency,vllm bench throughputandvllm bench servefor phase and endpoint baselines. Fix the dataset, lengths, request rate, warmup and sampling, and keep the raw per-request results. - TensorRT-LLM Benchmarking GuideNVIDIA · support
Use Before Benchmarking and Online Serving Benchmarking as a reproducibility checklist. Borrow environment capture and startup metrics even if TensorRT-LLM is not the selected engine.
- Time to First Token - Measurement and Load-Testing SessionsPatchy631 · support
Use only Week 3 and Week 5 as a practical checklist for Prometheus, Grafana and request-rate sweeps. Follow the competency gate rather than its calendar, and replace fixed concurrency goals with your hardware-safe saturation range.
Also in this section
- Efficiently Scaling Transformer InferenceMLSys · primary
Read the prefill and decode cost, memory, batching and parallelism sections. Use its models to predict phase bottlenecks before measurement and record which assumptions fail on the selected model, engine and GPU.
- AI Systems Performance Engineering - Chapter 16, profiling and debugging inferenceChris Fregly (O'Reilly) · required
Read the first part of Chapter 16: monitoring system metrics, profiling with Nsight Systems and Nsight Compute, the troubleshooting recipes and debugging correctness. Treat every quoted speedup as a hypothesis for your own hardware.
- AI Systems Performance Engineering companion code - Chapter 16Chris Fregly · required
Begin with inference_profiling.py, inference_server_load_test.py, monitoring_bundle.py and runtime scheduler instrumentation. Run only hardware-compatible targets, retain raw artifacts and re-measure all bundled expectations on your own device.
- Hands-On LLM Serving and Optimization - Chapter 5 and the Chapter 4 metrics sectionChi Wang and Peiheng Hu (O'Reilly) · required
Read Chapter 5 on GPU specifications, model loading and arithmetic intensity in the prefill and decode phases, and "Measuring Performance in LLM Serving" in Chapter 4. Turn each claim into a prediction for one short-prompt and one long-prompt workload.
- vLLM Metrics Design and Production MetricsvLLM Project · required
Map scheduler and cache events to exported request, queue, TTFT, inter-token and generation metrics. The link is pinned to v0.31.0; check the definitions against the version you install.
- LLM Inference Systems Laboratory - InstrumentationRoadmap-Final · support
Complete Milestone B: correlate request, iteration, KV, scheduler, kernel and resource events, quantify observer overhead, and retain raw arrival and completion records.
- Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-ServeAgrawal et al. · support
Read arXiv v3, Chunked-prefills and Stall-free batching for the chunked-prefill vocabulary and the prefill-decode interference argument, and Overhead of chunked-prefills for the cost of splitting. Treat the reported capacity gains as the paper's result on its hardware.
- py-spy - sampling profiler for PythonBen Frederick · support
Use py-spy record to take CPU flame graphs of tokenizer and detokenizer work, and py-spy top to watch the hot functions live. Launch the profiled process under py-spy.
- vLLM SamplingParams API (v0.31.0)vLLM Project · reference
Look up
temperature,seed,max_tokens,ignore_eos,stopandstop_token_idsdefaults when you fix the output contract. The link is pinned to v0.31.0; check the fields against the version you install.