pytorch-deep-learning
pytorch-deep-learning copied to clipboard
Warning on MPS backends
Dear All,
I am running PyTorch on MacBook Pro M2 Max and I am getting the following warning: “”" UserWarning: The operator ‘aten::nonzero’ is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/mps/MPSFallback.mm:11.) nonzero_finite_vals = torch.masked_select( “”" I am afraid that I am not able to use the full potential of MPS on my system. I should state that I followed the installation process given by Daniel. I appreciate your help regarding this issue.
Bests, Benhour
Hello There,
I had similar issue. Seems that MPS does not support all the operations.
A work around is to move the tensors to the CPU
Example.
if compute_device == torch.device("mps"):
acc = acc_fn(pred_classes.to("cpu"), label_batch.to("cpu"))
print(acc)
Hope this helps
Thanks.