Survey of JIT and pre-compilation projects in Python #3223
benjeffery
started this conversation in
General
Replies: 2 comments 4 replies
-
|
So we don't necessarily have to use the jitclass layout with numba, it's just easier than passing around 15 arrays (or whatever it is) to the function. Maybe that would be less problematic overall, though, if we could more-or-less share the same code between (say) numba and codon? |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Experimenting with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In #3135 we're planning to add some code to make it easier to work with
numbato enable performant calculations on tree sequences without resorting to C code.numbaisn't the only tool of this sort so it seemed wise to do a quick survey of similar projects.jaxHas a
jitcompiler for python functions, but focus of library is on ML/AI work as it does auto diff of those functions. Has own numpy-like module asjax.numpy. Requires different style code as jax arrays are immutable. Doesn't support jitted classes, analogous thing would be immutable dataclasses.codonPrecompiles to native machine code an "almost Python" (ASCII strings, 64 bit int, unordered dicts, fixed-size tuples, some dynamic things don't work). Has it's own
numpyand interops with existing Python code/libraries, so could call out to tskit to get arrays and then use them, or even call other tskit methods.It also has a
jitdecorator, for just-in-time compilation, but doesn't support jitted classes.mojoSimilar to
codonbut a much more different language that is "Python-like". Compiler is closed source, doesn't have own numpy, calls usual numpy through Python interop layer.Others
Other similar things which don't seem worth looking at as speedups modest:
nuitka,PyPyIn summary, Codon looks very interesting!
Beta Was this translation helpful? Give feedback.
All reactions