Log inStart free
LESSON 32.C2 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Diagnosing a slow request

Four yes-or-no questions on one trace find why a request is slow.


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 · 32.C2 · TRIAGE BAYR5 TPOT 1,123 µs · HEALTHY 342 µs
01
Stage 1 of 5 · Time per token
R5 gets one token per step, so its TPOT is the step time. It is 1,123 µs against a healthy 342 µs.
Explain it simply

R5 is one of 16 requests that decode together. Each step makes one new token for each of them, so R5 waits one step for every token. The first question compares this step with a healthy step. It must be more than 10 percent slower to count as slow.

A trace of one decode step on rank 0, 1,123 µs long, and a decision tree below it. The healthy step ends at 342 µs. The first question answers yes.

kernels, pathtoken copiesweight copy, healthy stepidle and waitsCPU work
trace of rank 0 · Slow CPUCPU · rank 0GPU 0memcpy02004006008001,000healthy 342 µsstep 1,123 µsStep too slow?1,123 > 376 µsMostly GPU idle?Waits for a copy?Sync in the step?Waits for peer?Step is fine29.1529.01Slow weight copy31.0129.03Sync stalls CPU32.04CPU launches late32.04Late peer GPU31.01Compute-bound29.0127.0229.14yesnoyesnoyesnoyesnoyesnotrace of rank 0 · Slow CPUCPU · rank 0GPU 0memcpy02004006008001,000healthy 342 µsstep 1,123 µsStep too slow?1,123 > 376 µsMostly GPU idle?Waits for a copy?Sync in the step?Waits for peer?Step is fine29.1529.01Slow weight copy31.0129.03Sync stalls CPU32.04CPU launches late32.04Late peer GPU31.01Compute-bound29.0127.0229.14yesnoyesnoyesnoyesnoyesno
Toy: one decode step of 16 requests on 2 GPUs, six traces
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
tstep>1.1 thealthy\sy{step}{out}{t_{\text{step}}} > 1.1\,\sy{h}{param}{t_{\text{healthy}}}
1,123.0>1.1×342.2=376.41{,}123.0 > 1.1 \times 342.2 = 376.4

The step is slow if it is over 10% longer than healthy.

Common mix-ups

MYTHA busy GPU means the step is healthy.

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

Predict, then reveal
3 CHECKS · PRO
Q01With the weights offloaded, does the tree take the idle branch or the busy branch?

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.