pytorch_sparse: Segmentation fault in GPU sparse matrix by sparse matrix product
Hello! Thanks a lot for this PyTorch extension! But I faced with the following issue. I tried to run an example of sparse matrix by sparse matrix product from README.md, but on GPU, and get “Segmentation fault” error. Below is the code of my short script to reproduce error.
import torch
from torch_sparse import spspmm
device = torch.device("cuda")
indexA = torch.tensor([[0, 0, 1, 2, 2], [1, 2, 0, 0, 1]], device=device)
valueA = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float, device=device)
indexB = torch.tensor([[0, 2], [1, 0]], device=device)
valueB = torch.tensor([2, 4], dtype=torch.float, device=device)
indexC, valueC = spspmm(indexA, valueA, indexB, valueB, 3, 3, 2)
I use PyTorch 1.0, CUDA 8.0 and install both extensions (pytorch_scatter and pytorch_sparse) from source files in repositories.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (11 by maintainers)
Commits related to this issue
- Setup Documentation (#9) * documentation * fix README * better instructions * typo * fix url — committed to RexYing/pytorch_sparse by rusty1s 3 years ago
Did anyone find any solution? I am also facing this issue. The exact error is :
The error occurs randomly after a few iterations.
The error occurs in the following line:
where index_A has dim = [2230, 4404] index_B has dim = [4404, 2230]
index_A[0] has max element = 2229 and min element = 0 index_A[1] has max element = 4403 and min element = 0
index_B[0] has max element = 4403 and min element = 0 index_B[1] has max element = 2229 and min element = 0
You can recompile via python setup.py install or python setup.py test. In case it does not recompile the kernels, try deleting the build/ directory.