Benchmarking guide
Make the speed claim reproducible
A useful benchmark answers a specific question: can this configuration produce acceptable outputs within the application’s time and cost limits? Define those limits before running the test so that a favorable result cannot quietly change the question.
Record the conditions
- Model identifier and revision, runtime version, and hardware.
- Input set, output dimensions, generation settings, and any fixed seeds.
- Concurrent requests, arrival pattern, and total requests attempted.
- Whether the timer includes waiting, transfers, and output decoding.
- The rules for accepting an output and handling failures.
Use a saved set of representative tasks rather than choosing a new prompt for each configuration. Run the comparisons under similar conditions, and repeat them to see how stable the difference is.
Separate startup from steady operation
Record startup behavior as its own result. For low-level PyTorch measurements, torch.utils.benchmark provides a timer that warms up execution and synchronizes asynchronous accelerator work when necessary. Those features help avoid timing only the dispatch of work. A model microbenchmark still needs a separate application-level test to measure the complete request.
Read the distribution
The median describes the middle of the observations. A higher percentile, such as p95, helps describe the slower end. Report sample count and percentile calculation method, and show timeouts separately so that failed requests do not disappear from the comparison.
In a hypothetical test, system A has a median of 800 milliseconds and a p95 of 4 seconds; system B has a median of 1 second and a p95 of 1.5 seconds. Neither summary alone determines the better choice. A strict interaction deadline could make B more suitable, while the decision still depends on quality, failures, and cost.
Publish enough context
Keep raw observations and the test specification with the summary. State what was measured, what was excluded, and whether the outputs met the same acceptance criteria. Connect the result to a latency budget and calculate cost per accepted output before choosing a deployment.