-
Notifications
You must be signed in to change notification settings - Fork 620
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
sparse_mean_variance_axis
now uses all cores
#3015
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3015 +/- ##
==========================================
+ Coverage 75.53% 76.27% +0.74%
==========================================
Files 117 117
Lines 12950 12795 -155
==========================================
- Hits 9782 9760 -22
+ Misses 3168 3035 -133
|
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.
Really cool!
Please use longer variable names. nthr
→num_threads
, s
→sums_minor
or so, s0
→???, m0
→???
Of course not for things like loop counters, but you know.
Also would be great to have comments, like “calculate sums and sum of squares along the minor axis” (if “minor” is correct here) then “go over minor axis again to calculate means and variances from the sums”.
PS: Benchmarks should be ready in a little bit, so you could add one to check how much this speeds things up! I’ll keep you posted
Some small benchmarks for 32 cores with
|
Benchmark changes
Comparison: https://github.com/scverse/scanpy/compare/ee8505b1c1578af0c50defdb3cf64ec18713669e..d9829365d7e23aea5680990ea8570d0a384291d3 More details: https://github.com/scverse/scanpy/pull/3015/checks?check_run_id=24144155267 |
I tentatively added a benchmark that runs just on Locally I don’t see any difference though, what’s wrong? Too small data? Numba not set up with correct number of threads? /edit: also I think the machine is not sufficiently tuned. The original run (before I added the |
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! Would be nice to add a sufficiently large dataset to the benchmarks to demonstrate the benefits.
…ses all cores) (#3024) Co-authored-by: Severin Dicks <37635888+Intron7@users.noreply.github.com>
This functions now uses all cores for
mean
&var
calculations.