Using Macbook GPU's with Pytorch

K_awanish: <p>Hi All,</p>
<p>I have a new macbook and i was trying to setup pytorch on it. since this laptop doesn’t have NVIDIA gpu i was trying to work with MPS framework. but since i am completely new to this MPS thing how do i go about it ?</p>
<p>I have to use pytorch geometric. on first random try i was able to install everything and device was detecting MPS instead of cuda which meant my torch was able to use mac’s GPU, but when i ran some codes in torch_geometric i got some errors, something like</p>
<p>“operation is not supported on metal acceleration”,</p>
<p>can someone please show me the way for this configuration.</p>
<p>Thanks</p>

Aknw_Fen: <p>There is still an open issue:</p>
<aside class="onebox githubissue" data-onebox-src="https://github.com/pyg-team/pytorch_geometric/issues/4776">
  <header class="source">

      <a href="https://github.com/pyg-team/pytorch_geometric/issues/4776" target="_blank" rel="noopener nofollow ugc">github.com/pyg-team/pytorch_geometric</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue" data-github-private-repo="false">
	  <svg width="60" height="60" class="github-icon" viewBox="0 0 14 16" aria-hidden="true"><path fill-rule="evenodd" 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/pyg-team/pytorch_geometric/issues/4776" target="_blank" rel="noopener nofollow ugc">Is it possible to get GPU acceleration support on the M1 chip?</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2022-06-07" data-time="02:45:10" data-timezone="UTC">02:45AM - 07 Jun 22 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/HuangStomach" target="_blank" rel="noopener nofollow ugc">
          <img alt="HuangStomach" src="https://avatars.githubusercontent.com/u/8955394?v=4" class="onebox-avatar-inline" width="20" height="20">
          HuangStomach
        </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;">
          feature
        </span>
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">### 🚀 The feature, motivation and pitch

You can see from [pytorch's blog](https<span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/) that the latest version of pytorch already supports GPU acceleration on M1 chips, which can be easily achieved by directly using `to('mps')`, may I ask if pyg also has plans to do similar support?

### Alternatives

_No response_

### Additional context

_No response_</span></p>
  </div>

  </article>

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

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

<p>I assume that only some functionality is available.</p>
<p>I’ve been looking at their framework here, but am unsure yet whether its worth trying: <a href="https://github.com/ml-explore/mlx" class="inline-onebox" rel="noopener nofollow ugc">GitHub - ml-explore/mlx: MLX: An array framework for Apple silicon</a></p>
<p>The syntax seems like PyTorch.</p>

alanngnet: <p>PyTorch on MPS works fabulously in my experience (training neural networks), but I don’t know about “geometric.” I’d would focus on geometric-specific debugging in your case. Maybe first confirm that you have more common PyTorch libraries working on MPS?</p>