Issue with Running PyTorch Model on MPS of Apple M1

I tried to run my model on the MPS of my MacBook Air, but this warning and error raised:

UserWarning: The operator ‘aten::sgn.out’ 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/_temp/anaconda/conda-bld/pytorch_1670525498485/work/aten/src/ATen/mps/MPSFallback.mm:11.)
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass

UserWarning: Error detected in ConvolutionBackward0. Traceback of forward call that caused the error

(Triggered internally at /Users/runner/work/_temp/anaconda/conda-bld/pytorch_1670525498485/work/torch/csrc/autograd/python_anomaly_mode.cpp:119.)
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass

File “/Users/user/miniconda3/envs/torch/lib/python3.10/site-packages/torch/autograd/init.py”, line 197, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: Function ‘ConvolutionBackward0’ returned nan values in its 0th output.
My system specifications are:
MacOS:Ventura 13.2
Chip Apple M1
Python 3.10.9
PyTorch 1.13.1

2 Likes

Same here! Please help us!

2 Likes

Having the same issue here

1 Like

If you need this please follow this issue [MPS] Add support for aten::sgn.out for MPS backend · Issue #86805 · pytorch/pytorch · GitHub

2 Likes

Thank you! I will watch it