← All questions
Training & Fine-tuningMedium· FSDP· ZeRO· Memory Optimization

What is FSDP and when would you use it instead of DDP?

FSDP shards the entire model state (parameters, gradients, and optimizer states) across all GPUs. While it is essential for fitting massive models that exceed HBM, it comes with a cost: network utilization increases to 3x compared to DDP’s 2x, and there is a risk of compute bubbles if AllGather latency is not effectively hidden by prefetching.

Code playground (Python)