June 2026
Intermediate
558 pages
13h 48m
English
Extending memory capacity and sharding computation for very large models
The future is already here. It's just unevenly distributed.
William Gibson, Writer
In the previous chapter, we explored FSDP—PyTorch's approach to sharding parameters, gradients, and optimizer states across GPUs. FSDP2's full sharding is functionally equivalent to DeepSpeed's ZeRO Stage 3[1]: both eliminate memory redundancy by ensuring each GPU holds only 1/N of the training state.
State sharding solves the memory problem, but it doesn't change how computation happens. Every GPU still executes the same operations on the same model architecture—just with different data batches. For the largest models ...
Read now
Unlock full access