Version 0.67.0 (TBD)¶
This is a major Numba release. Numba now adds support for NumPy 2.5.
This release also ships Python 3.14 conda packages and wheels for
Windows ARM64. It also adds JIT-compilation support for np.insert
and a dynamic axis argument for the np.sum and np.cumsum
reduction functions.
Please find a summary of all noteworthy items below.
Highlights¶
Support for NumPy 2.5¶
Numba now supports NumPy 2.5, with the following notable changes:
np.linalg.eigandnp.linalg.eigvalsnow return complex eigenvalues/eigenvectors for real input, matching NumPy 2.5. Previously, real input produced real results and raised an error if the eigenvalues turned out to be complex.np.signontimedelta64values now returnsfloat64(withNaTmapping tonan), matching NumPy 2.5.np.row_stackhas been removed in NumPy 2.5. Usenp.vstackinstead.The two-dimensional cross product has been removed in NumPy 2.5, so the
numba.np.extensions.cross2dhelper is only available with NumPy < 2.5.
Improvements¶
np.sum now supports dynamic axis argument.¶
The np.sum function now supports a dynamic axis argument,
allowing users to specify the axis along which to perform the
operation at runtime. The limitation of only supporting a static
axis up to axis=3 has also been removed.
np.cumsum now supports dynamic axis argument.¶
The np.cumsum function now supports a dynamic axis argument,
allowing users to specify the axis along which to perform the
operation at runtime.
Speed up legacy binomial sampling and align BTPE with NumPy 2.5¶
np.random.binomial (RandomState) now uses NumPy’s BTPE algorithm for large
means (n * min(p, 1 - p) > 30) instead of BINV, substantially speeding up
sampling for large n or mid-range probabilities while preserving the
RandomState stream. The BTPE rejection squeeze shared by the RandomState and
Generator paths is also corrected: Generator.binomial now tracks NumPy
2.5’s fixed squeeze (https://github.com/numpy/numpy/pull/31238) when running
against numpy >= 2.5, matching NumPy’s output, and is left unchanged under
older NumPy. The legacy np.random.binomial stream is unchanged.
NumPy Support¶
Added ddof argument to np.nanvar and np.nanstd¶
The ddof (Delta Degrees of Freedom) argument is now supported in
np.nanvar and np.nanstd in nopython mode, matching NumPy behaviour.
Default ddof=0 preserves backward compatibility.
Added support for np.insert¶
numpy.insert is now supported in nopython mode. The arr, obj and
values arguments are supported, where obj may be an integer or a
sequence/array of integers. As with numpy.delete, the insertion is
performed on the flattened input array (the axis argument is not yet
supported).
Performance Improvements and Changes¶
Use topological iteration order in liveness fix-point analysis¶
Previously, compute_live_map and compute_live_variables iterated over
basic blocks in dict-insertion order during their fix-point loops, which could
require a number of iterations proportional to the loop-nesting depth (or to how
far block order had drifted from topological order after inlining/merging) to
converge. Both fix-points now iterate in topological order (and reverse
topological order for the backward liveness pass), which converges in a small
constant number of iterations regardless of graph size. This is a
behavior-preserving change that reduces compilation time, most noticeably on
large generated or unrolled functions with many basic blocks.
Bug Fixes¶
Fix omp_set_nested deprecation warning in the OpenMP threading layer¶
Numba’s OpenMP threading layer called the deprecated omp_set_nested
routine when initializing its thread pool. On OpenMP 5.0+ runtimes (for
example the Intel/LLVM libomp shipped with MKL), this caused the message
OMP: Info #273: omp_set_nested routine deprecated, please use
omp_set_max_active_levels instead. to be emitted when running a parallel
function with NUMBA_THREADING_LAYER=omp. The threading layer now probes
for omp_set_max_active_levels in the loaded OpenMP runtime and uses it
when present, falling back to omp_set_nested only when the newer routine
is unavailable (#5275).
Make pycc AOT-compiled extensions reproducible¶
Extension modules produced by numba.pycc are now byte-for-byte
identical across independent builds of the same source on Linux and MacOS.
Previously, several mangled LLVM symbol names and global names
embedded process-specific values (id(obj), the default object.__repr__
of CPUContext), so two builds of the same module produced AOT binaries with
different MD5 hashes.
Fix silent miscompile when reassigning a nonlocal in an inner function¶
Assigning a nonlocal variable more than once inside an inner function
dropped every write after the first without error. Numba now raises an
UnsupportedError at compile time instead of miscompiling.
Sort numba.cext C sources for reproducible AOT builds¶
numba.pycc collected its C mixin sources via os.listdir, whose
order is filesystem-defined and varies across hosts. This made the source
(and hence symbol) order of AOT-compiled binaries non-deterministic across
build machines. The sources are now sorted so independent builds produce
byte-for-byte identical binaries.
Make pycc AOT-compiled extensions reproducible on macOS with debug builds¶
Extension modules produced by numba.pycc on macOS are now byte-for-byte
identical across independent builds even when the interpreter’s sysconfig
compiles extensions with debug information (-g). Previously, the macOS
linker embedded an N_OSO debug-map entry per object file holding the
object’s absolute path inside a randomly-named temporary build directory
(and its modification time), so two builds of the same module produced AOT
binaries with different hashes. The macOS link step now passes -Wl,-S to
strip the debug map while preserving the symbols required at runtime.
Fix a miscompile in pointer_add¶
pointer_add built the offset pointer through a ptrtoint/inttoptr
round-trip, producing a pointer with no provenance that LLVM could miscompile
once inlined, returning invalid results or raising spurious exceptions.
It now uses a byte-wise getelementptr instead, which preserves provenance.
Fixed spurious errors during element access on non-contiguous ('A' layout) arrays.
Fix loss of @intrinsic lowering across compilation targets¶
An intrinsic typed on a second target (for example CUDA after the CPU)
replaced the shared implementation cache entry with a closure whose lowering
was registered only on that target, so a later compilation on the first
target failed with NotImplementedError: No definition for lowering. The
implementation cache is now keyed by the typing context as well as the
argument types.
Fix Dynamic Raise Exception Message Handling¶
Raising a dynamic exception with a literal message stored in a variable could cause the compiled code to display a different literal value. Numba now handles dynamic exception message variables self-consistently, and prevents message collisions between variables with the same underlying storage representation.
Documentation Changes¶
Add Windows on ARM64 to support policy Tier 1.5¶
The Support Tiers documentation now lists win-arm64
(Windows on 64-bit ARM) as a Tier 1.5 release configuration. Wheel and conda
packages are initially provided for Python 3.14 only; support for additional
Python versions may be added in the future.
Add AI tool use policy.¶
The Numba org now has an AI tool use policy: https://numba.readthedocs.io/en/stable/reference/ai_tools_policy.html