Log inStart free
LESSON 11.16 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Compute/communication overlap

Watch transfers slide under compute, and see which waits remain.


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

Go Pro · $8.25/mo
EXPLAINER · 11.16 · OVERLAP BAYAG 2.5 MS · FORWARD 1.5 MS
01
Stage 1 of 6 · One layer
Before layer 1 runs, an AllGather brings its weights in 2.5 ms. Layer 1 then computes for 1.5 ms.
Explain it simply

Each GPU keeps only a quarter of every layer's weights. Before a layer runs, the GPU fetches the other three quarters over the links. Here the fetch takes 2.5 milliseconds, and the math takes 1.5. The fetch uses the links, so the math units could do other work at the same time.

One stream, layer 1 only. The AllGather AG1 takes 2.5 ms on the transfer row. Then the forward F1 takes 1.5 ms.

forwardbackwardAllGather, ReduceScatterGPU waits
one streamcomputetransfers012345678mstime in the stepAG1 · 2.5 msF1 · 1.5 msone layert_AG = 1 + ¾ · 20 MB / 10 GB/s = 2.5 ms > t_F = 1.5 msone streamcomputetransfers012345678mstime in the stepAG1 · 2.5 msF1 · 1.5 msone layert_AG = 1 + ¾ · 20 MB / 10 GB/s = 2.5 ms > t_F = 1.5 ms
Toy: the 4 layers of 11.10, 20 MB each, sharded over 4 GPUs; ring transfers, 1 ms each to start; backward 3 ms per layer at 4 samples per GPU
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
tAG=α+N−1N⋅Sβ\sy{tc}{out}{t_{\text{AG}}} = \alpha + \frac{N-1}{N}\cdot\frac{S}{\beta}
tAG=1+34⋅2010=2.5 ms,tF=1.5 mst_{\text{AG}} = 1 + \tfrac{3}{4}\cdot\tfrac{20}{10} = 2.5\,\text{ms},\quad t_F = 1.5\,\text{ms}

A gather costs a fixed start plus its bytes over the link speed.

Common mix-ups

MYTHOverlap makes communication free.

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

Predict, then reveal
3 CHECKS · PRO
Q01At 10 GB/s, does the two-stream GPU wait more or less with 8 samples per GPU than with 4?

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 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.