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 https://github.com/ray-project/ray/blob/b67258a86dbdca329d6a2a6d0756233130594909/rllib/evaluation/rollout_worker.py#L499 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.