Log inStart free
LESSON 29.C3 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

A scheduler under load

Watch one bursty trace run through a full scheduler.


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

Go Pro · $8.25/mo
EXPLAINER · 29.C3 · SCHEDULER13 REQUESTS · ALL DONE AT 832.3 MS
01
Stage 1 of 6 · Bursty trace
Three long batch prompts arrive first. Ten short chat prompts follow within 750 ms.
Explain it simply

Each row is one request, and time runs left to right. The squares are long batch prompts, and the dots are short chat prompts. All the prompts together hold 7,680 tokens, about 15 full steps of work. That work arrives in 750 ms, so the engine has no time to spare, and any delay piles up.

13 rows, one per request. Requests 1 to 3 are long batch prompts at 0 to 50 ms. Requests 4 to 13 are short chat prompts up to 750 ms. All requests finish at 832.3 ms.

request, prompt chunksoutput tokenswait, stall, redone workbudget, pool, targets, copiesKV away (swap)
0100200300400500600700800900100011001200ms1 A 2,0482 A 1,5363 A 2,0484 B 2565 A 1286 B 2567 A 1288 A 2569 B 25610 A 12811 A 25612 A 12813 B 256the trace, one row per requestprompts: 7,680 tokens = 15 full steps of 512 · all done at 832.3 ms0100200300400500600700800900100011001200ms1 A 2,0482 A 1,5363 A 2,0484 B 2565 A 1286 B 2567 A 1288 A 2569 B 25610 A 12811 A 25612 A 12813 B 256the trace, one row per requestprompts: 7,680 tokens = 15 full steps of 512 · all done at 832.3 ms
Toy: 13 requests, a 512-token budget, 24 KV blocks of 128 tokens
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
W=∑ipi\sy{w}{data}{W} = \sum_i \sy{p}{data}{p_i}
W=7,680=15⋅512 tokensW = 7{,}680 = 15 \cdot 512 \text{ tokens}

The prompt work is the sum of all prompt tokens.

Common mix-ups

MYTHChunked prefill keeps every token gap within one step.

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

Predict, then reveal
3 CHECKS · PRO
Q01With decodes first and reserve, pick priority. Does request 4 get its first token sooner?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 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.