Skip to content
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

Possibility for GPU support? #37

Open
rohanrajpal opened this issue Jul 22, 2020 · 4 comments
Open

Possibility for GPU support? #37

rohanrajpal opened this issue Jul 22, 2020 · 4 comments

Comments

@rohanrajpal
Copy link

Thanks a lot for sharing this library.

I was wondering if we can have GPU support? Not sure how tough it would be, but I'll be glad to help! If someone knows some resources on how to go ahead on this, please do share.

@ymwdalex
Copy link
Collaborator

@rohanrajpal thanks for the message.

Years ago when we build this package, we investigated the GPU solution. We didn't find a cuda sparse matrix multiple sparse matrix solution at that time.

Maybe things have changed. Any suggestions/ideas are welcome!

@aerdem4
Copy link

aerdem4 commented Jul 24, 2020

@rohanrajpal RAPIDS cuML has NearestNeighbors implementation. It currently supports euclidean distance for dense matrices on GPU but they are working on cosine similarity on sparse matrices for future releases (probably 0.16 or 0.17). https://docs.rapids.ai/api/cuml/stable/api.html?highlight=neighbors#cuml.neighbors.NearestNeighbors

As a temporary solution, you can use cupy sparse matrices and dot product if you don't have any memory limitation.

Considering availability of these tools, it may be out of scope for this package.

@rohanrajpal
Copy link
Author

@rohanrajpal RAPIDS cuML has NearestNeighbors implementation. It currently supports euclidean distance for dense matrices on GPU but they are working on cosine similarity on sparse matrices for future releases (probably 0.16 or 0.17). https://docs.rapids.ai/api/cuml/stable/api.html?highlight=neighbors#cuml.neighbors.NearestNeighbors

As a temporary solution, you can use cupy sparse matrices and dot product if you don't have any memory limitation.

Considering availability of these tools, it may be out of scope for this package.

Thanks for sharing. I'll have a look into it.

@sarimak
Copy link

sarimak commented Feb 23, 2021

I would be very skeptical about the benefit from using GPU for sparse matrix multiplication. Have look at what various sources on the Internet say about bad cache locality and bad suitability for long vector operations which are crucial for the speedups provided by GPU acceleration. Plus the overhead when copying the memory from RAM to GPU RAM and the results back. Especially with large matrices which don't fit into GPU RAM at once, I would not expect any speedup. Dense matrices, especially if they fit into GPU RAM are completely different story though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants