Lesson 1 · 7 topics · 25 min · intermediate
Measuring Inference: Latency, Throughput and Goodput
Start lessonYou will be able to
- Explain why streaming changes what a user waits for, and separate time to first token, time per output token and total latency in a measured stream.
- Measure a streamed reply by recording one timestamp per token, and derive TTFT, inter-token latency, TPOT and total latency from those timestamps.
- Treat latency as a distribution: read p50, p90 and p99 from 200 repeated runs, and explain why the mean misleads when there is a tail.
- Estimate a request's latency from measured prompt-length curves, stating the assumptions, and compare how much faster hardware helps short and long prompts.
- Distinguish total throughput from per-user throughput, and read the batching trade-off from measured CPU and GPU numbers.
- Define goodput against a latency objective (SLO) and compute it for a measured workload; explain why hidden tokens make time to publish differ from TTFT.
Topics
Your review
Sign in to keep your quick-check answers. The ones you miss come back for review after 1, 3 and 7 days, until they stick.
Sign in freeSources
AI Engineering · Chip Huyen, 2025
Chip Huyen. O'Reilly. Used: Ch. 9 "Inference Optimization", section "Inference Performance Metrics", subsections "Latency, TTFT, and TPOT" and "Throughput and goodput".
DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving · Yinmin Zhong et al., 2024
Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanzhe Liu, Xin Jin, Hao Zhang. OSDI 2024 (arXiv:2401.09670). Used: Abstract. Open source