huggingface-accelerate

Scale PyTorch distributed training across GPUs and nodes with Accelerate.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/box755/simlens-research --skill huggingface-accelerate-box755
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: huggingface-accelerate
Source: https://github.com/box755/simlens-research/tree/main/skill-packs/AI-Research-SKILLs/08-distributed-training/accelerate
Command: npx skills add https://github.com/box755/simlens-research --skill huggingface-accelerate-box755

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires accelerate, torch, transformers, and includes references (resource) components.

What problem does it solve?

It removes the complexity of writing and maintaining separate code paths for single-GPU, multi-GPU, and multi-node distributed training by providing a unified interface for common PyTorch distributed backends.

Core Features & Use Cases

  • Unified distributed API: Use one training script while running with DDP, DeepSpeed, FSDP, or Megatron-LM through the same Accelerator entry points.
  • Automatic training plumbing: Handles device placement, distributed wrapping, and mixed precision (FP16/BF16/FP8) to reduce boilerplate and common setup errors.
  • Common production workflows: Supports interactive configuration, gradient accumulation, DeepSpeed ZeRO stages, FSDP sharding strategies, and accelerator-aware checkpointing/saving.

Use case: You have a PyTorch training script that runs on a single GPU, and you need to scale it to 8 GPUs with BF16 and gradient accumulation while keeping the code changes minimal and repeatable across environments.

Quick Start

Ask your assistant to run accelerate launch train.py using Hugging Face Accelerate with the default configuration for your available hardware.

Frequently Asked Questions about huggingface-accelerate

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

FAQPage Schema
How do I scale a PyTorch training script to multi-GPU without rewriting code?▼

You can scale PyTorch training to multi-GPU by using a unified Accelerator API that abstracts distributed backend boilerplate, letting you keep one training script while running across multiple GPUs with minimal code changes.

What is the best way to run PyTorch distributed training with DeepSpeed ZeRO and FSDP?▼

The best way to run PyTorch distributed training with DeepSpeed ZeRO and FSDP is using a unified interface that handles distributed wrapping and sharding strategies, enabling you to launch both configurations through the same entry points.

Can I use mixed precision and gradient accumulation when training transformers across multiple GPUs?▼

Yes, you can use mixed precision FP16/BF16 and gradient accumulation when training transformers across multiple GPUs by relying on an API that automatically handles device placement and training plumbing.

Do I need to manually prepare the model and optimizer for distributed training with accelerate?▼

You do not need to manually prepare the model and optimizer for distributed training; an automated API prepares the model, optimizer, and dataloader, and handles gradient computation via accelerator.backward.

How does accelerate launch handle different distributed training backends?▼

The accelerate launch command handles different distributed training backends by using an interactive configuration that applies your specified hardware setup to run a single PyTorch script across DDP, DeepSpeed, or FSDP.

Why does my PyTorch single GPU script fail when moving to multi-node training?▼

Your PyTorch script likely fails when moving to multi-node training because it lacks backend-specific boilerplate for distributed wrapping and device placement, which a unified Accelerator API is designed to automatically manage.