Menu

1 / 3

What are DeepSpeed ZeRO stages 1, 2 and 3?

DEV Community: pytorch·Viswaretas Kotra·5 days ago
#FIPu0MZg
#devtopytorch#devto#dev#zero#stage
Long article (2023 words) — no AI summary yet.
Reading 0:00
15s threshold

DeepSpeed ZeRO stages 1, 2 and 3 split a model's training state across GPUs: stage 1 splits the Adam optimizer state, stage 2 also splits the gradients, and stage 3 also splits the weights. On Nodus, the stage decides the hardware: by our math a 70B full fine-tune fits 8 x NVIDIA B200 at $44.00/hr with ZeRO-3, or 8 x NVIDIA H100 at $20.80/hr with ZeRO-3 and the optimizer in CPU memory. Only ZeRO-3 keeps cutting per-GPU memory as you add GPUs, and it moves 1.5 times as much data per step as stages 1 and 2.

This post is the memory and config reference for the stages themselves. If you are choosing between DeepSpeed and PyTorch FSDP, read our FSDP vs DeepSpeed guide . If you are new to sharding, start with FSDP vs DDP .

What does each ZeRO stage split across GPUs?

Each stage removes one more copy that plain data parallelism keeps on every GPU.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.