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
numba
to enable performant calculations on tree sequences without resorting to C code.numba
isn't the only tool of this sort so it seemed wise to do a quick survey of similar projects.jax
Has a
jit
compiler 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.codon
Precompiles 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
numpy
and 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
jit
decorator, for just-in-time compilation, but doesn't support jitted classes.mojo
Similar to
codon
but 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
,PyPy
In summary, Codon looks very interesting!
Beta Was this translation helpful? Give feedback.
All reactions