Using Numba Effectively Today
summary
Numba is a JIT compiler for NumPy that compiles functions on first use so the initial call is slower but subsequent calls run much faster; use @jit or the engine/nopython (njit) option to force nopython vs object mode and check compilation messages. Elementwise Python loops can see ~10x speedup on tight loops, making them competitive with vectorized NumPy (examples show vanilla vector ~461ms, compiled ~248ms, compiled parallel ~95ms). Fastmath gives small extra gains; GPU/CUDA support exists.
AI-written summary · about
chapters (14)
- 0:00Numba and JIT compilation
- 3:36Python vs compiled languages
- 6:24Numba for NumPy and speed
- 8:09Object vs NumPy mode
- 10:34Numba performance limits
- 11:59Numba with GPUs
- 13:22Hands-on exercises
- 17:04First Jupyter notebook
- 19:10Basic Numba timing
- 23:45Vectorized vs element-wise
- 27:22Speeding up loops
- 31:15Fast Math mode
- 34:12Parallel execution
- 36:45Next steps
related talks
30mNumba, a JIT compiler for fast numerical code
01h 33mPower up your work with compiling and profiling
22mSupercharge Scientific Computing in Python with Numba
37mAccelerating Scientific Computing in Python with Numba: A Real-World Example
01h 27mMaking computation easier with cool Numpy tricks
42mMaking your code faster: Cython and parallel processing in the Jupyter Notebook
01h 31mMaking Computation Easier with Cool Numpy Tricks
34mNumPy: vectorize your brain
