Log inStart free
LESSON 11.13 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Pipeline parallelism

Watch microbatches flow through 4 GPUs that each hold one layer.


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 · 11.13 · PIPELINE BAY4 GPUS · LAYERS 1 | 2 | 3 | 4
01
Stage 1 of 6 · Split the layers
Pipeline parallelism puts whole layers on different GPUs. Here 4 GPUs hold 1 layer each.
Explain it simply

The model has 4 layers. Pipeline parallelism splits a model by its layers: each GPU gets whole layers. Here each of the 4 GPUs holds one layer. The lane at the bottom is one GPU with all 4 layers. Each layer takes 1.5 ms forward and 3 ms backward, so the step takes 18 ms.

4 GPU lanes on a time axis. GPU 0 holds layer 1. GPU 1 holds layer 2. GPU 2 holds layer 3. GPU 3 holds layer 4. The lane at the bottom shows 1 GPU with all 4 layers: 18 ms.

layersforwardbackwardidle timestep time
0369121518time (ms)GPU 0GPU 1GPU 2GPU 3L1L2L3L41 GPUlayers 1–4forwardbackward18 ms0369121518time (ms)GPU 0GPU 1GPU 2GPU 3L1L2L3L41 GPUlayers 1–4forwardbackward18 ms
Toy: the 11.C1 net, 4 layers, 8 samples
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
ns=4P\sy{n}{param}{n_s} = \tfrac{4}{\sy{P}{param}{P}}
ns=44=1n_s = \tfrac{4}{4} = 1

Each GPU holds 4 divided by P whole layers.

Common mix-ups

MYTH4 pipeline GPUs make each training step 4 times faster.

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

Predict, then reveal
3 CHECKS · PRO
Q01With 1 microbatch, how many GPUs work at the same moment?

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.