What problem does it solve? Training large models exhausts GPU memory when parameters, gradients, and optimizer states are replicated on every device. This Skill provides expert guidance for PyTorch FSDP, which shards model state across data parallel workers to reduce per-device memory usage. ## Core Features & Use Cases - Parameter Sharding Guidance: Explains FSDP1 FullyShardedDataParallel and FSDP2 fully_shard APIs, including DTensor-based per-parameter sharding and bottom-up module application. - Distributed Communication Setup: Covers torch.distributed initialization, backend selection (NCCL, Gloo, MPI), device meshes, and the Join context manager for uneven inputs. - Memory and Performance Techniques: Documents mixed precision, CPU offloading, prefetching control, and communication/computation overlap for large-scale training. - Use Case: When migrating a multi-billion parameter model from DDP to FSDP2, use this Skill to correctly apply fully_shard layer by layer, configure the device mesh, and initialize the optimizer on DTensor parameters. ## Quick Start Ask how to shard a Transformer model across 8 GPUs using PyTorch FSDP2 fully_shard with mixed precision.