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
Add ufunc and function dispatchers #354
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This means ufuncs don't reference other JIT functions, but other specific ufuncs. This provides more flexibility, and runtime speed. This comes at a slight increase in JIT compilation time during the first invocation. JIT functions also reference specific ufuncs rather than general JIT arithmetic functions. This allows for using lookup tables in many common JIT functions, such as dense polynomial arithmetic.
mhostetter
force-pushed
the
optimize-jit-functions
branch
from
May 3, 2022 13:44
f44002d
to
e7c66de
Compare
Codecov Report
@@ Coverage Diff @@
## master #354 +/- ##
==========================================
+ Coverage 92.93% 93.52% +0.59%
==========================================
Files 42 41 -1
Lines 5404 5265 -139
==========================================
- Hits 5022 4924 -98
+ Misses 382 341 -41
Continue to review full report at Codecov.
|
mhostetter
force-pushed
the
optimize-jit-functions
branch
4 times, most recently
from
May 9, 2022 18:15
7296a28
to
f395465
Compare
mhostetter
force-pushed
the
optimize-jit-functions
branch
from
May 9, 2022 19:46
f395465
to
1e19b27
Compare
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR creates ufunc and function dispatchers. These are classes that wrap a Python implementation of the ufunc or function. Depending on the field being used, either a JIT-compiled or pure-Python ufunc/function is returned. All the necessary input/output conversion and verification is done.
This cleans up the class clutter. It will also make adding GPU support easier and more convenient.
Additionally, JIT functions now use the lookup ufuncs (if configured). This has a massive speed up for small fields that use lookup tables. Previously, only explicit calculation was used in JIT functions (eg, polynomial multiplication, matrix multiplication, etc). The difference is most notable in
GF(p^m)
fields.Before
After