1. Learn
  2. /
  3. Courses
  4. /
  5. Efficient AI Model Training with PyTorch

Connected

Exercise

Mixed precision training with Accelerator

You want to simplify your PyTorch loop for mixed precision training of your language translation model by using Accelerator. Build the new training loop to leverage Accelerator!

Some objects have been preloaded: dataset, model, dataloader, and optimizer.

Instructions

100 XP
  • Enable mixed precision training using FP16 in Accelerator.
  • Prepare training objects for mixed precision training before the loop.
  • Compute the gradients of the loss for mixed precision training.