pytorch-fsdp

Apply PyTorch FSDP memory sharding across data-parallel workers for distributed training.

Updated May 1, 2026
One-click install
npx skills add https://github.com/xiaoquqi/hermes-agent-skills --skill pytorch-fsdp-xiaoquqi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/xiaoquqi/hermes-agent-skills/tree/main/mlops/training/pytorch-fsdp
Command: npx skills add https://github.com/xiaoquqi/hermes-agent-skills --skill pytorch-fsdp-xiaoquqi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reduce memory usage and enable scalable training for large PyTorch models by applying Fully Sharded Data Parallel (FSDP) techniques.

Core Features & Use Cases

  • Parameter sharding across data-parallel workers to shrink memory footprint for huge models.
  • Support for per-parameter sharding, mixed precision, and CPU offloading (FSDP2) to boost throughput.
  • Migration guidance from FSDP1 and practical deployment tips for multi-GPU/multi-node clusters.

Quick Start

Wrap your PyTorch model with fully_shard and run on a multi-GPU setup to enable per-parameter sharding and distributed training.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I enable distributed training for large PyTorch models that exceed a single GPU's memory?

To enable distributed training for large PyTorch models, you can apply Fully Sharded Data Parallel (FSDP) to shard parameters, gradients, and optimizer states across data-parallel workers. Wrapping your model with fully_shard on a multi-GPU setup shrinks the memory footprint to scale training efficiently.

What is PyTorch FSDP and how does per-parameter sharding reduce memory footprint?

PyTorch FSDP is a memory management technique that shards model parameters across distributed workers to reduce per-GPU memory usage. Per-parameter sharding further optimizes this by individually partitioning parameters, enabling the training of massive transformer and vision architectures that exceed single GPU limits.

Do I need specific backends or CUDA-capable GPUs to configure FSDP2 workflows?

Yes, configuring FSDP2 workflows requires PyTorch installed with appropriate distributed backends like NCCL or Gloo. You also need CUDA-capable GPUs to execute the sharded operations and manage the memory footprint across multi-GPU or multi-node cluster environments.

How do I migrate from FSDP1 to FSDP2 for my multi-GPU training workload?

Migrating from FSDP1 to FSDP2 involves transitioning to the new per-parameter sharding API using fully_shard. The Skill provides migration guidance to help update your distributed training configuration, ensuring you leverage FSDP2's advanced memory management and CPU offloading capabilities effectively.

What is the best way to scale transformer architectures across multi-node clusters without running out of memory?

The best way to scale transformer architectures across multi-node clusters is using Fully Sharded Data Parallel. By applying parameter sharding and mixed precision, FSDP distributes memory usage across workers, preventing out-of-memory errors and enabling scalable training for massive models.