distributed-training-accelerate — Claude Code skill
This skill shows how to adapt PyTorch training code for HuggingFace Accelerate. Use it to move from one GPU to distributed runs or configure mixed precision.
npx claude-code-templates@latest --skill ai-research/distributed-training-accelerateWhat distributed-training-accelerate does
The skill walks through adding Accelerator to a PyTorch script, preparing the model, optimizer, and dataloader, then routing backpropagation through Accelerate. The same training code can be configured for DDP, DeepSpeed, FSDP, or Megatron and started with accelerate launch train.py.
Its examples cover the interactive accelerate config flow, FP16 and BF16, ZeRO-2, FSDP, and gradient accumulation. The installation instructions use pip install accelerate; torch and transformers are also listed as dependencies. The FP8 example targets H100 and later hardware, so check that requirement before choosing that mode.
What it helps with
- adapt a single-GPU PyTorch script for multi-GPU training
- configure training with DDP, DeepSpeed, or FSDP
- enable FP16 or BF16 for a training run
- accumulate gradients across batches
Example prompts for the agent
- Show me how to add Accelerate to my PyTorch training script.
- Configure
train.pyto run across multiple GPUs with DeepSpeed ZeRO-2. - Add gradient accumulation and BF16 mixed precision to this training loop.
How to install distributed-training-accelerate
1claude-code-templates
npx claude-code-templates@latest --skill ai-research/distributed-training-accelerate2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill distributed-training-accelerate -a claude-code3Manually: put the files in place
~/.claude/skills/distributed-training-accelerate/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/distributed-training-accelerate/
Manually: put the files in place
.agents/skills/distributed-training-accelerate/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/distributed-training-accelerate/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates distributed-training-accelerate2Manually: put the files in place
.github/skills/distributed-training-accelerate/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/ai-research/distributed-training-accelerateManually: put the files in place
.devin/skills/distributed-training-accelerate/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about distributed-training-accelerate
How do I install distributed-training-accelerate in Claude Code?
Run npx claude-code-templates@latest --skill ai-research/distributed-training-accelerate.
What does distributed-training-accelerate do?
It guides you through using HuggingFace Accelerate with PyTorch for distributed training. The examples cover DDP, DeepSpeed, FSDP, and mixed precision.
What hardware does the FP8 example require?
The example specifies H100 or later for FP8. The installation instructions use pip install accelerate.