pytorch-fsdp

Guide PyTorch FSDP implementation for distributed training and sharding.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill addresses the complexity of scaling deep learning models across multiple GPUs by providing expert guidance on Fully Sharded Data Parallel (FSDP) implementation, memory optimization, and distributed communication patterns.

Core Features & Use Cases

  • Distributed Training Guidance: Provides best practices for FSDP and FSDP2, including parameter sharding, mixed precision, and CPU offloading.
  • Debugging & Optimization: Offers troubleshooting steps for common distributed training issues like hangs, uneven inputs, and communication bottlenecks.
  • Use Case: Use this skill when you need to configure a multi-node training job for a large language model to ensure efficient memory usage and high throughput.

Quick Start

Ask the pytorch-fsdp skill to explain how to implement fully_shard on a transformer model layer to optimize memory usage.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I implement fully sharded data parallel training in PyTorch?

To implement fully sharded data parallel training in PyTorch, you configure the distributed environment, apply parameter sharding using the FSDP or FSDP2 API, and manage collective communication operations for large-scale models.

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

The best way to optimize GPU memory during distributed training is using PyTorch FSDP to shard parameters, gradients, and optimizer states across GPUs, while applying mixed precision and CPU offloading techniques.

Why does my PyTorch FSDP training job hang during collective communication?

PyTorch FSDP training jobs hang during collective communication due to uneven input distributions across ranks or communication bottlenecks, requiring specific debugging steps to resolve the distributed synchronization issues.

Can I use FSDP2 to shard transformer model layers for multi-node training?

Yes, you can use the FSDP2 API to apply the fully_shard function on transformer model layers, enabling parameter sharding and memory-efficient optimization for multi-node large language model training.

Does PyTorch FSDP work with Hugging Face transformers for large language models?

PyTorch FSDP works with Hugging Face transformers to support large language model training by sharding parameters across GPUs, ensuring efficient memory usage and high throughput in distributed environments.

When do I need fully sharded data parallel instead of standard distributed training?

You need fully sharded data parallel when scaling deep learning models across multiple GPUs exceeds standard memory limits, requiring parameter sharding and CPU offloading to maintain high throughput for large models.