huggingface-accelerate

Automate PyTorch script distribution across GPUs and nodes with HuggingFace Accelerate.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/kwasi-cpu/hermes-agent --skill huggingface-accelerate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: huggingface-accelerate
Source: https://github.com/kwasi-cpu/hermes-agent/tree/main/skills/mlops/training/accelerate
Command: npx skills add https://github.com/kwasi-cpu/hermes-agent --skill huggingface-accelerate

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill drastically simplifies the process of adding distributed training capabilities (multi-GPU, multi-node, DeepSpeed, FSDP) to any PyTorch script with minimal code changes.

Core Features & Use Cases

  • Unified API: Supports DeepSpeed, FSDP, DDP, and Megatron with a single interface.
  • Automatic Configuration: Handles device placement, mixed precision (FP16/BF16/FP8), and sharding automatically.
  • Quick Prototyping: Enables rapid iteration by reducing the boilerplate code for distributed setups.
  • Use Case: You have a PyTorch script for training a large language model on a single GPU. With just a few lines of code and a simple command, you can scale this script to run efficiently across multiple GPUs or even multiple machines.

Quick Start

Use the huggingface-accelerate skill to launch your training script 'train.py' on a multi-GPU setup.

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 multiple GPUs with minimal code changes?

To scale PyTorch training across multiple GPUs with minimal changes, use the HuggingFace Accelerate library to automatically handle device placement and distributed setup. It allows rapid scaling of workloads to multi-GPU and multi-node environments using a unified API.

Does HuggingFace Accelerate support both DeepSpeed and FSDP for distributed training?

Yes, HuggingFace Accelerate supports both DeepSpeed and FSDP for distributed training. It provides a unified API that also includes DDP and Megatron, allowing you to configure sharding and mixed precision automatically across these backends.

Can I use mixed precision like FP16 and BF16 when running distributed PyTorch workloads?

Yes, you can use mixed precision including FP16, BF16, and FP8 when running distributed PyTorch workloads. Accelerate provides automatic configuration for mixed precision alongside device placement and sharding during training.

What is the best way to configure multi-node distributed training for large language models?

The best way to configure multi-node distributed training for large language models is using a unified API like Accelerate. It reduces boilerplate code for distributed setups, enabling rapid iteration and efficient scaling across multiple machines with simple commands.

Do I need to manually handle device placement and sharding when using FSDP?

No, you do not need to manually handle device placement and sharding when using FSDP. HuggingFace Accelerate provides automatic configuration for these aspects, drastically simplifying the process of adding distributed training capabilities to your scripts.