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

Expert placement and hot experts

Watch hot experts overload one GPU, then spread them with placement and replicas.


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 · 31.03 · EXPERT BAY32 COPIES · MEAN 4 · HOT E3 9, E4 7
01
Stage 1 of 5 · Route tokens
The router sends each token to its top 2 experts. Experts 3 and 4 get 9 and 7 copies: they are hot.
Explain it simply

Each teal square is a token, and each ochre box is an expert. A ribbon joins a token to each of the 2 experts it picks. The tokens come from one text, so they look alike. The router sends many of them to the same few experts, and those experts get hot.

16 tokens on 4 GPUs send 32 copies to 8 experts. The loads of experts 1 to 8 are 0, 0, 9, 7, 6, 4, 2, 4. Experts 3 and 4 are hot.

Weights are random, not trained.
tokensexpertsGPU workhot, loads, bottleneckin host memory, idle
E10E20E39hotE47hotE56E64E72E8412345678910111213141516router picks 2 experts per tokenexperts, by number (copies)GPU 0GPU 1GPU 2GPU 3E10E20E39hotE47hotE56E64E72E8412345678910111213141516router picks 2 experts per tokenexperts, by number (copies)GPU 0GPU 1GPU 2GPU 3
Toy: 16 tokens, 8 experts, 4 GPUs, top 2; toy costs
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
ne=#{ t:e∈top2⁡(xt Wr) }\sy{n}{data}{n_e} = \#\{\, t : e \in \operatorname{top2}(\sy{x}{data}{x_t}\, \sy{wr}{param}{W_r}) \,\}
n3=9,nˉ=32/8=4n_{3} = 9,\quad \bar n = 32 / 8 = 4

An expert's load counts the tokens whose top 2 include it.

Common mix-ups

MYTHTwo experts on each GPU means equal work on each GPU.

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

Predict, then reveal
3 CHECKS · PRO
Q01At int8, if placement goes by load, does the step get shorter than 264 µs?

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.