Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NotImplementedError: Could not run 'aten::index.Tensor' on MPS #77794

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

Closed
philspence opened this issue May 18, 2022 · 17 comments
Closed

NotImplementedError: Could not run 'aten::index.Tensor' on MPS #77794

philspence opened this issue May 18, 2022 · 17 comments
Labels
feature A request for a proper, new feature. module: mps Related to Apple Metal Performance Shaders framework triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@philspence
Copy link

πŸ› Describe the bug

I see that there are other NotImplementedErrors being report but wanted to add this one to the list too:

import torch

t = torch.tensor([0, 1, 2], device='mps')
t[t == 1]

NotImplementedError: Could not run 'aten::index.Tensor' with arguments from the 'MPS' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::index.Tensor' is only available for these backends: [Dense, Negative, UNKNOWN_TENSOR_TYPE_ID, QuantizedXPU, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, SparseCPU, SparseCUDA, SparseHIP, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, SparseXPU, UNKNOWN_TENSOR_TYPE_ID, SparseVE, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, NestedTensorCUDA, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID, UNKNOWN_TENSOR_TYPE_ID].

Versions

Collecting environment information...
PyTorch version: 1.12.0.dev20220518
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.3.1 (arm64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: version 3.22.3
Libc version: N/A

Python version: 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:42:03) [Clang 12.0.1 ] (64-bit runtime)
Python platform: macOS-12.3.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.22.3
[pip3] torch==1.12.0.dev20220518
[pip3] torchaudio==0.11.0
[pip3] torchvision==0.12.0
[conda] numpy 1.22.3 py310h99fd38b_2 conda-forge
[conda] torch 1.12.0.dev20220518 pypi_0 pypi
[conda] torchaudio 0.11.0 pypi_0 pypi
[conda] torchvision 0.12.0 pypi_0 pypi

@albanD albanD added feature A request for a proper, new feature. triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: mps Related to Apple Metal Performance Shaders framework labels May 18, 2022
@albanD
Copy link
Collaborator

albanD commented May 18, 2022

Hi,

Thanks for the report.
Added to the tracking issue to prioritize adding it #77764

@alin256
Copy link

alin256 commented Aug 8, 2022

I am also missing the 'aten::index.Tensor' feature.

@kulinseth
Copy link
Collaborator

Fixed in latest nightly.

@a19grey
Copy link

a19grey commented Sep 4, 2022

I ran pip install torch on my M2 system this morning, but still get this error. Despite, thank you, fixing it 13 days ago. Do I need to pull a newer release than whatever comes with "pip install torch"?

Oh! and I'm on python 3.8 so that may be the issue...

@Joe-Ecust
Copy link

I ran "conda install pytorch torchvision torchaudio -c pytorch" on my M1 Mac today, but still get "NotImplementedError: Could not run 'aten::index.Tensor' with arguments from the 'MPS' backend. " error. Is it fixed yet?

@mkagenius
Copy link

Fixed in latest nightly.

@kulinseth I think only index.Tensor_out is fixed and not index.Tensor . Correct me if I am wrong.

@kulinseth
Copy link
Collaborator

@mkagenius tensor_out is indeed fixed . Tensor.tensor_put is ready and I will create a PR soon

@Ekberjan
Copy link

Ekberjan commented Oct 11, 2022

Hi @kulinseth,
Any progress regarding Tensor.tensor_put?
The original problem still exists even in the latest release.

@kulinseth
Copy link
Collaborator

kulinseth commented Oct 11, 2022

Hi @kulinseth,
Any progress regarding Tensor.tensor_put?
The original problem still exists even in the latest release.

@Ekberjan The support for the Op already exists in the Torch Nightly. Can you provide a specific example where you are still seeing this issue?

@Ekberjan
Copy link

Ekberjan commented Oct 12, 2022

Thanks for your reply @kulinseth.
I'm using the latest release, not the nightly; thought it's included in the latest version.
The below code throws that error (which is from yolov7 official implementation):

    na, nt = self.na, targets.shape[0]  # number of anchors, targets
    indices, anch = [], []
    gain = torch.ones(7, device=targets.device).long()  # normalized to gridspace gain
    ai = torch.arange(na, device=targets.device).float().view(na, 1).repeat(1, nt)  # same as .repeat_interleave(nt)
    targets = torch.cat((targets.repeat(na, 1, 1), ai[:, :, None]), 2)  # append anchor indices

    g = 0.5  # bias
    off = torch.tensor([[0, 0],
                        [1, 0], [0, 1], [-1, 0], [0, -1],  # j,k,l,m
                        # [1, 1], [1, -1], [-1, 1], [-1, -1],  # jk,jm,lk,lm
                        ], device=targets.device).float() * g  # offsets

    for i in range(self.nl):
        anchors = self.anchors[i]
        gain[2:6] = torch.tensor(p[i].shape)[[3, 2, 3, 2]]  # xyxy gain

        # Match targets to anchors
        t = targets * gain
        if nt:
            # Matches
            r = t[:, :, 4:6] / anchors[:, None]  # wh ratio
            j = torch.max(r, 1. / r).max(2)[0] < self.hyp['anchor_t']  # compare
            # j = wh_iou(anchors, t[:, 4:6]) > model.hyp['iou_t']  # iou(3,n)=wh_iou(anchors(3,2), gwh(n,2))
            t = t[j]  # filter

@Ekberjan
Copy link

Ekberjan commented Oct 12, 2022

I tried the nightly as well, and got this error:
NotImplementedError: The operator 'aten::remainder.Tensor_out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

@kulinseth
Copy link
Collaborator

I tried the nightly as well, and got this error: NotImplementedError: The operator 'aten::remainder.Tensor_out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

Thanks @Ekberjan , can you please upvote on the General MPS Op coverage issue page, if you haven;t already?

Also this is a good first issue, if you are interested in contributing to MPS backend.

@sandeepwadhwa-ai
Copy link

Tried the latest release version and the nightly build. Both give out the same error on M1.

@XiangkunFang
Copy link

Same here. Have tried both the 1.13.1 and nightly version, but still got "NotImplementedError: The operator 'aten::remainder.Tensor_out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on #77764. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPSβ€œ

@leedrake5
Copy link

I've got a truly bizarre variant of this bug - I can train a model just fine, but the NotImplementedError: The operator 'aten::roll' is not currently implemented for the MPS device. shows up when I try to predict a model trained on the same Mac. Is there some reason prediction would fail when training would succeed? Doesn't a model have to predict the validation set while training?

@GF-Huang
Copy link

Pytorch 2.5.1 issue still.

GPU: RTX 4060ti 8G

> conn_matrix
tensor([[0., 0., 0.,  ..., 1., 0., 1.],
        [1., 1., 0.,  ..., 1., 1., 0.],
        [0., 0., 0.,  ..., 0., 0., 0.],
        ...,
        [0., 1., 0.,  ..., 0., 0., 1.],
        [1., 1., 1.,  ..., 0., 0., 0.],
        [1., 0., 1.,  ..., 1., 1., 1.]], device='cuda:0')

> indexes
tensor([True, True, True,  ..., True, True, True], device='cuda:0')

> coo_conn_matrix = conn_matrix.to_sparse_coo()
> coo_conn_matrix[indexes]
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[7], [line 2](vscode-notebook-cell:?execution_count=7&line=2)
      [1](vscode-notebook-cell:?execution_count=7&line=1) coo_conn_matrix = conn_matrix.to_sparse_coo()
----> [2](vscode-notebook-cell:?execution_count=7&line=2) coo_conn_matrix[indexes]

File c:\Users\jokeh\miniconda3\envs\mlagents\lib\site-packages\torch\utils\_device.py:106, in DeviceContext.__torch_function__(self, func, types, args, kwargs)
    [104](file:///C:/Users/jokeh/miniconda3/envs/mlagents/lib/site-packages/torch/utils/_device.py:104) if func in _device_constructors() and kwargs.get('device') is None:
    [105](file:///C:/Users/jokeh/miniconda3/envs/mlagents/lib/site-packages/torch/utils/_device.py:105)     kwargs['device'] = self.device
--> [106](file:///C:/Users/jokeh/miniconda3/envs/mlagents/lib/site-packages/torch/utils/_device.py:106) return func(*args, **kwargs)

NotImplementedError: Could not run 'aten::index.Tensor' with arguments from the 'SparseCUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::index.Tensor' is only available for these backends: [CPU, CUDA, HIP, MPS, IPU, XPU, HPU, VE, MTIA, PrivateUse1, PrivateUse2, PrivateUse3, Meta, FPGA, MAIA, Vulkan, Metal, QuantizedCPU, QuantizedCUDA, QuantizedHIP, QuantizedMPS, QuantizedIPU, QuantizedXPU, QuantizedHPU, QuantizedVE, QuantizedMTIA, QuantizedPrivateUse1, QuantizedPrivateUse2, QuantizedPrivateUse3, QuantizedMeta, CustomRNGKeyId, MkldnnCPU, SparseCsrCPU, SparseCsrCUDA, SparseCsrHIP, SparseCsrMPS, SparseCsrIPU, SparseCsrXPU, SparseCsrHPU, SparseCsrVE, SparseCsrMTIA, SparseCsrPrivateUse1, SparseCsrPrivateUse2, SparseCsrPrivateUse3, SparseCsrMeta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradHIP, AutogradXLA, AutogradMPS, AutogradIPU, AutogradXPU, AutogradHPU, AutogradVE, AutogradLazy, AutogradMTIA, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, AutogradMeta, AutogradNestedTensor, Tracer, AutocastCPU, AutocastXPU, AutocastMPS, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

Undefined: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
CPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCPU.cpp:30476 [kernel]
CUDA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCUDA.cpp:44679 [kernel]
HIP: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
MPS: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
IPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
XPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
HPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
VE: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
MTIA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
PrivateUse1: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
PrivateUse2: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
PrivateUse3: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
Meta: registered at /dev/null:241 [kernel]
FPGA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
MAIA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
Vulkan: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
Metal: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedCPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterQuantizedCPU.cpp:954 [kernel]
QuantizedCUDA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedHIP: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedMPS: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedIPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedXPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedHPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedVE: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedMTIA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedPrivateUse1: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedPrivateUse2: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedPrivateUse3: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
QuantizedMeta: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
CustomRNGKeyId: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
MkldnnCPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrCPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrCUDA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrHIP: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrMPS: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrIPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrXPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrHPU: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrVE: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrMTIA: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrPrivateUse1: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrPrivateUse2: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrPrivateUse3: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
SparseCsrMeta: registered at C:\cb\pytorch_1000000000000\work\build\aten\src\ATen\RegisterCompositeExplicitAutogradNonFunctional.cpp:21615 [default backend kernel]
BackendSelect: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\BackendSelectFallbackKernel.cpp:3 [backend fallback]
Python: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\PythonFallbackKernel.cpp:153 [backend fallback]
FuncTorchDynamicLayerBackMode: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback]
Functionalize: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\FunctionalizeFallbackKernel.cpp:349 [backend fallback]
Named: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback]
Conjugate: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback]
Negative: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback]
ZeroTensor: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback]
ADInplaceOrView: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\VariableFallbackKernel.cpp:96 [backend fallback]
AutogradOther: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradCPU: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradCUDA: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradHIP: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradXLA: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradMPS: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradIPU: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradXPU: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradHPU: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradVE: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradLazy: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradMTIA: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradPrivateUse1: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradPrivateUse2: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradPrivateUse3: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradMeta: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
AutogradNestedTensor: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\VariableType_1.cpp:16894 [autograd kernel]
Tracer: registered at C:\cb\pytorch_1000000000000\work\torch\csrc\autograd\generated\TraceType_1.cpp:16106 [kernel]
AutocastCPU: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\autocast_mode.cpp:321 [backend fallback]
AutocastXPU: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\autocast_mode.cpp:463 [backend fallback]
AutocastMPS: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\autocast_mode.cpp:209 [backend fallback]
AutocastCUDA: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\autocast_mode.cpp:165 [backend fallback]
FuncTorchBatched: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\BatchRulesScatterOps.cpp:1230 [kernel]
BatchedNestedTensor: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback]
FuncTorchVmapMode: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback]
Batched: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback]
VmapMode: fallthrough registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback]
FuncTorchGradWrapper: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\TensorWrapper.cpp:207 [backend fallback]
PythonTLSSnapshot: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\PythonFallbackKernel.cpp:161 [backend fallback]
FuncTorchDynamicLayerFrontMode: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback]
PreDispatch: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\PythonFallbackKernel.cpp:165 [backend fallback]
PythonDispatcher: registered at C:\cb\pytorch_1000000000000\work\aten\src\ATen\core\PythonFallbackKernel.cpp:157 [backend fallback]

@TaylorHo
Copy link

TaylorHo commented May 4, 2025

I'm still getting this error on a macOS M3 device.

Output says:

NotImplementedError: Could not run 'aten::_sparse_coo_tensor_with_dims_and_tensors' with arguments from the 'SparseMPS' backend.

Can we reopen this issue, since more people are still having the same problem running it on MPS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A request for a proper, new feature. module: mps Related to Apple Metal Performance Shaders framework triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests