pytorch-fsdp

Apply FSDP2 per-parameter sharding to PyTorch models for distributed training.

78|16|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/sheawinkler/hermes-agent-ultra --skill pytorch-fsdp-sheawinkler
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/sheawinkler/hermes-agent-ultra/tree/main/optional-skills/mlops/pytorch-fsdp
Command: npx skills add https://github.com/sheawinkler/hermes-agent-ultra --skill pytorch-fsdp-sheawinkler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PyTorch FSDP enables memory-efficient training by sharding model parameters and gradients across data-parallel workers, allowing training of larger models than GPU memory would otherwise permit.

Core Features & Use Cases

  • Per-parameter sharding with FSDP2 for scalable training.
  • Mixed-precision training and CPU offloading to optimize memory and throughput.
  • Platform- and migration-friendly: supports 1D/2D meshes and migration from FSDP1.

Quick Start

Run fully_shard(model, mesh) to apply FSDP2 across your device mesh and begin sharded training.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How does fully sharded data parallel training work in PyTorch?▼

Fully sharded data parallel training shards model parameters and gradients across data-parallel workers, allowing you to train models that exceed single GPU memory limits. It uses a device mesh to manage distributed resources efficiently.

What's the best way to train large transformer models across multi-GPU clusters?▼

The best way to train large transformer models across multi-GPU clusters is using per-parameter sharding with FSDP2. By applying fully_shard to your model and device mesh, you achieve memory-efficient, scalable training with optional mixed precision and CPU offloading.

How do I apply FSDP2 to my model using a device mesh?▼

To apply FSDP2, run fully_shard(model, mesh) across your configured 1D or 2D device mesh. This initiates per-parameter sharding for scalable training, requiring PyTorch >= 2.x and access to torch.distributed.

Does PyTorch FSDP support mixed precision and CPU offloading?▼

Yes, PyTorch FSDP supports mixed-precision training and CPU offloading to optimize memory usage and throughput. These features help maximize resource efficiency when training large models across multi-GPU and multi-node clusters.

Can I migrate my existing training code from FSDP1 to FSDP2?▼

Yes, you can migrate from FSDP1 to FSDP2 as the platform is migration-friendly. FSDP2 introduces per-parameter sharding and supports both 1D and 2D meshes, providing a scalable upgrade path for your distributed training workflows.