Device list for torch mps

Is there an equivalent for torch.cuda.device.count() for mps. I only found that there is torch.backends.mps.is_available() and torch.backends.mps.is_built()

I am trying to get running rllib on Apple M1 GPUs and I see that they do this check to retrieve the name of GPU devices and trying to find an alternative for it in mps

1 Like

I believe all the cores on M1/M2 Mac are exposed as a single "mps" device, so there’s no notion of a device count.