Hugging Face Accelerate
Run PyTorch training scripts on any hardware — single GPU, multi-GPU, TPU — with minimal code changes.
Hugging Face Accelerate
Accelerate is a library that enables the same PyTorch training code to run seamlessly on any distributed configuration: single CPU, single GPU, multi-GPU (DDP/FSDP/DeepSpeed), TPU, or mixed precision — with almost no code changes required. It abstracts away all the boilerplate of distributed training.
Key Features
- Hardware agnostic: single line change to go from single GPU to 8-GPU DDP or TPU
- FSDP and DeepSpeed integration: scale to billions of parameters with memory-efficient sharding
- Mixed precision: fp16, bf16, fp8 training with gradient scaling
- Gradient accumulation and checkpointing built-in
- Big Model Inference: load models larger than GPU memory via device mapping
- Fully compatible with vanilla PyTorch — no new abstractions to learn
Quick Start
from accelerate import Accelerator
accelerator = Accelerator()
model, optimizer, train_loader = accelerator.prepare(model, optimizer, train_loader)
for batch in train_loader:
outputs = model(**batch)
loss = outputs.loss
accelerator.backward(loss)
optimizer.step()
optimizer.zero_grad()
# Launch multi-GPU training
accelerate launch --num_processes 4 train.py
Install via ai-supply
npx ai-supply add huggingface-accelerate-training
Curated mirror of the open-source Hugging Face Accelerate (Apache-2.0). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/huggingface-accelerate-training/check). Click a policy:
Consume Hugging Face Accelerate programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/huggingface-accelerate-training
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/huggingface-accelerate-training/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add huggingface-accelerate-training
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/huggingface-accelerate-training/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "huggingface-accelerate-training" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.