huggingface-accelerate

Simplify distributed PyTorch training with a unified API for DDP, DeepSpeed, and FSDP.

2|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/zhuangbiaowei/smart_bot --skill huggingface-accelerate-zhuangbiaowei
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: huggingface-accelerate
Source: https://github.com/zhuangbiaowei/smart_bot/tree/main/skills/accelerate
Command: npx skills add https://github.com/zhuangbiaowei/smart_bot --skill huggingface-accelerate-zhuangbiaowei

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill drastically simplifies the process of distributing PyTorch training across multiple GPUs, TPUs, or even multiple machines, abstracting away complex configurations for DeepSpeed, FSDP, and DDP.

Core Features & Use Cases

  • Unified API: Write your training script once and run it on any hardware setup.
  • Mixed Precision: Easily enable FP16, BF16, or FP8 training for faster training and reduced memory.
  • DeepSpeed/FSDP Integration: Seamlessly leverage advanced distributed training techniques like ZeRO-2/3 and FSDP.
  • Use Case: You have a PyTorch script that runs on a single GPU. With just 4 lines of code added, you can make it run efficiently on a cluster of 8 GPUs using DeepSpeed ZeRO-3, without changing your core training logic.

Quick Start

Install the accelerate library and then run your training script using the 'accelerate launch' command.

Frequently Asked Questions about huggingface-accelerate

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

FAQPage Schema
How do I run PyTorch distributed training across multiple GPUs without rewriting my script?

You can simplify distributed training by adding a unified API wrapper to your PyTorch script, requiring only about four lines of code changes to scale from a single GPU to multiple GPUs seamlessly.

Can I use DeepSpeed and FSDP with the same PyTorch training code?

Yes, a unified API allows you to leverage advanced distributed training techniques like DeepSpeed ZeRO-2/3 and FSDP without altering your core training logic, simply by changing the launch configuration.

How do I enable mixed precision training in PyTorch for FP16 or BF16?

You can enable automatic mixed precision training for FP16, BF16, or FP8 by configuring the unified API, which handles the precision scaling automatically to reduce memory and speed up training.

What is the best way to scale a single GPU PyTorch script to a multi-node cluster?

The best way to scale to a multi-node cluster is using a unified API that abstracts distributed configurations, allowing your existing single GPU PyTorch script to run on multiple machines with minimal code changes.

Does this distributed training approach work with gradient accumulation?

Yes, the unified API supports gradient accumulation natively, allowing you to simulate larger batch sizes across distributed setups without running out of memory.

What do I need to launch PyTorch scripts for distributed training?

You need to install the accelerate library and use the 'accelerate launch' command to execute your PyTorch script, which handles the backend distribution setup automatically.