pytorch-fsdp

Configure and debug PyTorch FSDP/FSDP2 distributed training with sharding and offloading.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MarbleSodas/Mavis --skill pytorch-fsdp-marblesodas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/MarbleSodas/Mavis/tree/main/optional-skills/mlops/pytorch-fsdp
Command: npx skills add https://github.com/MarbleSodas/Mavis --skill pytorch-fsdp-marblesodas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design, implement, and debug Fully Sharded Data Parallel (FSDP) training setups in PyTorch so you can reduce memory usage and improve scalability.

Core Features & Use Cases

  • FSDP2-focused guidance: Practical recommendations for parameter sharding, mixed precision, CPU offloading, and FSDP2 usage patterns.
  • Distributed training correctness: Helps prevent hangs and synchronization issues by explaining how collective calls and join/uneven-input handling must align across ranks.
  • Performance-oriented learning: Uses authoritative PyTorch documentation patterns to support large-scale training troubleshooting and best practices.

Quick Start

Ask for an FSDP2 training plan for a transformer model, including recommended sharding strategy, mixed-precision settings, and CPU offloading configuration.

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 FSDP for distributed training?

Configure PyTorch FSDP for distributed training by defining parameter sharding strategies, setting up mixed-precision policies, and aligning collective execution across ranks. This guidance covers practical implementation details for FSDP and FSDP2 to reduce memory usage and improve scalability.

Why does my PyTorch FSDP training hang across ranks?

PyTorch FSDP training hangs occur when collective calls and join or uneven-input handling are mismatched across ranks. Diagnose these distributed correctness issues by ensuring collective ordering and uneven-input join handling align properly across all participating ranks.

What is the best way to set up CPU offloading in FSDP2?

The best way to set up CPU offloading in FSDP2 is to configure offloading parameters alongside per-parameter sharding and mixed-precision settings. This approach targets memory reduction for massive models by offloading parameters during distributed training.

When do I need to use per-parameter sharding in PyTorch distributed training?

Per-parameter sharding in PyTorch distributed training is needed when scaling massive models to reduce memory usage. It shards individual parameters across ranks, requiring careful alignment of collective calls to prevent synchronization issues.

Does FSDP2 support mixed precision and uneven-input join handling?

FSDP2 supports mixed precision training and uneven-input join handling to manage varying input sizes across ranks. Configure these features by following PyTorch distributed documentation patterns to ensure collective ordering and correctness during execution.