pytorch-fsdp

Guide PyTorch FSDP2 training pipeline configuration, sharding, and migration.

174|23|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/RedWoodOG/Hermes-Desktop --skill pytorch-fsdp-redwoodog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/RedWoodOG/Hermes-Desktop/tree/main/skills/mlops/training/pytorch-fsdp
Command: npx skills add https://github.com/RedWoodOG/Hermes-Desktop --skill pytorch-fsdp-redwoodog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch>=2.0, transformers, and includes references (resource) components.

What problem does it solve?

Streamlines expert guidance for building and optimizing Fully Sharded Data Parallel (FSDP) training with PyTorch, helping teams manage memory, scaling, and performance.

Core Features & Use Cases

  • Guidance on parameter sharding, mixed precision, and CPU offloading with FSDP2.
  • Practical strategies for large-scale distributed training, debugging, and migrating from FSDP1.
  • Real-world use cases and best practices for deploying memory-efficient training pipelines.

Quick Start

Tell me how to configure an FSDP training run for my model, including mesh setup, shard layout, and precision settings.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I configure PyTorch distributed training with FSDP2?

To configure distributed training with FSDP2, define the device mesh, establish the parameter shard layout, and apply mixed precision settings. This setup ensures memory-efficient scaling across your distributed environment.

What is the best way to optimize memory management during large-scale PyTorch distributed training?

The best way to optimize memory management during large-scale distributed training is applying parameter sharding strategies and CPU offloading. FSDP2 enables memory-efficient pipelines by sharding model parameters across devices to prevent out-of-memory errors.

How do I migrate an existing model from FSDP1 to FSDP2?

To migrate from FSDP1 to FSDP2, you must update your training pipeline to adopt the new parameter sharding strategies and memory management features. FSDP2 provides specific migration paths to transition your existing distributed training setup smoothly.

Does PyTorch FSDP2 support CPU offloading for memory optimization?

Yes, PyTorch FSDP2 supports CPU offloading for memory optimization. By offloading parameters to CPU memory, you can manage memory constraints effectively and deploy memory-efficient training pipelines for large-scale models.

Why is my PyTorch FSDP training pipeline failing to scale efficiently?

PyTorch FSDP training pipelines fail to scale efficiently due to suboptimal parameter sharding strategies or incorrect precision settings. Applying proper debugging techniques and performance tuning practices resolves these distributed training bottlenecks.