6.1.8 · D3Scaling & Efficient Architectures

Worked examples — Data parallelism and ZeRO optimization

2,551 words12 min readBack to topic

Everything below rests on the parent's master equations. Let us re-write them once, in plain words, so no symbol is used before it is named.


The scenario matrix

Every question this topic can throw at you falls into one of these cells. The worked examples below are each tagged with the cell(s) they cover.

# Cell class The tricky bit it tests
A Baseline vs stage plug into and compare
B Degenerate one GPU — does ZeRO save anything? (sign/zero-input analogue)
C Limit what floor does each stage approach?
D Tiny model when is ZeRO pointless? (activations dominate)
E Feasibility solve given GPU memory, solve for the minimum
F Communication cost vs , the 3× trade-off
G Efficiency word problem overlap compute & comms → wall-clock %
H Exam twist mixed: choose the cheapest stage that fits a constraint
Figure — Data parallelism and ZeRO optimization

The figure above plots against for a fixed model. Notice cells B and C are just the left edge () and the right tail () of these curves. Keep it in view.










Recall Self-test (reveal after guessing)

At , how much memory does ZeRO-3 save versus standard DP? ::: None — all schemes equal ; ZeRO is pure partitioning and needs to help. As , what floor does ZeRO-1 approach and why? ::: — params () and gradients () stay replicated in stage 1; only the optimizer block is sliced away. ZeRO-3 buys memory savings for how many times the communication? ::: Exactly (the vs ratio, independent of and ). When is ZeRO a bad choice? ::: When activations, not model state, dominate memory — then use Activation Checkpointing / Gradient Accumulation instead.


See also: Large Language Models Training for where these numbers get used at trillion scale, and AllReduce and Collective Communication for the mechanics of the factor.