pytorch-fsdp

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides expert guidance for Fully Sharded Data Parallel training with PyTorch FSDP, addressing parameter sharding, mixed precision, CPU offloading, and FSDP2 optimizations.

Core Features & Use Cases

  • Parameter Sharding: Implement and optimize parameter sharding for efficient memory usage and reduced communication overhead.
  • Mixed Precision: Leverage mixed precision training for faster computation and lower memory usage.
  • CPU Offloading: Optimize CPU offloading to improve training speed and resource utilization.
  • FSDP2: Explore the latest features of FSDP2 for improved usability and performance.
  • Use Case: For a large-scale deep learning model, use this Skill to shard parameters across multiple GPUs, enabling efficient distributed training and reducing training time.

Quick Start

Use the pytorch-fsdp skill to shard the parameters of your PyTorch model across multiple GPUs.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I implement parameter sharding for large-scale PyTorch models?

Parameter sharding distributes model parameters across multiple GPUs to reduce memory usage per device. This Skill guides you through configuring PyTorch FSDP to shard parameters efficiently, lowering memory overhead for large-scale distributed training.

What is the difference between FSDP and FSDP2 in PyTorch distributed training?

FSDP2 is the latest evolution of Fully Sharded Data Parallel in PyTorch, offering improved usability and performance over the original FSDP. This Skill helps you explore FSDP2 features to optimize your distributed training workflow.

Can I use mixed precision and CPU offloading together in PyTorch FSDP?

Yes, you can leverage mixed precision training alongside CPU offloading in PyTorch FSDP. This combination accelerates computation, lowers memory usage, and optimizes resource utilization by offloading parameters to the CPU.

Does PyTorch FSDP require specific dependencies for distributed training?

PyTorch FSDP requires PyTorch version 2.0 or higher and the transformers library. You also need torch.distributed configured properly to enable parameter sharding and mixed precision across multiple GPUs.

When should I use Fully Sharded Data Parallel instead of standard distributed training?

Use Fully Sharded Data Parallel when training large-scale deep learning models that exceed single GPU memory limits. FSDP shards parameters across multiple GPUs to enable efficient distributed training and significantly reduce training time.

Why does CPU offloading slow down my PyTorch FSDP training speed?

CPU offloading introduces data transfer overhead between CPU and GPU memory. This Skill provides optimization strategies for CPU offloading in PyTorch FSDP to balance memory savings with training speed and resource utilization.