huggingface/accelerate

🚀 A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and...

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 34 minutes ago
Added to GitGenius on November 20th, 2023
Created on October 30th, 2020
Open Issues & Pull Requests: 109 (+0)
Number of forks: 1,440
Total Stargazers: 9,831 (+0)
Total Subscribers: 93 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 2.0 days
Mean response time: 88.9 days
90th percentile: 374.2 days
Tracked items: 701

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 97% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "bug" is answered fastest, typically in about 3 days, while "enhancement" waits about 3 months. Only 11% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 66
New in 7 days: 1
Closed in 7 days: 2
Avg open age: 927 days
Stale 30+ days: 57
Stale 90+ days: 55

Recent activity

Opened in 7 days: 1
Closed in 7 days: 2
Comments in 7 days: 1
Events in 7 days: 2

Top labels

  • bug (117)
  • feature request (85)
  • solved (58)
  • enhancement (57)
  • wip (22)
  • documentation (17)
  • TPU (16)
  • good first issue (14)

Detailed Description

Hugging Face Accelerate is a PyTorch training library designed to simplify distributed training across diverse hardware configurations. The library enables developers to run raw PyTorch training scripts on single CPUs, single GPUs, multi-GPU setups, TPUs, and multi-node clusters with minimal code modifications. Rather than requiring users to rewrite their training loops, Accelerate abstracts only the boilerplate code necessary for distributed training, mixed precision, and device management while leaving the core training logic untouched.

The core value proposition centers on reducing friction for PyTorch users who want to maintain control over their training loops but avoid writing and maintaining complex distributed training infrastructure. By adding just five lines of code to a standard PyTorch training script, users can enable multi-GPU or TPU support and mixed precision training including fp8, fp16, and bf16 formats. The library handles device placement automatically, allowing the same code to run unchanged across different hardware configurations, from local machines for debugging to production training environments.

Accelerate provides a command-line interface tool that guides users through configuring their training environment interactively. The accelerate config command generates configuration files that automatically set appropriate defaults for the target hardware. Users can then launch scripts using accelerate launch, eliminating the need to remember torch.distributed.run syntax or write custom TPU launchers. The CLI is optional, and users can continue using standard Python execution or torchrun if preferred. The repository includes a configuration zoo with templates for various deployment scenarios.

The library supports multiple launching mechanisms beyond standard GPU training. It enables multi-CPU runs using MPI, with support for Open MPI, Intel MPI, and MVAPICH. For large-scale training, Accelerate integrates with DeepSpeed, allowing users to configure DeepSpeed settings entirely through accelerate config without modifying training code, though this support is marked as experimental. The library also provides a notebook_launcher function for distributed training in Jupyter environments, particularly useful for Colab and Kaggle notebooks with TPU backends.

The library explicitly positions itself as a thin wrapper around PyTorch rather than a high-level framework. It is intended for users who want to write their own training loops and maintain full control over training logic while delegating distributed infrastructure concerns. The entire Accelerate API centers on a single Accelerator object, keeping the learning curve minimal. The library is not designed for users seeking high-level abstractions that eliminate the need to write training loops themselves, as numerous other frameworks already serve that purpose.