pytorch-fsdp

Guide PyTorch FSDP training with parameter sharding, mixed precision, and CPU offloading.

Updated May 20, 2026
One-click install
npx skills add https://github.com/SriRamkunamsetty/SITA2.0-HermesAgent --skill pytorch-fsdp-sriramkunamsetty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/SriRamkunamsetty/SITA2.0-HermesAgent/tree/main/hermes-agent/optional-skills/mlops/pytorch-fsdp
Command: npx skills add https://github.com/SriRamkunamsetty/SITA2.0-HermesAgent --skill pytorch-fsdp-sriramkunamsetty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables developers to implement, tune, and troubleshoot Fully Sharded Data Parallel training with PyTorch FSDP, including per-parameter sharding, mixed precision, and CPU offloading, for large-scale models.

Core Features & Use Cases

  • Guidance on FSDP2 concepts: sharding, replication, and parameter management across devices.
  • Performance best practices: memory budgeting, mixed precision, and CPU offloading strategies for efficient training.
  • Migration and debugging: strategies for migrating from FSDP1 to FSDP2 and diagnosing common bottlenecks in distributed training.

Quick Start

Run a small neural network with PyTorch FSDP2 to validate sharding and training performance.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
What is fully sharded data parallel training in PyTorch and when do I need it?

Fully sharded data parallel training shards parameters across devices to reduce memory usage per GPU. You need it for large-scale deep learning models that exceed single GPU memory limits during distributed training.

How do I migrate my distributed training code from FSDP1 to FSDP2?

Migrating from FSDP1 to FSDP2 involves updating parameter management and sharding strategies to the new per-parameter sharding architecture. Migration strategies and debugging tips for diagnosing common bottlenecks are covered.

Can I use CPU offloading and mixed precision together for memory optimization in PyTorch?

Yes, CPU offloading and mixed precision can be combined for memory optimization. Performance best practices include configuring memory budgeting, mixed precision settings, and CPU offloading strategies for efficient training.

Does PyTorch FSDP work with torch.distributed and device mesh configurations?

PyTorch FSDP integrates with torch.distributed and device mesh configurations to manage sharding, replication, and parameter management across devices in large-scale distributed training scenarios.

Why is my PyTorch FSDP2 training not scaling efficiently across devices?

Inefficient scaling often stems from suboptimal memory budgeting, mixed precision settings, or device mesh configurations. Diagnosing common bottlenecks in distributed training requires analyzing parameter sharding and CPU offloading strategies.