Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between jit and autojit in numba?

Tags:

python

numba

I'm confused as to what the difference is between jit and autojit.

I've read this:

http://numba.pydata.org/numba-doc/0.6/doc/userguide.html

But can't say I know feel confident in choosing between the two options. Could someone elaborate, ideally with an example.

Thank you

like image 209
evan54 Avatar asked Dec 11 '14 22:12

evan54


People also ask

What does Numba JIT do?

Numba is an open source JIT compiler that translates a subset of Python and NumPy code into fast machine code.

Should I use Cython or Numba?

Both Cython and Numba speeds up Python code even small number of operations. More the number of operations more is the speed up. However, performance gain by Cython saturates at around 100-150 times of Python. On the other hand, speed up gain by Numba increases steadily with number of operations.

Does Numba support Scipy?

However numba and scipy are still not compatible. Yes, Scipy calls compiled C and Fortran, but it does so in a way that numba can't deal with.


Video Answer


1 Answers

I should've read this which is for the newer version of numba.

http://numba.pydata.org/numba-doc/0.15.1/tutorial_firststeps.html#compiling-a-function-with-numba-jit-using-an-explicit-function-signature

2) jit(function) -> dispatcher

Same as old autojit.  Create a dispatcher function object that
specialize at call site.

Example:

    @jit
    def foo(x, y):
        return x + y

http://numba.pydata.org/numba-doc/0.15.1/tutorial_firststeps.html#compiling-a-function-without-providing-a-function-signature-autojit-functionality

Starting with numba version 0.12, it is possible to use numba.jit without providing a type-signature for the function. This functionality was provided by numba.autojit in previous versions of numba. The old numba.autojit hass been deprecated in favour of this signature-less version of numba.jit.

like image 107
evan54 Avatar answered Oct 12 '22 09:10

evan54