What problem does it solve?
HuggingFace Accelerate removes the complexity of writing separate distributed-training scripts for DDP, DeepSpeed, FSDP, and mixed precision by letting you run the same PyTorch code across different hardware setups with minimal changes.
Core Features & Use Cases
- Unified distributed training API: The same training loop can be prepared to run on single GPU, multi-GPU, multi-node, and TPU-like environments.
- Automatic device placement & mixed precision: Handles FP16/BF16/FP8 workflows without requiring you to manually manage autocast and backward scaling in typical cases.
- Strategy plug-ins for scaling: Integrates with DeepSpeed ZeRO (stages 2/3), FSDP sharding, and Megatron-LM-style parallelism through Accelerate plugins.
- Common use case: Convert an existing Transformer training script that works on one GPU into a multi-GPU, mixed-precision workflow that scales to larger models (including DeepSpeed ZeRO-2/3 or FSDP) with minimal code edits.
Quick Start
Run your training script with distributed support by using the command: accelerate launch train.py.