-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Comments
Hi, Thanks for the report. |
I am also missing the 'aten::index.Tensor' feature. |
Fixed in latest nightly. |
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... |
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? |
@kulinseth I think only index.Tensor_out is fixed and not index.Tensor . Correct me if I am wrong. |
@mkagenius tensor_out is indeed fixed . Tensor.tensor_put is ready and I will create a PR soon |
Hi @kulinseth, |
@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? |
Thanks for your reply @kulinseth.
|
I tried the nightly as well, and got this error: |
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. |
Tried the latest release version and the nightly build. Both give out the same error on M1. |
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 |
I've got a truly bizarre variant of this bug - I can train a model just fine, but the |
Pytorch 2.5.1 issue still. GPU: > 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] |
I'm still getting this error on a macOS M3 device. Output says:
Can we reopen this issue, since more people are still having the same problem running it on MPS? |
π Describe the bug
I see that there are other NotImplementedErrors being report but wanted to add this one to the list too:
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
The text was updated successfully, but these errors were encountered: