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
changed hvg with PR to work with numba #2612
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2612 +/- ##
==========================================
- Coverage 72.27% 72.00% -0.28%
==========================================
Files 105 105
Lines 11752 11840 +88
==========================================
+ Hits 8494 8525 +31
- Misses 3258 3315 +57
|
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’d like to see some deduplication and maintainability changes.
Please never create functions that don’t have a *
after the 3rd parameter at the latest (unless the function is called rgba
I guess).
Numba sadly has weird behavior around keyword-only arguments, but even if it ignores them (allowing to specify arguments positionally that shouldn’t), you should still call the function as if everything was working correctly. numba/numba#5655
>>> @numba.njit()
... def test(x, *, y):
... return x + y
>>> test(1, 2)
3 # no! bad numba! that should be a TypeError
Co-authored-by: Philipp A. <flying-sheep@web.de>
Co-authored-by: Philipp A. <flying-sheep@web.de>
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.
see unresolved conversations
Perf measurements for the use case of running the HVG tests on my machine (not very accurate, and not very reminiscent of how users use it). Tests get a bit slower, real world gets faster.
|
Co-authored-by: Philipp A. <flying-sheep@web.de>
The pearson residuals implementation for hvg is currently very slow and memory inefficient. I switched it to a numba kernel for csc and dense F-continous arrays.
It's based on the cuda-kernel in rapids-singlecell. For 90000 cells we go from 24 seconds to less than 5 with the new implementation. For smaller datasets we don't see a speedup.