PyTorch FSDP2 Distributed Training
Implements advanced PyTorch FSDP2 sharding and distributed checkpointing for efficient large-scale model training.
This skill provides specialized guidance for implementing PyTorch FSDP2 (Fully Sharded Data Parallel 2) to train models that exceed single-GPU memory limits. It ensures the correct application of DTensor-based sharding through bottom-up module wrapping, manages complex mixed-precision and CPU offload policies, and configures robust Distributed Checkpointing (DCP). By following modern PyTorch best practices, this skill helps developers avoid common distributed training pitfalls such as incorrect optimizer initialization or desynchronized gradient accumulation.
主な機能
013,983 GitHub stars
02Automated bottom-up fully_shard module wrapping for optimal memory efficiency
03Advanced mixed precision (BF16/FP16) and CPU offload policy configuration
04Parallel Distributed Checkpointing (DCP) for high-performance state management
05Standardized torchrun environment setup and rank-aware device initialization
06DTensor-based parameter sharding with DeviceMesh and multi-dimensional parallelism support
ユースケース
01Modernizing legacy DDP or FSDP1 scripts to use the more inspectable DTensor-based FSDP2 stack
02Scaling deep learning training across multi-node GPU clusters using NCCL backends
03Training Large Language Models (LLMs) that exceed the VRAM capacity of a single GPU