Accelerate documentation
Learning how to incorporate π€ Accelerate features quickly!
Getting started
Tutorials
OverviewAdd Accelerate to your codeExecution processTPU trainingLaunching distributed codeLaunching distributed training from Jupyter Notebooks
How to guides
Accelerate
Start Here!Model memory estimatorModel quantizationExperiment trackersSave and load training statesTroubleshootExample Zoo
Training
Gradient accumulationLocal SGDLow precision (FP8) trainingDeepSpeedFully Sharded Data ParallelismMegatron-LMAmazon SageMakerApple M1 GPUsIPEX training with CPU
Inference
Concepts and fundamentals
π€ Accelerate's internal mechanismLoading big models into memoryComparing performance across distributed setupsExecuting and deferring jobsGradient synchronizationHow training in low-precision environments is possible (FP8)TPU best practices
Reference
AcceleratorStateful configuration classesThe Command LineTorch wrapper classesExperiment trackersDistributed launchersDeepSpeed utilitiesLoggingWorking with large modelsDistributed inference with big modelsKwargs handlersUtility functions and classesMegatron-LM UtilitiesFully Sharded Data Parallelism Utilities
You are viewing v0.28.0 version. A newer version v1.13.0 is available.
Learning how to incorporate π€ Accelerate features quickly!
Please use the interactive tool below to help you get started with learning about a particular feature of π€ Accelerate and how to utilize it! It will provide you with a code diff, an explanation towards what is going on, as well as provide you with some useful links to explore more within the documentation!
Most code examples start from the following python code before integrating π€ Accelerate in some way:
for batch in dataloader:
optimizer.zero_grad()
inputs, targets = batch
inputs = inputs.to(device)
targets = targets.to(device)
outputs = model(inputs)
loss = loss_function(outputs, targets)
loss.backward()
optimizer.step()
scheduler.step()