Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arbitrary precision arithmetic in JIT compiled functions

When I use numba inside python I know that if I try to jit-compile functions which have arbitrary precision floats (mpmath) inside their loops, it will fail to compile in nopython mode and its speed will be same as plain python version. My question is about Julia package DifferentialEquations.jl. On their main page they say that it supports BigFloats and ArbFloats. I understand that this package also uses loops which are jit-compiled by default by julia. So my question is whether or not DifferentialEquations.jl functions are jit-compiled when I pass differential equations which use BigFloat numbers.

like image 689
Giorgi Bakhtadze Avatar asked Oct 16 '25 04:10

Giorgi Bakhtadze


1 Answers

Yes, they are via function auto-specialization. In Julia, functions will auto-specialize on the concrete types when JIT compiling. This is true for all numbers, and in fact even things like Float64 are just types defined in Julia itself and use these same mechanisms. This blog post describes this pattern in more detail

like image 73
Chris Rackauckas Avatar answered Oct 18 '25 18:10

Chris Rackauckas