-
Notifications
You must be signed in to change notification settings - Fork 610
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
Hvg seurat v3 numba kernel #3017
Conversation
Benchmark changes
Comparison: https://github.com/scverse/scanpy/compare/3ba3f46b4e6e77e8c6f0551db9663822097b486a..277c1bfb0885234aa757d0fdaeaa9103eb8568e2 More details: https://github.com/scverse/scanpy/pull/3017/checks?check_run_id=25329779518 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3017 +/- ##
==========================================
- Coverage 75.87% 75.86% -0.01%
==========================================
Files 110 110
Lines 12533 12533
==========================================
- Hits 9509 9508 -1
- Misses 3024 3025 +1
|
~500k Cells. |
Indeed, ~3-7x faster for me & of course quite a bit more memory efficient (quickly checked with scalene). Tests keep working (for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Kinda suprised how much faster this is.
You could probably get another big speed up by operating on the whole matrix at once, and not creating batch specific matrices.
But I think fine as is.
I added a couple points to address, but that's just naming and docs.
Would also be nice to have a timing benchmark for this. |
Co-authored-by: Isaac Virshup <[email protected]>
It is the whole matrix for each batch. It's just called batch_counts because I needed to make sure the format is csr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more of getting rid of the whole for b in np.unique(batch_info)
loop and doing the whole thing in two passes over the matrix.
But LGTM, and I think ready to merge once those tests get fixed
I don't know what makes the tests fail with dask in utils |
Co-authored-by: Severin Dicks <[email protected]>
Adds a numba kernel for
seurat_v3
for sparse matrices. This kernel is a lot faster and more memory efficient. I doesn't copy nor promotes the matrix to 64-bit floats.