Fill in the DeepSpeed config keys that select a ZeRO stage
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The key is `zero_optimization.stage`, value 1, 2, or 3. Higher stages shard more training state across GPUs at the cost of more cross-GPU communication.
Imagine eight friends carrying a giant tent to a campsite. The smallest version of the trick is each friend just carries an equal share of the tent poles, and when it is time to pitch, they pass poles around as needed. A bigger version of the trick has them split not just poles but also the assembly instructions, so each person knows their slice. The biggest version splits the tent fabric itself, so no one person ever carries the whole thing. Each step saves more weight on each friend's back, but it also means more passing things back and forth at setup time. The DeepSpeed config has one knob that names which of these three sharing levels you want.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: name the exact key path, walk through what each stage shards, then cover the communication tradeoff and when offload helps or hurts.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Setting stage 3 by default without measuring throughput. The all-gather of parameters every step can dominate runtime on slow interconnects and erase the memory savings.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.