Automatic fallback to cpu

pannous: <p>Feature suggestion: enable automatic fallback for layers where mps implementations are not available (yet).</p>
<p>Case in point: I load a random pytorch model, do model.to(“mps”) and upon running the model get an error such as:</p>
<p>‘aten::_slow_conv2d_forward’ is only available for these backends: SparseCPU … …</p>
<aside class="onebox githubissue" data-onebox-src="https://github.com/pytorch/pytorch/issues/77931">
  <header class="source">

      <a href="https://github.com/pytorch/pytorch/issues/77931" target="_blank" rel="noopener nofollow ugc">github.com/pytorch/pytorch</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pytorch/pytorch/issues/77931" target="_blank" rel="noopener nofollow ugc">convolution operator not implemented for mps device</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2022-05-20" data-time="02:16:42" data-timezone="UTC">02:16AM - 20 May 22 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/XWHtorrentx" target="_blank" rel="noopener nofollow ugc">
          <img alt="XWHtorrentx" src="https://avatars.githubusercontent.com/u/98312459?v=4" class="onebox-avatar-inline" width="20" height="20">
          XWHtorrentx
        </a>
      </div>
    </div>

    <div class="labels">
        <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">
          triaged
        </span>
        <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">
          module: mps
        </span>
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">### 🐛 Describe the bug

I was training resnet50 (code from torchvision) on m1 pr<span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">o Macbook. 
`NotImplementedError: Could not run 'aten::_slow_conv2d_forward' with arguments from the 'MPS' backend.`
I tried every network from torchvision which consists of convolution operator, same error. 

### Versions

# Name                    Version                   Build  Channel
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2022.5.18            h4653dfc_0    conda-forge
certifi                   2022.5.18                pypi_0    pypi
charset-normalizer        2.0.12                   pypi_0    pypi
cycler                    0.11.0                   pypi_0    pypi
fonttools                 4.33.3                   pypi_0    pypi
idna                      3.3                      pypi_0    pypi
kiwisolver                1.4.2                    pypi_0    pypi
libffi                    3.4.2                h3422bc3_5    conda-forge
libzlib                   1.2.11            h90dfc92_1014    conda-forge
matplotlib                3.5.2                    pypi_0    pypi
ncurses                   6.3                  h07bb92c_1    conda-forge
numpy                     1.22.3                   pypi_0    pypi
openssl                   3.0.3                ha287fd2_0    conda-forge
packaging                 21.3                     pypi_0    pypi
pillow                    9.1.1                    pypi_0    pypi
pip                       22.1               pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9                    pypi_0    pypi
python                    3.9.12          h14b404e_1_cpython    conda-forge
python-dateutil           2.8.2                    pypi_0    pypi
python_abi                3.9                      2_cp39    conda-forge
pytorch-ignite            0.4.9                    pypi_0    pypi
readline                  8.1                  hedafd6a_0    conda-forge
requests                  2.27.1                   pypi_0    pypi
setuptools                62.3.1           py39h2804cbe_0    conda-forge
six                       1.16.0                   pypi_0    pypi
sqlite                    3.38.5               h40dfcc0_0    conda-forge
tk                        8.6.12               he1e0b03_0    conda-forge
torch                     1.12.0.dev20220519          pypi_0    pypi
torchaudio                0.11.0                   pypi_0    pypi
torchvision               0.12.0                   pypi_0    pypi
typing-extensions         4.2.0                    pypi_0    pypi
tzdata                    2022a                h191b570_0    conda-forge
urllib3                   1.26.9                   pypi_0    pypi
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
wrapt                     1.14.1                   pypi_0    pypi
xz                        5.2.5                h642e427_1    conda-forge
zlib                      1.2.11            h90dfc92_1014    conda-forge</span></p>
  </div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


albanD: <p>Hi!</p>
<p>We added such a feature in master already!<br>
It will be in the next nightly build tomorrow (Saturday May 20th) and is already available if you build from source!</p>

sidroopdaska: <p>Hey <a class="mention" href="/u/alband">@albanD</a>, is there an ETA on the implementation of this operator? I’m curious how any of the CNN benchmarking was conducted without the presence of this operator? Thanks in advance.</p>

albanD: <p>Hi,</p>
<p>The absence of this operator is linked to some binary incompatibilities with torchvision which confuses some systems.<br>
This should work fine in the upcoming 1.12.1</p>