Log inStart free
LESSON 29.10 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

TTFT, TPOT and ITL

Follow one request on a busy GPU and time each token it writes.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 29.10 · SERVING BAYR2 · 4 REQUESTS · 16 TOKENS
01
Stage 1 of 5 · Latency
Latency is the time a user waits. Each lane is one request: a wait, a prefill, then one token per step.
Explain it simply

Each row is one request to a chatbot. Brick is waiting, and teal is the prefill, which reads the whole prompt. Each blue dot is one new token on the user's screen. On this toy GPU, every step reads the weights once, in 16 ms, and each prompt token adds a little.

4 request lanes on a time axis in ms, over a row of 17 GPU steps. R2 is sent at 10 ms and writes 16 tokens.

request, prefillwait, stretched gapoutput token, TTFT, E2EGPU step
R1–R4 on one GPUGPU0100200300400500 msITL50 msR1R2R3R4prefill step of R2: 16 + 0.06·60 + 0.5·1 = 20.1 msR1–R4 on one GPUGPU0100200300400500 msITL50 msR1R2R3R4prefill step of R2: 16 + 0.06·60 + 0.5·1 = 20.1 ms
Toy: the 29.C2 trace on one toy GPU
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Δt=16+0.06 P+0.5 B\sy{dt}{param}{\Delta t} = 16 + 0.06\,\sy{P}{data}{P} + 0.5\,\sy{B}{data}{B}
Δt=16+0.06⋅60+0.5⋅1=20.1 ms\Delta t = 16 + 0.06 \cdot 60 + 0.5 \cdot 1 = 20.1\ \text{ms}

A step costs 16 ms plus its prompt tokens and running sequences.

Common mix-ups

MYTHA long prompt makes each of its output tokens slow.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 10 requests sent instead of one, does the TTFT of R2 grow, shrink or stay the same?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.