Wraps HuggingFace's Accelerate library to handle distributed training without rewriting your PyTorch code. You add four lines (import Accelerator, initialize it, wrap your model/optimizer/dataloader) and suddenly your script runs on multiple GPUs, TPUs, or mixed precision setups. Useful when you've outgrown single-GPU training but don't want to dive into the complexity of torch.distributed directly. The skill passed Gen Agent Trust Hub and Socket audits but got a warning from Snyk, so check dependencies if security matters for your deployment. It's been installed 262 times and comes from orchestra-research's AI research skill collection.

skills.sh installs
1K
GitHub stars
14.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill huggingface-accelerate --agent claude-code

Installs into .claude/skills of the current project.

Files

HuggingFace Accelerate - Unified Distributed Training

Quick start

Accelerate simplifies distributed training to 4 lines of code.

Installation:

pip install accelerate

Convert PyTorch script (4 lines):

import torch
+ from accelerate import Accelerator

+ accelerator = Accelerator()

  model = torch.nn.Transformer()
  optimizer = torch.optim.Adam(model.parameters())
  dataloader = torch.utils.data.DataLoader(dataset)

+ model, optimizer, dataloader = accelerator.prepare(model, optimizer, dataloader)

  for batch in dataloader:
      optimizer.zero_grad()
      loss = model(batch)
-     loss.backward()
+     accelerator.backward(loss)
      optimizer.step()

Run (single command):

accelerate launch train.py

Common workflows

Workflow 1: From single GPU to multi-GPU

Original script:

# train.py
import torch

model = torch.nn.Linear(10, 2).to('cuda')
optimizer = torch.optim.Adam(model.parameters())
dataloader = torch.utils.data.DataLoader(dataset, batch_size=32)

Sponsors

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
Backend & APIs, AI & Agent Building, Data Science & ML, Automation & Workflows
First seen
Jun 3, 2026

More from orchestra-research/ai-research-skills

All 95
1dbt-labs avatartroubleshooting-dbt-job-errorsdbt-labs/dbt-agent-skillsDiagnoses dbt Cloud/platform job failures by analyzing run logs, querying the Admin API, reviewing git history, and investigating data issues. Use when a dbt Cl1Kskills.sh installs
2wechat-miniprogram avatarskyline-routewechat-miniprogram/skyline-skillsSkyline 自定义路由与页面转场技能。涵盖自定义路由动画(routeBuilder)、预设路由(7 种 wx:// 类型)、页面返回手势、容器转场动画(open-container)、Router API。适用于实现半屏弹窗、页面缩放、底部弹出、卡片展开等转场效果。触发关键词:自定义路由、custom-route、1Kskills.sh installs
3everyinc avatarce-polish-betaeveryinc/compound-engineering-plugin[BETA] Start the dev server, open the feature in a browser, and iterate on improvements together.1Kskills.sh installs
4felo-inc avatarfelo-slidesfelo-inc/felo-skillsGenerate PPT/slides from prompts, local images, PDFs, and other files with the Felo PPT Task API. Use when users ask to create, make, generate, or export presen1Kskills.sh installs
5adobe avatardispatcheradobe/skillsSingle entry point for all AEM 6.5 LTS Dispatcher skills. Covers config authoring, technical advisory, incident response, performance tuning, security hardening1Kskills.sh installs
6dodopayments avatardodo-best-practicesdodopayments/skillsGuide for initial Dodo Payments setup, including SDK installation, test and live environments, API keys, and the canonical checkout-to-webhook architecture.1Kskills.sh installs