Prepare a model for distributed training
You've decided to use the Hugging Face Accelerator library to train your language translation model. Now it's time to prepare your model for distributed training!
Some data has been pre-loaded:
acceleratoris an instance ofAcceleratormodel,optimizer,train_dataloader, andlr_schedulerhave been defined
Это упражнение является частью курса
Efficient AI Model Training with PyTorch
Инструкции к упражнению
- Call a method to prepare objects for distributed training.
- Pass the training objects as positional arguments to
accelerator.prepare(), matching the order of the output.
Интерактивное практическое упражнение
Попробуйте выполнить это упражнение, дополнив этот пример кода.
# Prepare objects for distributed training
model, optimizer, train_dataloader, lr_scheduler = ____.____(
# Pass in the training objects matching the order of the output
____,
____,
____,
____)