pytorch-fsdp2

Implement PyTorch FSDP2 sharding, mixed precision, and distributed checkpointing.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/Ced3-han/Harness-Settings --skill pytorch-fsdp2-ced3-han
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-fsdp2
Source: https://github.com/Ced3-han/Harness-Settings/tree/main/skills/pytorch-fsdp2
Command: npx skills add https://github.com/Ced3-han/Harness-Settings --skill pytorch-fsdp2-ced3-han

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of training large PyTorch models that exceed single-GPU memory, by integrating PyTorch FSDP2 for efficient, DTensor-based sharding and distributed checkpointing.

Core Features & Use Cases

  • Model Sharding: Adds PyTorch FSDP2 to training scripts with correct initialization and sharding.
  • Mixed Precision/Offload: Configures mixed precision and offload settings for performance and memory efficiency.
  • Checkpointing: Implements distributed checkpointing for robust model state saving.
  • Use Case: Ideal for data scientists and ML engineers working with models that require distributed training on multiple GPUs.

Quick Start

Use the pytorch-fsdp2 skill to initialize a distributed training environment and apply FSDP2 sharding to your model for a given dataset.

Frequently Asked Questions about pytorch-fsdp2

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

FAQPage Schema
How do I use PyTorch distributed training for models that exceed single-GPU memory?

PyTorch FSDP2 provides DTensor-based sharding to distribute large models across multiple GPUs. It handles model initialization, sharding, and checkpointing to enable training of models that exceed single-GPU memory limits.

What is DTensor-based sharding and when do I need it for PyTorch models?

DTensor-based sharding distributes PyTorch model tensors across distributed devices to prevent memory overflow. You need it when training large models that exceed single-GPU memory and require efficient distributed execution with mixed precision support.

How to configure mixed precision and offload settings in PyTorch distributed training?

Configuring mixed precision and offload settings in PyTorch distributed training involves applying FSDP2 to your model with specific performance and memory efficiency configurations. This ensures optimal resource utilization during large-scale distributed training across multiple GPUs.

Can I implement distributed checkpointing for PyTorch model state saving?

You can implement distributed checkpointing for PyTorch model state saving using FSDP2. This integration provides robust state saving mechanisms specifically designed for distributed training environments with sharded model parameters across multiple GPUs.

Do I need PyTorch and compatible libraries to run FSDP2 distributed training?

You need PyTorch and compatible libraries to run FSDP2 distributed training. The implementation requires the torch dependency and a compatible distributed training environment to correctly initialize DTensor sharding, mixed precision, and checkpointing for large models.