Repository navigation
feat: compile njit functions with nogil=True - #217
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #217 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 579 579
=========================================
Hits 579 579 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ab07284 to
0f8ec66
Compare
Merging this PR will not alter performance
Performance Changes
Comparing |
|
wasn’t the idea to expose the knob? I see |
I saw it as a change with no regressions pretty much and I didn't want to change the Also because here I wrote:
So if we start passing all args one by one of njit, we kind of have a coupling that didn't seem very necessary. It could be just a kwargs we pass over. So I didn't want to go into that rabbithole and changed the default instead. |
|
As mentioned in person, no need to muck with the qualname since we don’t need to cache more versions. The only reason |
|
hi @flying-sheep , so after we chat then I still have to ask. Why do we not just pass the rest of the kwargs as just kwargs? Why does fau then need to know about kwargs other than parallelize? Is it for managing fau defaults? Then can't we just pass everything as is except the ones we want to control the defaults of? This way the whole #213 would be solved as well no? If somebody wanted inline they'd pass inline and it would be their and numba's problem |
|
Typing. I’d rather update fau than have no autocomplete I think. |
c00c301 to
d82cf7c
Compare
|
ok then I think it's ready for review! |
|
there we go, I finally got all the variance taken care of on |
Part of #213.
Both the parallel and serial versions produced by
fast_array_utils.numba.njitare now compiled withnogil=True, so the GIL is released while they run and callers can get real multithreaded speedups (e.g. dask's threaded scheduler, or squidpy's thread pools).Behavior change: jitted functions that mutate shared buffers from multiple threads no longer get the GIL's accidental serialization. That was never a guarantee (see the race example in #213, which loses updates even with
nogil=False), but it's worth a release note.The other knobs discussed in #213 (
error_model,inline, …) are left for follow-ups.@flying-sheep I think the difference is due to different hardware. (my guess is nogil makes it more interruptible)