-
Notifications
You must be signed in to change notification settings - Fork 533
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
[BUG] PCA doesn't work with sparse matrices #5475
Comments
You are likely running into the error of cuml/python/cuml/decomposition/pca.pyx Line 365 in 93f7ddc
So you can either lower the dimension of the matrix or lower it's density so that it fits your GPU memory. |
Ok thank you. I'm just confused because the dense version works with way bigger matrices. Usually sparse matrices are used to save VRAM. |
@lowener why was this closed? Doesn’t it seem like a bug that dense PCA needs less memory than sparse PCA? |
I think it might be a bug with cuSPARSE. I created a replacement implementation for the |
@Intron7 This would be a great new feature that would be very helpful for many users! Your PR would be very welcomed! |
## Fixed bug with Sparse PCA function. #5475 I added a new `cov_sparse` function that replaces the `cov` function for `_sparse_fit`. It used a custom kernel to calculate the `gram_matrix` within `cov_sparse` . Authors: - Severin Dicks (https://github.com/Intron7) - Simon Adorf (https://github.com/csadorf) Approvers: - Corey J. Nolet (https://github.com/cjnolet) - Simon Adorf (https://github.com/csadorf) URL: #5493
Describe the bug
The PCA function doesn't work with sparse matrices.
Steps/Code to reproduce bug
Output
Expected behavior
To run PCA with sparse matrix without the error and get the same result.
Environment details (please complete the following information):
Click here to see environment details
channels:
dependencies:
prefix: /home/dleonpe/miniconda3/envs/rapids-23.06
Additional context
Has also been prevalent in older rapids versions.
The text was updated successfully, but these errors were encountered: