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

scale for sparse matrixes and mask #2941

Closed
Intron7 opened this issue Mar 22, 2024 · 0 comments · Fixed by #2942
Closed

scale for sparse matrixes and mask #2941

Intron7 opened this issue Mar 22, 2024 · 0 comments · Fixed by #2942
Assignees
Milestone

Comments

@Intron7
Copy link
Member

Intron7 commented Mar 22, 2024

What kind of feature would you like to request?

Additional function parameters / changed functionality / changed defaults?

Please describe your wishes

currently pp.scale with a mask_obs with a sparse matrix and with zero_center== False takes a really long time to update the sparse matrix. This also takes up a lot of memory because of the parity calculations. I would suggest a numba kernel that just swaps out the data. This works really well for rapids-singlecell and greatly improves performance and reduces the memory overhead.
I would open a PR with this kernel.


Performance for 90k cells and 25k genes:
without mask:
CPU 645 ms | GPU 37 ms | 20x
with mask:
CPU 22 s | GPU 50 ms | 460x

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

Successfully merging a pull request may close this issue.

3 participants