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
- 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.
(This was a bug-fix release that superceded version 0.15 before it was announced.)
- 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.
- 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.
- 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)
- 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.
- 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))
- 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
- 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.
- 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
- 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
- @vectorize ufunc now can generate SIMD fast path for unit strided array
- Added cuda.gridsize
- Added preliminary exception handling (raise exception class)
- Handling of closures and dynamically generated functions
- Global None value
- Initial support for CUDA array slicing
- Indirectly fixes numbapro when the system has a incompatible CUDA driver
- Fix numba.cuda.detect
- Export numba.intp and numba.intc
- 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
- 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
- Improved NumPy ufunc support in nopython mode
- Misc bug fixes
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.
- 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.
- 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 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.
- 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
- Experimental support for NumPy datetime type
- 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)
- Improved math support
- Open sourced generalized ufuncs
- Improved array expressions
- 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
- Official Python 3 support (python 3.2 and 3.3)
- Support for intrinsics and instructions
- Various bug fixes (see https://github.com/numba/numba/issues?milestone=7&state=closed)
- Various bug fixes
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
A variety of bug fixes
- Support for bitwise operations
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
- SSA-based type inference
- Allows variable reuse
- Allow referring to variables before lexical definition
Support multiple comparisons
Support for template types
Support for pointers
Many bug fixes
Added user documentation
- Add support for object arithmetic (issue 56).
- Bug fixes (issue 55).
- 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.
- 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