pyg-team / pytorch_geometric

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

knn_graph error , because the scalar of k is too large? #4692

Open WMQ1999 opened 2 years ago

WMQ1999 commented 2 years ago

🐛 Describe the bug

I use knn_graph, and the parameter k=2000, then the error appeared:

RuntimeError: k <= 100INTERNAL ASSERT FAILED at "csrc/cuda/knn_cuda.cu":98, please report a bug to PyTorch. `k` needs to smaller than or equal to 100

Environment

rusty1s commented 2 years ago

Our knn_cuda implementation stores the neighbors for each node/thread in private local memory. As such, there is an upper bound in the number of neighbors.