pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.33k stars 3.66k forks source link

AddMetaPaths throws MKL error #9567

Open bryceForrest opened 3 months ago

bryceForrest commented 3 months ago

🐛 Describe the bug

AddMetaPaths is not happy with me. Just basic usage going on here:

metapaths = [
    [
        ('item', 'rev_buy', 'user'),
        ('user', 'buy', 'item')
    ]
]
T.AddMetaPaths(metapaths)(data)
RuntimeError: addmm: computation on CPU is not implemented for SparseCsr + SparseCsr @ SparseCsr without MKL. PyTorch built with MKL has better support for addmm with sparse CPU tensors.

Versions

PyTorch version: 2.3.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 14.5 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: Could not collect
Libc version: N/A

Python version: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:34:54) [Clang 16.0.6 ] (64-bit runtime)
Python platform: macOS-14.5-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
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

CPU:
Apple M3

Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] torch==2.3.1
[pip3] torch_cluster==1.6.3
[pip3] torch-geometric==2.6.0
[pip3] torch_scatter==2.1.2
[pip3] torch_sparse==0.6.18
[pip3] torchaudio==2.3.1
[pip3] torchmetrics==1.4.0.post0
[pip3] torchvision==0.18.1
[conda] cpuonly                   2.0                           0    pytorch
[conda] libtorch                  2.3.1           cpu_generic_hac4f340_1    conda-forge
[conda] nomkl                     1.0                  h5ca1d4c_0    conda-forge
[conda] numpy                     1.24.4          py311hb8f3215_0    conda-forge
[conda] pytorch                   2.3.1           cpu_generic_py311h82099cb_1    conda-forge
[conda] pytorch-mutex             1.0                         cpu    pytorch
[conda] pytorch_cluster           1.6.3           py311h7f9f594_4    conda-forge
[conda] pytorch_scatter           2.1.2           cpu_py311h7f9f594_6    conda-forge
[conda] pytorch_sparse            0.6.18          py311h1736223_2    conda-forge
[conda] torch-geometric           2.6.0                    pypi_0    pypi
[conda] torchaudio                2.3.1                 py311_cpu    pytorch
[conda] torchmetrics              1.4.0.post0        pyhd8ed1ab_0    conda-forge
[conda] torchvision               0.18.1                py311_cpu    pytorch
jeet-dekivadia commented 3 months ago

It looks like you're encountering an issue because your PyTorch installation doesn’t have MKL support, which is required for the operation with sparse tensors. If possible, try using a PyTorch build with MKL. You might need to switch to a different version or setup that includes MKL for better support with sparse CPU tensors.

bryceForrest commented 3 months ago

Yeah, I mean I gathered that, but MKL doesn't support the Apple arm64 chips as far as I can tell.

I assume the solution here would be to have a fallback method if MKL is not available (or wait around for PyTorch to support this operation without MKL on their end).