# About the 🤗Accelerate category

**URL:** <https://discuss.huggingface.co/t/about-the-accelerate-category/5559>\
**Category:** 🤗Accelerate\
**Created:** [April 16, 2021, 3:17pm UTC](https://discuss.huggingface.co/t/about-the-accelerate-category/5559 "2021-04-16T15:17:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [April 16, 2021, 3:17pm UTC](https://discuss.huggingface.co/t/about-the-accelerate-category/5559/1 "2021-04-16T15:17:55Z")

</div>

This category is for any question related to the [Accelerate library](https://github.com/huggingface/accelerate). You can also [file an issue](https://github.com/huggingface/accelerate/issues/new/choose).

---

<div class="post-metadata">

**Author:** ![Neel-Gupta](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Neel-Gupta](https://discuss.huggingface.co/u/Neel-Gupta)\
**Post date:** [February 20, 2022, 7:57pm UTC](https://discuss.huggingface.co/t/about-the-accelerate-category/5559/2 "2022-02-20T19:57:27Z")

</div>

Does `Accelerate` still kick in for validation (forward passes) too?

or its probably just my training snippet 🤔

```nohighlight

#Performing Validation and loggign out images
if epoch % 2 == 0: #i % 100 == 0
  model.eval()

  #--------------VALIDATION------------------
  for i, (img, label) in enumerate(val_loader):
      img.to(device)
      model.to(device)

      with torch.no_grad():
          out, latent_loss = model(img)

      val_recon_loss = criterion(out, img)
      val_latent_loss = latent_loss.mean()
      val_loss = recon_loss + latent_loss_weight * latent_loss\

      val_mse_sum += recon_loss.item() * img.shape[0]
      val_mse_n += img.shape[0]

  wandb.log({"epoch": epoch+1, "val_mse": val_recon_loss.item(), 
          "val_latent_loss": val_latent_loss.item(), "val_avg_mse": (val_mse_sum/ val_mse_n), 
          "lr": lr})

  loader.set_description(
  (
      f'epoch: {epoch + 1}; val_mse: {val_recon_loss.item():.5f};'
      f'val_latent: {val_latent_loss.item():.3f}; val_avg_mse: {val_mse_sum / val_mse_n:.5f};'
      f'lr: {lr:.5f}'
  ))

  model.train()

```

Clearly, during my validation stage its using CPU for some reason…
