Release Notes

Version 0.16.0

This release contains a major refactor to switch from llvmpy to llvmlite as our code generation backend. The switch is necessary to reconcile different compiler requirements for LLVM 3.5 (needs C++11) and Python extensions (need specific compiler versions on Windows). As a bonus, we have found the use of llvmlite speeds up compilation by a factor of 2!

Other Major Changes:

  • Faster dispatch for numpy structured arrays
  • Optimized array.flat()
  • Improved CPU feature selection
  • Fix constant tuple regression in macro expansion code

Known Issues:

  • AVX code generation is still disabled by default due to performance regressions when operating on misaligned NumPy arrays. We hope to have a workaround in the future.
  • In extremely rare circumstances, a known issue with LLVM 3.5 code generation can cause an ELF relocation error on 64-bit Linux systems.

Version 0.15.1

(This was a bug-fix release that superceded version 0.15 before it was announced.)

Fixes:

  • Workaround for missing __ftol2 on Windows XP.
  • Do not lift loops for compilation that contain break statements.
  • Fix a bug in loop-lifting when multiple values need to be returned to the enclosing scope.
  • Handle the loop-lifting case where an accumulator needs to be updated when the loop count is zero.

Version 0.15

Features:

  • Support for the Python cmath module. (NumPy complex functions were already supported.)
  • Support for .real, .imag, and .conjugate()` on non-complex numbers.
  • Add support for math.isfinite() and math.copysign().
  • Compatibility mode: If enabled (off by default), a failure to compile in object mode will fall back to using the pure Python implementation of the function.
  • Experimental support for serializing JIT functions with cloudpickle.
  • Loop-jitting in object mode now works with loops that modify scalars that are accessed after the loop, such as accumulators.
  • @vectorize functions can be compiled in object mode.
  • Numba can now be built using the Visual C++ Compiler for Python 2.7 on Windows platforms.
  • CUDA JIT functions can be returned by factory functions with variables in the closure frozen as constants.
  • Support for “optional” types in nopython mode, which allow None to be a valid value.

Fixes:

  • If nopython mode compilation fails for any reason, automatically fall back to object mode (unless nopython=True is passed to @jit) rather than raise an exeception.
  • Allow function objects to be returned from a function compiled in object mode.
  • Fix a linking problem that caused slower platform math functions (such as exp()) to be used on Windows, leading to performance regressions against NumPy.
  • min() and max() no longer accept scalars arguments in nopython mode.
  • Fix handling of ambigous type promotion among several compiled versions of a JIT function. The dispatcher will now compile a new version to resolve the problem. (issue #776)
  • Fix float32 to uint64 casting bug on 32-bit Linux.
  • Fix type inference to allow forced casting of return types.
  • Allow the shape of a 1D cuda.shared.array and cuda.local.array to be a one-element tuple.
  • More correct handling of signed zeros.
  • Add custom implementation of atan2() on Windows to handle special cases properly.
  • Eliminated race condition in the handling of the pagelocked staging area used when transferring CUDA arrays.
  • Fix non-deterministic type unification leading to varying performance. (issue #797)

Version 0.14

Features:

  • Support for nearly all the Numpy math functions (including comparison, logical, bitwise and some previously missing float functions) in nopython mode.
  • The Numpy datetime64 and timedelta64 dtypes are supported in nopython mode with Numpy 1.7 and later.
  • Support for Numpy math functions on complex numbers in nopython mode.
  • ndarray.sum() is supported in nopython mode.
  • Better error messages when unsupported types are used in Numpy math functions.
  • Set NUMBA_WARNINGS=1 in the environment to see which functions are compiled in object mode vs. nopython mode.
  • Add support for the two-argument pow() builtin function in nopython mode.
  • New developer documentation describing how Numba works, and how to add new types.
  • Support for Numpy record arrays on the GPU. (Note: Improper alignment of dtype fields will cause an exception to be raised.)
  • Slices on GPU device arrays.
  • GPU objects can be used as Python context managers to select the active device in a block.
  • GPU device arrays can be bound to a CUDA stream. All subsequent operations (such as memory copies) will be queued on that stream instead of the default. This can prevent unnecessary synchronization with other streams.

Fixes:

  • Generation of AVX instructions has been disabled to avoid performance bugs when calling external math functions that may use SSE instructions, especially on OS X.
  • JIT functions can be removed by the garbage collector when they are no longer accessible.
  • Various other reference counting fixes to prevent memory leaks.
  • Fixed handling of exception when input argument is out of range.
  • Prevent autojit functions from making unsafe numeric conversions when called with different numeric types.
  • Fix a compilation error when an unhashable global value is accessed.
  • Gracefully handle failure to enable faulthandler in the IPython Notebook.
  • Fix a bug that caused loop lifting to fail if the loop was inside an else block.
  • Fixed a problem with selecting CUDA devices in multithreaded programs on Linux.
  • The pow() function (and ** operation) applied to two integers now returns an integer rather than a float.
  • Numpy arrays using the object dtype no longer cause an exception in the autojit.
  • Attempts to write to a global array will cause compilation to fall back to object mode, rather than attempt and fail at nopython mode.
  • range() works with all negative arguments (ex: range(-10, -12, -1))

Version 0.13.4

Features:

  • Setting and deleting attributes in object mode
  • Added documentation of supported and currently unsupported numpy ufuncs
  • Assignment to 1-D numpy array slices
  • Closure variables and functions can be used in object mode
  • All numeric global values in modules can be used as constants in JIT compiled code
  • Support for the start argument in enumerate()
  • Inplace arithmetic operations (+=, -=, etc.)
  • Direct iteration over a 1D numpy array (e.g. “for x in array: ...”) in nopython mode

Fixes:

  • Support for NVIDIA compute capability 5.0 devices (such as the GTX 750)
  • Vectorize no longer crashes/gives an error when bool_ is used as return type
  • Return the correct dictionary when globals() is used in JIT functions
  • Fix crash bug when creating dictionary literals in object
  • Report more informative error message on import if llvmpy is too old
  • Temporarily disable pycc –header, which generates incorrect function signatures.

Version 0.13.3

Features:

  • Support for enumerate() and zip() in nopython mode
  • Increased LLVM optimization of JIT functions to -O1, enabling automatic vectorization of compiled code in some cases
  • Iteration over tuples and unpacking of tuples in nopython mode
  • Support for dict and set (Python >= 2.7) literals in object mode

Fixes:

  • JIT functions have the same __name__ and __doc__ as the original function.
  • Numerous improvements to better match the data types and behavior of Python math functions in JIT compiled code on different platforms.
  • Importing Numba will no longer throw an exception if the CUDA driver is present, but cannot be initialized.
  • guvectorize now properly supports functions with scalar arguments.
  • CUDA driver is lazily initialized

Version 0.13.2

Features:

  • @vectorize ufunc now can generate SIMD fast path for unit strided array
  • Added cuda.gridsize
  • Added preliminary exception handling (raise exception class)

Fixes:

  • UNARY_POSITIVE
  • Handling of closures and dynamically generated functions
  • Global None value

Version 0.13.1

Features:

  • Initial support for CUDA array slicing

Fixes:

  • Indirectly fixes numbapro when the system has a incompatible CUDA driver
  • Fix numba.cuda.detect
  • Export numba.intp and numba.intc

Version 0.13

Features:

  • Opensourcing NumbaPro CUDA python support in numba.cuda
  • Add support for ufunc array broadcasting
  • Add support for mixed input types for ufuncs
  • Add support for returning tuple from jitted function

Fixes:

  • Fix store slice bytecode handling for Python2
  • Fix inplace subtract
  • Fix pycc so that correct header is emitted
  • Allow vectorize to work on functions with jit decorator

Version 0.12.2

Fixes:

  • Improved NumPy ufunc support in nopython mode
  • Misc bug fixes

Version 0.12.1

This version fixed many regressions reported by user for the 0.12 release. This release contains a new loop-lifting mechanism that specializes certains loop patterns for nopython mode compilation. This avoid direct support for heap-allocating and other very dynamic operations.

Improvements:

  • Add loop-lifting–jit-ing loops in nopython for object mode code. This allows functions to allocate NumPy arrays and use Python objects, while the tight loops in the function can still be compiled in nopython mode. Any arrays that the tight loop uses should be created before the loop is entered.

Fixes:

  • Add support for majority of “math” module functions
  • Fix for...else handling
  • Add support for builtin round()
  • Fix tenary if...else support
  • Revive “numba” script
  • Fix problems with some boolean expressions
  • Add support for more NumPy ufuncs

Version 0.12

Version 0.12 contains a big refactor of the compiler. The main objective for this refactor was to simplify the code base to create a better foundation for further work. A secondary objective was to improve the worst case performance to ensure that compiled functions in object mode never run slower than pure Python code (this was a problem in several cases with the old code base). This refactor is still a work in progress and further testing is needed.

Main improvements:

  • Major refactor of compiler for performance and maintenance reasons
  • Better fallback to object mode when native mode fails
  • Improved worst case performance in object mode

The public interface of numba has been slightly changed. The idea is to make it cleaner and more rational:

  • jit decorator has been modified, so that it can be called without a signature. When called without a signature, it behaves as the old autojit. Autojit has been deprecated in favour of this approach.
  • Jitted functions can now be overloaded.
  • Added a “njit” decorator that behaves like “jit” decorator with nopython=True.
  • The numba.vectorize namespace is gone. The vectorize decorator will be in the main numba namespace.
  • Added a guvectorize decorator in the main numba namespace. It is similiar to numba.vectorize, but takes a dimension signature. It generates gufuncs. This is a replacement for the GUVectorize gufunc factory which has been deprecated.

Main regressions (will be fixed in a future release):

  • Creating new NumPy arrays is not supported in nopython mode
  • Returning NumPy arrays is not supported in nopython mode
  • NumPy array slicing is not supported in nopython mode
  • lists and tuples are not supported in nopython mode
  • string, datetime, cdecimal, and struct types are not implemented yet
  • Extension types (classes) are not supported in nopython mode
  • Closures are not supported
  • Raise keyword is not supported
  • Recursion is not support in nopython mode

Version 0.11

  • Experimental support for NumPy datetime type

Version 0.10

  • Annotation tool (./bin/numba –annotate –fancy) (thanks to Jay Bourque)
  • Open sourced prange
  • Support for raise statement
  • Pluggable array representation
  • Support for enumerate and zip (thanks to Eugene Toder)
  • Better string formatting support (thanks to Eugene Toder)
  • Builtins min(), max() and bool() (thanks to Eugene Toder)
  • Fix some code reloading issues (thanks to Björn Linse)
  • Recognize NumPy scalar objects (thanks to Björn Linse)

Version 0.9

  • Improved math support
  • Open sourced generalized ufuncs
  • Improved array expressions

Version 0.8

  • Support for autojit classes
    • Inheritance not yet supported
  • Python 3 support for pycc

  • Allow retrieval of ctypes function wrapper
    • And hence support retrieval of a pointer to the function
  • Fixed a memory leak of array slicing views

Version 0.7.2

Version 0.7.1

  • Various bug fixes

Version 0.7

  • Open sourced single-threaded ufunc vectorizer

  • Open sourced NumPy array expression compilation

  • Open sourced fast NumPy array slicing

  • Experimental Python 3 support

  • Support for typed containers
    • typed lists and tuples
  • Support for iteration over objects

  • Support object comparisons

  • Preliminary CFFI support
    • Jit calls to CFFI functions (passed into autojit functions)
    • TODO: Recognize ffi_lib.my_func attributes
  • Improved support for ctypes

  • Allow declaring extension attribute types as through class attributes

  • Support for type casting in Python
    • Get the same semantics with or without numba compilation
  • Support for recursion
    • For jit methods and extension classes
  • Allow jit functions as C callbacks

  • Friendlier error reporting

  • Internal improvements

  • A variety of bug fixes

Version 0.6.1

  • Support for bitwise operations

Version 0.6

  • Python 2.6 support

  • Programmable typing
    • Allow users to add type inference for external code
  • Better NumPy type inference
    • outer, inner, dot, vdot, tensordot, nonzero, where, binary ufuncs + methods (reduce, accumulate, reduceat, outer)
  • Type based alias analysis
    • Support for strict aliasing
  • Much faster autojit dispatch when calling from Python

  • Faster numerical loops through data and stride pre-loading

  • Integral overflow and underflow checking for conversions from objects

  • Make Meta dependency optional

Version 0.5

  • SSA-based type inference
    • Allows variable reuse
    • Allow referring to variables before lexical definition
  • Support multiple comparisons

  • Support for template types

  • List comprehensions

  • Support for pointers

  • Many bug fixes

  • Added user documentation

Version 0.4

Version 0.3.2

  • Add support for object arithmetic (issue 56).
  • Bug fixes (issue 55).

Version 0.3

  • Changed default compilation approach to ast
  • Added support for cross-module linking
  • Added support for closures (can jit inner functions and return them) (see examples/closure.py)
  • Added support for dtype structures (can access elements of structure with attribute access) (see examples/structures.py)
  • Added support for extension types (numba classes) (see examples/numbaclasses.py)
  • Added support for general Python code (use nopython to raise an error if Python C-API is used to avoid unexpected slowness because of lack of implementation defaulting to generic Python)
  • Fixed many bugs
  • Added support to detect math operations.
  • Added with python and with nopython contexts
  • Added more examples

Many features need to be documented still. Look at examples and tests for more information.

Version 0.2

  • Added an ast approach to compilation
  • Removed d, f, i, b from numba namespace (use f8, f4, i4, b1)
  • Changed function to autojit2
  • Added autojit function to decorate calls to the function and use types of the variable to create compiled versions.
  • changed keyword arguments to jit and autojit functions to restype and argtypes to be consistent with ctypes module.
  • Added pycc – a python to shared library compiler