Pytorch Fsdp2
Retrofit PyTorch FSDP2 (fully_shard) into training scripts with bottom-up sharding, mixed precision, offload, and DCP checkpointing.
- CCM score
- 57 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers initialization with
torchrun, meta-device model construction, bottom-upfully_shardwrapping, and optimizer creation on DTensor parameters - Includes
reshard_after_forwardtuning,MixedPrecisionPolicyandCPUOffloadPolicyconfiguration, and gradient clipping for DTensor-based models - Enforces
model(inputs)calls so FSDP2 hooks run, and prefers Distributed Checkpoint over plaintorch.savefor sharded state - Designed for models that exceed single-GPU memory or need DTensor sharding with DeviceMesh
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill pytorch-fsdp2 -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Skill: Use PyTorch FSDP2 (fully_shard) correctly in a training script
This skill teaches a coding agent how to add PyTorch FSDP2 to a training loop with correct initialization, sharding, mixed precision/offload configuration, and checkpointing.
FSDP2 in PyTorch is exposed primarily via
torch.distributed.fsdp.fully_shardand theFSDPModulemethods it adds in-place to modules. See:references/pytorch_fully_shard_api.md,references/pytorch_fsdp2_tutorial.md.
When to use this skill
Use FSDP2 when:
- Your model doesn’t fit on one GPU (parameters + gradients + optimizer state).
- You want an eager-mode sharding approach that is DTensor-based per-parameter sharding (more inspectable, simpler sharded state dicts) than FSDP1.
- You may later compose DP with Tensor Parallel using DeviceMesh.
Avoid (or be careful) if:
- You need strict backwards-compatible checkpoints across PyTorch versions (DCP warns against this).
- You’re forced onto older PyTorch versions without the FSDP2 stack.
Alternatives (when FSDP2 is not the best fit)
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- AI Agents & LLM Apps, Data Science & Analytics
- First seen
- Jun 3, 2026
Questions
What does the pytorch-fsdp2 skill do?
It adds PyTorch FSDP2 (fully_shard) to training scripts, covering correct initialization, sharding, mixed precision and offload configuration, and distributed checkpointing. It is meant for models that exceed single-GPU memory or when you need DTensor-based sharding with DeviceMesh.
How do I install the pytorch-fsdp2 skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill pytorch-fsdp2 -y in your project. Once installed, the agent can apply FSDP2 sharding and checkpointing to your PyTorch training loop.
When should I use FSDP2 instead of DDP or FSDP1?
Use FSDP2 when your model does not fit on one GPU, or when you want DTensor-based per-parameter sharding that is easier to inspect. The skill points to DistributedDataParallel for classic data parallel training and to the original FSDP1 wrapper as alternatives.
Which skills lead the category this skill is in?
This skill sits in the AI Agents & LLM Apps category on Claude Marketplaces, where microsoft-foundry, azure-ai and the google-agents-cli skills are listed as other top skills. Its own focus is PyTorch distributed training memory sharding.
More from orchestra-research/ai-research-skills
All 92- Pytorch Lightning1.1K
- Transformer Lens Interpretability1.1K
- Axolotl1.1K
- Clip1.1K
- Langchain1.1K
- Sentence Transformers1.1K
- Huggingface Tokenizers1.1K
- Verl Rl Training1.1K
- Awq Quantization1.1K
- Nanogpt1.1K
- Instructor1.1K
- Long Context1.1K
- Presenting Conference Talks1.1K
- Speculative Decoding1.1K
- Hqq Quantization1.1K
- Model Merging1.1K
- Moe Training1.1K
- Sglang1.1K
- Chroma1.1K
- Nemo Curator1.1K
- Llama Factory1.1K
- Pyvene Interventions1.1K
- Gptq1.1K
- Model Pruning1.1K
Similar to Pytorch Fsdp2
More AI Agents & LLM Appspytorch-fsdpdavila7/claude-code-templates395 installsExpert guidance for PyTorch FSDP training covering parameter sharding, mixed precision, CPU offloading, and FSDP2.
pytorch-lightningorchestra-research/ai-research-skills1.1K installsHigh-level PyTorch training framework that removes boilerplate while scaling from one GPU to multi-node distributed runs.
huggingface-accelerateorchestra-research/ai-research-skills1.1K installsUnified distributed training API that adds multi-GPU support to PyTorch scripts in about four lines.
deep-learningmindrally/skills995 installsPractical guidelines for neural network design, training, multi-GPU scaling, and memory optimization in PyTorch-style workflows.
pytorchmindrally/skills884 installsDeep learning guidance for PyTorch models covering transformers, diffusion pipelines, and GPU training optimization.