pytorch-fsdp

Configure fully sharded data parallelism for distributed PyTorch training.

Updated Jun 25, 2026
One-click install
npx skills add https://github.com/Rheasilvia/hermes-desktop --skill pytorch-fsdp-rheasilvia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp
Source: https://github.com/Rheasilvia/hermes-desktop/tree/main/optional-skills/mlops/pytorch-fsdp
Command: npx skills add https://github.com/Rheasilvia/hermes-desktop --skill pytorch-fsdp-rheasilvia

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the memory and communication bottlenecks inherent in training massive deep learning models by providing a structured interface for Fully Sharded Data Parallelism.

Core Features & Use Cases

  • Memory Optimization: Shards model parameters, gradients, and optimizer states across data parallel workers to drastically reduce per-GPU memory footprint.
  • Distributed Training Support: Provides comprehensive guidance on using PyTorch distributed backends (NCCL, Gloo) and the Join context manager for uneven inputs.
  • Use Case: When training a large language model that exceeds the memory capacity of a single GPU, use this Skill to implement FSDP2, allowing the model to be partitioned across multiple devices while maintaining high training throughput.

Quick Start

Use the pytorch-fsdp skill to configure a distributed training environment for a large transformer model using the fully_shard API.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I train large PyTorch models that exceed a single GPU's memory capacity?

Fully sharded data parallelism partitions model parameters, gradients, and optimizer states across distributed GPU clusters to reduce per-GPU memory. This allows training massive models that exceed single GPU limits while maintaining high throughput.

What is the best way to configure parameter sharding for distributed training in PyTorch?

Parameter sharding for distributed training is configured using the fully_shard API. This interface facilitates setting up device meshes, sharding strategies, and collective communication backends like NCCL or Gloo for high-performance gradient synchronization.

Does this FSDP implementation support uneven inputs across data parallel workers?

Yes, FSDP supports uneven inputs across data parallel workers by utilizing the Join context manager. This handles variable batch sizes during collective communication operations, ensuring stable distributed training without crashing.

How does fully sharded data parallelism manage state and gradients in eager-mode PyTorch?

Fully sharded data parallelism manages state and gradients in eager-mode PyTorch workflows by sharding optimizer states and synchronizing gradients across workers. This structured interface optimizes memory usage during large-scale model training.

Can I use this with transformer models from the Hugging Face library?

Yes, you can train transformer models using this Skill, as it lists the transformers library as a dependency. It provides comprehensive guidance on implementing fully sharded data parallelism for large language models exceeding single GPU memory.