3.3.11 · D1Deep Learning Frameworks

Foundations — Distributed training overview

1,985 words9 min readBack to topic

This page is the ground floor. The parent note Distributed training overview freely writes symbols like , , all-reduce, and . Here we build every one of them from nothing, in the order they depend on each other. If a symbol appears in the parent, it is defined below before you meet it again.


1. The training loop, in one picture

Everything in distributed training is a variation on one small loop. Meet it first as a picture, then we name each piece.

Figure — Distributed training overview

Let us walk the boxes left to right and earn every symbol.


2. The data: , , and

Picture as an arrow / a stack of dials, and as a single tag stuck to it.


3. The model and its dials: and

Figure — Distributed training overview

4. Measuring wrongness: the loss


5. The nudge direction: gradient

This is the symbol beginners fear most. It is just an arrow that points uphill.

Figure — Distributed training overview

6. The nudge itself: learning rate and the update rule


7. Batches: , , and averaging gradients


8. Talking between machines: the all-reduce

Figure — Distributed training overview

9. Speed and its symbols: , ,


10. How the foundations feed the topic

Data set D of x and y

Batch B of size b

Parameters theta

Forward pass f

Loss L

Gradient of L (backward pass)

Average gradient g

All-reduce across k devices

Update rule with eta

Speedup S vs comm time

Distributed training overview

Read top-down: data and dials meet in the forward pass, the loss scores it, the gradient says how to fix it, averaging + all-reduce lets many machines agree, the update rule applies the fix, and the speedup relation tells us how much we actually gained. That bundle is the parent topic.


Equipment checklist

Cover the answer and test yourself. If any line is fuzzy, re-read its section above before touching the parent note.

What does stand for, and is it copied or split in data parallelism?
The full set of model dials (weights/biases); in data parallelism it is copied to every device.
What does the symbol physically point toward on the loss landscape?
Straight uphill — the direction of steepest loss increase; we step the opposite way.
Why is there a minus sign in ?
Because the gradient points uphill and we want to descend, so we move opposite to it.
What is and what happens if it is too large?
The learning rate (step size); too large a step overshoots and can make loss blow up.
Why can a batch gradient be split across machines and re-averaged safely?
Because it is an average (a linear operation), so an average of partial averages equals the single big-batch gradient.
In plain words, what does an all-reduce do?
Combines every device's gradient into one summed/averaged result and gives that same result back to all devices.
In the speedup formula, which term stops from ever reaching ?
The communication time , which is added on and never shrinks with more devices.
What is the difference between and in one training pair?
is the input vector (the thing shown to the model); is the correct target answer for it.