5 ms·
The ahead of time compilation output is... Well.. let's say difficult to package _properly_ (compare it to Cython where it's well supported and documented). Tha
by korijn 5y ago
The ahead of time compilation output is... Well.. let's say difficult to package _properly_ (compare it to Cython where it's well supported and documented). That makes it useless for production, unless you want to ship giant containers with compilers etc
- Der_Einzige 5y agoWhat??? Numba has more usage in the AI/ML community than Cython has ever had by anyone, ever. "Fits very few use cases" LOL okay without numba there's no UMAP and HDBScan and those are pretty popular and important libraries that come to mind just off the top of my head... Also, claiming Cython is well documented also gets a huge LOL from me as someone whose actually written a bit of Cython.
- cycomanic 5y agoI have written quite a bit of cython code as well and at least the last time I looked cython was much better documented than numba (it has been a couple of years though so things might have improved on the numba side), and I would agree with the previous poster is generally quite well documented.
- korijn 5y agoAlso I am specifically referring to the documentation on creating ahead of time compiled packages using Numba vs Cython, but perhaps that was unclear.
- VHRanger 5y agoFWIW Numba's JIT caches the compiled function as long as you don't call it again with different type signatures (eg. int32[] vs int64[]) I've succesfully deployed numba code in an AWS lambda for instance -- llvmlite takes a lot of your 250mb package budget, but once the lambda is "warm" the jit lag isn't an issue. That said, if you absolutely want AOT you'll have to use Cython or some horrible hack dumping the compiled function binary.
- korijn 5y agoExactly!
- A-Train 5y agoYou realize that Scikit-learn is written mostly in Cython (where high performance is needed)? It is a part of the most influential ML library in existence.
- VHRanger 5y agoAlso pandas
- VHRanger 5y agoYou're aware pandas and most of scipy is cython, right? I like numba, but cython is clearly used more in the popular packages
- johndough 5y agoIn theory, a compiler toolchain is not required since Numba already comes with LLVM, i.e. for JIT compilation, no additional compiler is necessary. In the past, that was also possible for AOT compilation [1], but that technique broke during some update and it seems like there is no one left who knows how to fix this. [1] https://stackoverflow.com/a/42198101 https://stackoverflow.com/a/42198101
- woadwarrior01 5y agoJax also has experimental support for persisting its JIT cache on the filesystem in the ‘jax.experimental.compilation_cache’ module.
- VHRanger 5y agoHow does jax compare to numba?
- woadwarrior01 5y agonumba is more general. Any change to the shapes of arrays triggers a JIT recompilation in jax, numba is a bit more forgiving. jax has autodiff that numba doesn't. Also, JAX supports TPUs, which numba doesn't support (yet).