Skip to content

scale for sparse matrixes and mask #2941

@Intron7

Description

@Intron7

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions