How Fully Sharded Data Parallel (FSDP) works?
3-Second Blueprint (English)
- Unlike DDP, which replicates full models per GPU, FSDP shards parameters, gradients, and Adam optimizer states across workers.
- FSDP runs All-Gather to reconstruct layer weights before forward/backward passes, then Reduce-Scatters gradients and frees unsharded data.
- Efficient training requires architecture-aware Transformer layer wrapping policies, while partial layer freezing needs custom handling.
PyTorch FSDPAll-Gather / Reduce-ScatterDistributed GPU TrainingOptimizer Sharding
3-Sekunden-Fazit (Deutsch)
- Anders als DDP verteilt FSDP Modellparameter, Gradienten und Adam-Optimizer-Zustände speichersparend als Shards über alle GPUs.
- Vor Forward/Backward holt All-Gather die Layer-Gewichte zusammen; danach verteilt Reduce-Scatter die Gradienten und gibt VRAM frei.
- Für hohe Effizienz sind architekturspezifische Wrapping-Policies (z. B. pro Transformer-Block) nötig; Teil-Freezing erfordert Zusatzcode.
PyTorch FSDPAll-Gather / Reduce-ScatterVerteiltes GPU-TrainingOptimizer-Sharding
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.