# Macbook M1 M2 mps acceleration with scVI

**URL:** <https://discourse.scverse.org/t/macbook-m1-m2-mps-acceleration-with-scvi/2075>\
**Category:** scvi-tools\
**Tags:** developer\
**Created:** [February 9, 2024, 9:21pm UTC](https://discourse.scverse.org/t/macbook-m1-m2-mps-acceleration-with-scvi/2075 "2024-02-09T21:21:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![martinkim0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/martinkim0/32/881_2.png) [@martinkim0](https://discourse.scverse.org/u/martinkim0)\
**Post date:** [February 16, 2024, 5:30pm UTC](https://discourse.scverse.org/t/macbook-m1-m2-mps-acceleration-with-scvi/2075/4 "2024-02-16T17:30:14Z")

</div>

I’ve tried testing out the nightly PyTorch versions with the MPS backend and have had no success. Technically it should work since they’ve implemented the `lgamma` kernel, which was the last one needed to fully support running scVI, but it looks like there might be issues with the implementation or numerical instabilities since I’ve also experienced NaNs in the first epoch of training.

So yes, this is an issue on the PyTorch end - unfortunately there’s not much we can do to support the Metal backend.

---

_[View the full topic](https://discourse.scverse.org/t/macbook-m1-m2-mps-acceleration-with-scvi/2075)._
