Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPS] PyTorch Nightly with MPS on Mac M1 does not work #172

Open
nicolas-schreiber opened this issue Mar 31, 2023 · 3 comments
Open

[MPS] PyTorch Nightly with MPS on Mac M1 does not work #172

nicolas-schreiber opened this issue Mar 31, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@nicolas-schreiber
Copy link

Hi, I am currently trying to get pytorch geometric to run on my Mac with M1 Pro, the recent update to 13.3 fixed quite a few things. Look here for a bit more info about that: pytorch/pytorch#96610

But currently I have following error message that points towards pytorch_cluster:

Traceback (most recent call last):
  File "/Users/nic/Projects/pytorch_geometric/examples/pointnet2_classification.py", line 104, in <module>
    train(epoch)
  File "/Users/nic/Projects/pytorch_geometric/examples/pointnet2_classification.py", line 70, in train
    loss = F.nll_loss(model(data), data.y)
  File "/Users/nic/mambaforge/envs/imitation/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/nic/Projects/pytorch_geometric/examples/pointnet2_classification.py", line 56, in forward
    sa1_out = self.sa1_module(*sa0_out)
  File "/Users/nic/mambaforge/envs/imitation/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/nic/Projects/pytorch_geometric/examples/pointnet2_classification.py", line 20, in forward
    idx = fps(pos, batch, ratio=self.ratio)
  File "/Users/nic/mambaforge/envs/imitation/lib/python3.9/site-packages/torch_geometric/nn/pool/__init__.py", line 51, in fps
    return torch_cluster.fps(x, batch, ratio, random_start)
  File "/Users/nic/mambaforge/envs/imitation/lib/python3.9/site-packages/torch_cluster/fps.py", line 70, in fps
    return torch.ops.torch_cluster.fps(src, ptr, r, random_start)
  File "/Users/nic/mambaforge/envs/imitation/lib/python3.9/site-packages/torch/_ops.py", line 642, in __call__
    return self._op(*args, **kwargs or {})
RuntimeError: src.device().is_cpu() INTERNAL ASSERT FAILED at "csrc/cpu/fps_cpu.cpp":14, please report a bug to PyTorch. src must be CPU tensor

To replicate this I just change the device in pytorch_geometric/examples/pointnet2_classification.py to mps

My current installed packages are following:

torch                     2.1.0.dev20230331          pypi_0    pypi
torch-cluster             1.6.1                    pypi_0    pypi
torch-geometric           2.3.0                    pypi_0    pypi
torch-scatter             2.1.1                    pypi_0    pypi
torch-sparse              0.6.17                   pypi_0    pypi
torchaudio                2.0.0.dev20230313          pypi_0    pypi
torchvision               0.16.0.dev20230331          pypi_0    pypi

So a lot of nightly things. I know that this makes the support quite difficult, but maybe someone can still point me to a solution to this issue.

@nicolas-schreiber
Copy link
Author

Hm, ok I might've just realised that one would have to specifically implement code for the MPS interfaces which are currently not implemented and might be not too easy to implement, so I guess I am going back to CPU based tests...

Do I understand the issue correctly? If so the issue can be closed

@rusty1s
Copy link
Owner

rusty1s commented Apr 2, 2023

Yes, I am sorry. We don‘t have any MPS-specific implementation right now. You might be able to convert to CPU before calling the cluster routines, and back to MPS afterwards.

@github-actions
Copy link

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

@github-actions github-actions bot added the stale label Sep 30, 2023
@rusty1s rusty1s added bug Something isn't working and removed stale labels Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants