Skip to content

feat: use threadpooltctl so that the CPU version can reuse the GPU vectorization - #61

Open
ilan-gold wants to merge 5 commits into
YosefLab:masterfrom
ilan-gold:ig/threadpool-cpu
Open

ilan-gold wants to merge 5 commits into
YosefLab:masterfrom
ilan-gold:ig/threadpool-cpu

Conversation

@ilan-gold

@ilan-gold ilan-gold commented Nov 9, 2026 •

Copy link
Copy Markdown

Hi @deto !

I like that LOC removed! This change basically routes the CPU code through the GPU codepath without touching anything else. Hopefully this makes reviewing easy :)

Fixes #60 by using https://github.com/joblib/threadpoolctl to allow for control over number of threads used by BLAS (which was stated as being the reason for the custom numba code)

I will open a PR to clean up some of the code into this one. Lastly, I think types would really help! Feel free to reject the other two but I really think there is no point in not taking this one. I am happy to produce a comparison of the speedup, but I think this PR can be reviewed in its absence, although the speedup is considerable!

I also added a repro test against what main would output, so you can move confidently with changes like this in the future, should they arise.

Removed comment about GPU and CPU block processing.
@ilan-gold

Copy link
Copy Markdown
Author

TBH It's even debatable whether we need threadpoolctl in this library. The caller can also just use it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unification of CPU + GPU Paths

2 participants