Introduction to Numba

Numba provides the ability to speed up applications with high performance functions written directly in Python, rather than using language extensions such as Cython.

Numba allows the compilation of selected portions of pure Python code to native code, and generates optimized machine code using the LLVM compiler infrastructure.

With a few simple annotations, array-oriented and math-heavy Python code can be just-in-time (JIT) optimized to achieve performance similar to C, C++ and Fortran, without having to switch languages or Python interpreters.

Numba works at the function level. From a function, Numba can generate native code for that function as well as the wrapper code needed to call it directly from Python. This compilation is done on-the-fly and in-memory.

Numba’s main features are:


The examples in this lesson can be run directly using the Python interpreter, using IPython interactively, or using Jupyter notebooks. Anaconda users will already have Numba installed. See Setup for information on installing Numba.


00:00 Just-in-time Compiling How does Numba just-in-time compiling work?
00:20 Function Signatures Is it possible to use function type information to improve performance with Numba?
00:40 Compilation Modes Is it possible to ensure Numba will generate high performance code?
01:00 Numba Functions Are there restrictions on calling Numba functions?
Can Numba be used to simplify the creation of ufuncs?
01:20 CUDA Programming How does CUDA programming with Numba work?
What CUDA features are available in Numba?
02:30 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.