rusty1s / pytorch_sparse

PyTorch Extension Library of Optimized Autograd Sparse Matrix Operations
MIT License
1.01k stars 147 forks source link

spmm_mean error with large input #223

Closed ilil96 closed 2 years ago

ilil96 commented 2 years ago
import torch
from torch_sparse.matmul import spmm_mean 

adj = torch.load('adj')
x = torch.rand(adj.size(1), 256, device='cuda:0')

out = spmm_mean(adj, x)
print(out)

Illegal memory access error comes out when I run torch_sparse.matmul.spmm_mean with large input on GPU. The above is the test code that reproduces the error. In the test code, the size of sparse tensor (adj) is (95112, 8643286) and the randomly generated dense tensor ('x') which would be fed into spmm_mean with the sparse tensor is (8643286, 256). When I try to access the output tensor of spmm_mean, which is 'out' in the code, with print or any other operation, I get error message like 'RuntimeError: CUDA error: an illegal memory access was encountered'. The code works well when I use somewhat smaller dense tensor like (8643286, 128).

I attach the serialized binary file of the sparse tensor that I'm using for testing (link: adj.zip). You can download, unzip and load with torch.load call as the code above.

rusty1s commented 2 years ago

I can reproduce this, thank you! Will investigate further.

github-actions[bot] commented 2 years ago

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?