Accelerate documentation

여기서 시작하세요!

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.15.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

여기서 시작하세요!

Accelerate의 특정 기능에 대해 배우고 이를 활용하는 방법을 익히기 위해 아래 인터랙티브 도구를 사용해 보세요! 이 도구는 코드 diff, 해당 동작에 대한 설명, 그리고 문서 내에서 더 깊이 탐구할 수 있는 유용한 링크를 제공합니다!

대부분의 코드 예제는 Accelerate를 어떤 방식으로든 통합하기 전에 다음 Python 코드로 시작합니다:

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()
Update on GitHub