huggingface-accelerate

Convert PyTorch training scripts to unified distributed training with Accelerate.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MarbleSodas/Mavis --skill huggingface-accelerate-marblesodas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: huggingface-accelerate
Source: https://github.com/MarbleSodas/Mavis/tree/main/optional-skills/mlops/accelerate
Command: npx skills add https://github.com/MarbleSodas/Mavis --skill huggingface-accelerate-marblesodas

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It solves the problem of rewriting and maintaining separate training code paths for single-GPU, multi-GPU, mixed-precision, and advanced parallelism strategies so your experiments can scale without engineering overhead.

Core Features & Use Cases

  • Unified distributed training API: Convert an existing PyTorch script with a small set of changes and launch it on any supported hardware topology.
  • Automatic device placement and mixed precision: Enable fp16/bf16/fp8 with consistent backward/optimization handling.
  • Strategy integration: Use DDP by default, and optionally integrate DeepSpeed (ZeRO) or FSDP (full sharding) without changing your core loop structure.

Use case: You have a fine-tuning script that runs on one GPU, and you need to scale to 8 GPUs with bf16 while keeping the training loop nearly identical across environments.

Quick Start

Run your training script with distributed support by executing the single command: accelerate launch train.py

Frequently Asked Questions about huggingface-accelerate

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

FAQPage Schema
How do I scale PyTorch distributed training without rewriting my code?

You can scale PyTorch distributed training with minimal code changes by using Accelerate, which unifies device placement, mixed precision handling, and launch orchestration across different hardware topologies.

What is the best way to run mixed-precision fine-tuning on multiple GPUs?

The best way to run mixed-precision fine-tuning is using Accelerate to enable fp16, bf16, or fp8, coordinating backward and optimization handling while maintaining a nearly identical training loop across environments.

Does Hugging Face Accelerate support DeepSpeed ZeRO and FSDP?

Yes, Hugging Face Accelerate supports strategy integration for DeepSpeed ZeRO and FSDP, allowing you to apply full sharding or zero optimization without changing your core training loop structure.

Can I convert an existing single-GPU PyTorch script to multi-GPU training?

Yes, you can convert an existing single-GPU PyTorch script to multi-GPU training with a small set of changes, using Accelerator.prepare and accelerator.backward to coordinate devices and launching via the accelerate launch command.

Do I need specific dependencies to use Accelerate for distributed training?

Yes, you need the Accelerate library, PyTorch, and compatible Transformers model, optimizer, and data pipeline objects so Accelerate can coordinate device placement, precision handling, and launch orchestration.

Why avoid rewriting separate training code paths for different hardware topologies?

Rewriting separate training code paths for different hardware topologies creates engineering overhead, whereas a unified distributed training API minimizes code changes and keeps experiments scalable across mixed-precision and parallelism strategies.