What problem does it solve?
It resolves confusion and performance pitfalls when setting up and operating Fully Sharded Data Parallel (FSDP) training in PyTorch, especially around parameter sharding, mixed precision, CPU offloading, and the FSDP2 (fully_shard) workflow.
Core Features & Use Cases
- FSDP configuration guidance: Helps you reason about how parameter sharding, precision settings, and CPU offloading affect memory and throughput.
- FSDP2 (fully_shard) operational model: Explains the pre-forward/backward all-gather and post-forward/backward free/reshard steps so you can implement training correctly.
- Distributed setup and debugging context: Provides supporting knowledge for distributed collectives (e.g., torch.distributed backends and initialization) that commonly impacts FSDP stability.
Use case: You’re training a large Transformer and need to reduce GPU memory usage while keeping communication correct; you want guidance for using FSDP2 (fully_shard) and understanding when parameters are all-gathered and freed during forward/backward.
Quick Start
Use the pytorch-fsdp skill to get an end-to-end explanation of how to apply PyTorch FSDP2 (fully_shard) to your model and what to expect during pre-forward/backward and post-forward/backward hooks.