distributed/FSDP2/README.md
To run FSDP2 on transformer model:
cd distributed/FSDP2
pip install -r requirements.txt
torchrun --nproc_per_node 2 example.py
To enable explicit prefetching
torchrun --nproc_per_node 2 example.py --explicit-prefetch
To enable mixed precision
torchrun --nproc_per_node 2 example.py --mixed-precision
To showcase DCP API
torchrun --nproc_per_node 2 example.py --dcp-api
see https://pytorch.org/get-started/locally/ to install at least 2.5 and ideally a current nightly build.