# distributed-training-accelerate

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.

- skill · `type=skill` · Claude Code · 115 installs
- Author: Orchestra Research
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/ai-research/distributed-training-accelerate
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/distributed-training-accelerate

## What it 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.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill ai-research/distributed-training-accelerate
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill distributed-training-accelerate -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/distributed-training-accelerate/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/distributed-training-accelerate/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/distributed-training-accelerate/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/distributed-training-accelerate/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates distributed-training-accelerate
```

2. **Manually: put the files in place**
- File: `.github/skills/distributed-training-accelerate/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/ai-research/distributed-training-accelerate
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/distributed-training-accelerate/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/ai-research/distributed-training-accelerate

## When to use it
- 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
- Show me how to add Accelerate to my PyTorch training script.
- Configure `train.py` to run across multiple GPUs with DeepSpeed ZeRO-2.
- Add gradient accumulation and BF16 mixed precision to this training loop.

## Similar
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [writing-for-agents](https://affpapa.org/en/nevibecode/skills/writing-for-agents.md) — skill · 466719 installs
- [media-use](https://affpapa.org/en/nevibecode/skills/media-use.md) — skill · 1100000 installs
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [subagent-driven-development](https://affpapa.org/en/nevibecode/skills/subagent-driven-development.md) — skill · 237746 installs
- [orchestration](https://affpapa.org/en/nevibecode/skills/orchestration.md) — skill · 350300 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
