-
Notifications
You must be signed in to change notification settings - Fork 339
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
Remove Numba as a dependency #2841
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2841 +/- ##
==========================================
- Coverage 95.12% 94.33% -0.79%
==========================================
Files 107 107
Lines 9617 9621 +4
Branches 2226 2228 +2
==========================================
- Hits 9148 9076 -72
- Misses 280 350 +70
- Partials 189 195 +6 ☔ View full report in Codecov by Sentry. |
I ran the full test suite locally on my workstation with
|
I did some timings to check the performance of jitted and non-jitted versions of
|
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.
Alas, so it is. Perhaps Numba's still better for end users instead of libraries 🫡
It really is! Numba is a fantastic package, but the ∼3–5 month delays after a new release of Python outweigh the slight improvements in PlasmaPy's overall performance. The delays are also causing problems for fiasco which depends on PlasmaPy. Plus, depending on Numba also means that we can't test against Python beta releases and release candidates before the official release of Python. Sigh! Also it is great as always to hear from you! I hope you have been doing really well! |
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 also approve - give the scope of PlasmaPy, I think these minor enhancements from njit are not worth the operational issues. Thanks for running the comprehensive timing comparisons!
Awesome, thank you! I'll go ahead and merge it. I suspect this will make @wtbarnes happy. 🙃 |
Description
The purpose of this pull request is to test out dropping Numba as a dependency by dropping the
numba.njit
decorator from two formulary lite-functions. The lite-functions still exist as minimal functions that operate on NumPy arrays without any validations.Motivation
It often takes Numba ∼3–5 months before it becomes compatible with a new release of Python each October. Depending on Numba has the following adverse consequences:
I did some timings (reported in this comment) and found that the performance gains from using Numba are ∼1–3% for the charged particle radiography tests, and that our full test suite runs ∼1% quicker without a Numba dependency.
My view is that we get enough performance gains from dropping units and validations for the lite-functions, and that the drawbacks from depending on Numba are much more significant than the slight performance gains.
Alternatives
I've been hoping we could Cythonize the lite functions so that we could drop the Numba dependency. However, we haven't had the capacity to complete this.
Related issues and pull requests
Closes #1342.
Related to #1098, #1145, #2104, #2256, #2372, #2634, #2786.