pytorch-fsdp

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

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

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 optimizing Fully Sharded Data Parallel (FSDP) training in PyTorch, addressing parameter sharding, mixed precision, CPU offloading, and FSDP2.

Core Features & Use Cases

  • Parameter Sharding: Expertly shard model parameters across devices for efficient training.
  • Mixed Precision: Implement mixed precision training for improved performance and reduced memory usage.
  • CPU Offloading: Leverage CPU offloading for additional efficiency.
  • FSDP2 Support: Specialize in the latest FSDP2 implementation for advanced training scenarios.
  • Use Case: Consider a scenario where you are training a large-scale model with PyTorch and require advanced techniques for efficient distributed training. This Skill can provide you with the necessary guidance and tools.

Quick Start

Use the pytorch-fsdp skill to set up FSDP2 for training your model.

Frequently Asked Questions about pytorch-fsdp

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

FAQPage Schema
How do I shard model parameters across GPUs using PyTorch FSDP?

PyTorch FSDP shards model parameters across distributed devices to enable efficient training of large-scale models. This Skill provides expert guidance on configuring parameter sharding, mixed precision, and CPU offloading to optimize memory usage and performance.

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

FSDP2 is the latest PyTorch implementation for advanced distributed training scenarios, offering improved architecture over the original FSDP. This Skill specializes in FSDP2 support, helping you implement parameter sharding and mixed precision for large-scale machine learning models.

How do I set up FSDP2 for training a large-scale PyTorch model?

To set up FSDP2 for training, you use this Skill to configure parameter sharding, mixed precision, and CPU offloading within your PyTorch distributed training script. It provides the necessary tools and references for optimizing large-scale machine learning models.

Does PyTorch FSDP support CPU offloading and mixed precision training?

Yes, PyTorch FSDP supports both CPU offloading and mixed precision training to improve performance and reduce memory usage. This Skill provides expert guidance on leveraging these features for efficient distributed training of large-scale models.

Can I use PyTorch FSDP with the transformers library for large language models?

Yes, you can use PyTorch FSDP with the transformers library, as both are listed dependencies. This Skill helps you optimize distributed training for large-scale machine learning models requiring parameter sharding and mixed precision.

When should I use FSDP for PyTorch distributed training instead of standard DataParallel?

You should use FSDP when training large-scale machine learning models that exceed single-device memory limits, requiring parameter sharding and CPU offloading. This Skill provides advanced distributed training techniques to optimize performance and reduce memory usage.