pytorch-fsdp

Configure PyTorch FSDP training with parameter sharding and CPU offloading.

1|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/Signmanal/VIGIL --skill pytorch-fsdp-signmanal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/Signmanal/VIGIL/tree/main/optional-skills/mlops/pytorch-fsdp
Command: npx skills add https://github.com/Signmanal/VIGIL --skill pytorch-fsdp-signmanal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Training large PyTorch models across multiple GPUs or nodes requires complex configuration of parameter sharding, communication backends, and memory optimization to avoid out-of-memory errors and training hangs, which is error-prone even for experienced machine learning engineers.

Core Features & Use Cases

  • FSDP1 & FSDP2 Support: Covers both legacy FSDP1 flat-parameter sharding and modern FSDP2 per-parameter sharding, including step-by-step migration guidance between the two versions.
  • Distributed Training Configuration: Provides guidance on backend selection (NCCL, Gloo, etc.), process group initialization, uneven input handling, and mixed precision setup for stable multi-node training.
  • Use Case: A machine learning engineer training a 70B parameter language model on a 16-GPU cluster can use this skill to correctly configure FSDP2 sharding, enable CPU offloading, and resolve common collective communication errors.

Quick Start

Use the pytorch-fsdp skill to configure FSDP2 with per-parameter sharding and CPU offloading for your 13B parameter transformer model to fit training on 8 GPUs.

Frequently Asked Questions about pytorch-fsdp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure FSDP for large-scale PyTorch distributed training without getting out-of-memory errors?

Configure FSDP for large-scale PyTorch distributed training by applying parameter sharding across GPU clusters, enabling mixed precision optimization, and setting up CPU offloading to reduce memory consumption and avoid out-of-memory errors.

How do I migrate from FSDP1 to FSDP2 for per-parameter sharding in PyTorch?

Migrate from FSDP1 to FSDP2 by transitioning from legacy flat-parameter sharding to modern per-parameter sharding, utilizing step-by-step migration guidance to update your distributed training configuration and sharding logic.

What is the best way to set up multi-node distributed training and select communication backends for PyTorch?

Set up multi-node distributed training by initializing process groups and selecting appropriate communication backends like NCCL or Gloo, ensuring stable collective communication and proper uneven input handling across GPU clusters.

Can I train a 70B parameter language model on a 16-GPU cluster using PyTorch FSDP?

Yes, you can train a 70B parameter language model on a 16-GPU cluster by correctly configuring FSDP2 sharding, enabling CPU offloading, and applying mixed precision to fit the model within available GPU memory.

Why does PyTorch FSDP training hang or fail during collective communication across multiple nodes?

PyTorch FSDP training hangs or fails due to incorrect communication backend selection, improper process group initialization, or unhandled uneven inputs, which disrupt collective communication across distributed GPU clusters.