Skip to content

0.21.0

Latest

Choose a tag to compare

@antonwolfy antonwolfy released this 29 Oct 16:13
· 89 commits to master since this release
138dbb5

Overview

The highlight of this release: dpnp achieves 100% compliance with the Python array API specification (revision 2025.12).

This release introduces the dpnp.scipy.sparse namespace with a csr_matrix class and the cg, gmres and minres iterative solvers in dpnp.scipy.sparse.linalg.

This release adds support for Python 3.15 and for free-threaded Python builds.

This release is compatible with NumPy 2.5.4.

To align with NumPy 2.5 and the Python array API, dpnp.meshgrid, dpnp.broadcast_arrays, dpnp.atleast_1d, dpnp.atleast_2d, dpnp.atleast_3d and dpnp.ogrid now return a tuple instead of a list, and dpnp.row_stack and the support for 2-element vectors in dpnp.cross are removed.

This release requires DPC++ compiler 2026.1.1 or newer and dpctl 0.23.0 or newer.

Detailed Changes

Added

  • Added C API functions for dpnp.tensor.usm_ndarray setters and getters to avoid ABI breakage if dpnp.tensor.usm_ndarray is modified #2866
  • Added support for buffer protocol objects as advanced index keys in dpnp.ndarray #2889
  • Added --includes and --include-dir options to the dpnp CLI #2916
  • Added dpnp-config.cmake to make find_package(Dpnp) work out of the box, and an example which uses it #2941
  • Added implementation of dpnp.lib.stride_tricks.as_strided #2991
  • Added dpnp.tensor.broadcast_shapes to align with the 2025.12 version of the Python array API #3009
  • Added support for free-threaded Python builds #3026
  • Added the dpnp.scipy.sparse namespace with dpnp.scipy.sparse.csr_matrix and dpnp.scipy.sparse.issparse, and implementation of dpnp.scipy.sparse.linalg.LinearOperator, dpnp.scipy.sparse.linalg.aslinearoperator, dpnp.scipy.sparse.linalg.cg, dpnp.scipy.sparse.linalg.gmres and dpnp.scipy.sparse.linalg.minres #2841
  • Added dpnp.broadcast class implementation #2901
  • Added the ndmax keyword to dpnp.array for compatibility with NumPy #3044
  • Added UsmNDArray_RemoveQueueRef C API function to release a queue reference obtained from UsmNDArray_GetQueueRef #3042
  • Added a rattler-build-compatible conda recipe (conda-recipe/rattler_recipe.yaml) alongside the existing conda-build recipe #3031
  • Added support for the "nuc" (nuclear) norm in dpnp.linalg.cond #3084
  • Added support for Python 3.15 #3098

Changed

  • Changed dpnp.meshgrid and dpnp.tensor.meshgrid to return a tuple instead of a list, aligning with NumPy 2.5+ behavior and 2025.12 version of the Python array API standard #2854
  • Updated searchsorted implementations to align with the 2025.12 array API spec #2902
  • Updated tests to align with NumPy 2.4.5 compatibility #2920
  • Replaced .pxi includes in dpnp.tensor with modular .pxd/.pyx Cython imports #2913
  • Reimplemented dpnp.eye and dpnp.tensor.eye with a branchless kernel #2937
  • Cleaned up Python bindings for indexing functions, renaming usm_ndarray_take and usm_ndarray_put to py_take and py_put and refactoring validation #2935
  • Updated dpnp.linalg.eig and dpnp.linalg.eigvals documentation to reflect NumPy's always-complex eigenvalue output for general matrices #2953
  • Clarified support for negative axes in dpnp.transpose/dpnp.permute_dims documentation #2940
  • Allowed dpnp.take and dpnp.compress to cast the result into an out array of a different but same-kind dtype #2959
  • Clarified the summary in dpnp.reshape and dpnp.ndarray.reshape docstrings #2964
  • Changed dpnp.atleast_1d, dpnp.atleast_2d, dpnp.atleast_3d, and dpnp.ogrid to return a tuple of arrays instead of a list #2965
  • Improved performance of dpnp.fft functions for complex strided input by avoiding oversized allocations and extra copies #2939
  • Refreshed dpnp documentation styling with the Furo theme #2934
  • Switched the API reference rendering in the documentation from sphinx.ext.napoleon to numpydoc #3059
  • Updated Python Array API specification version supported to 2025.12 #2899
  • Replaced references to the dpnp.amax/dpnp.amin aliases with the canonical dpnp.max/dpnp.min in docstrings and code internally #2990
  • Aligned the signature of dpnp.tensor.expand_dims with the Python array API by making axis a required argument #2988
  • Removed dead code branches guarded by outdated oneMKL and DPC++ compiler version checks #2999
  • Replaced the deprecated nd_item::barrier() member calls in the accumulators and gemm kernels with the SYCL 2020 sycl::group_barrier() free function #3006
  • Changed dpnp.broadcast_arrays and dpnp.tensor.broadcast_arrays to return a tuple instead of a list, aligning with the 2025.12 Python array API spec #2944
  • Bumped the default minimum required DPC++ compiler version to 2026.1.1 and migrated to the OpenCL ICD loader from the conda-forge ocl-icd-system (Linux) and khronos-opencl-icd-loader (Windows) packages #2905
  • Bumped the minimum required dpctl version to 0.23.0 #2948
  • Linked the dpnp_backend_c library against only the MKL SYCL domains it uses (BLAS, RNG, VM) #3012
  • dpnp uses pybind11 3.1.0 #3015
  • Reworked the ASV benchmarks and added end-to-end workload benchmarks derived from dpBench #2996
  • Stopped timing NumPy in the ASV benchmarks, which now measure only dpnp #3095
  • Reduced allocations in dpnp.linalg.norm by reusing the reduction result as the sqrt output buffer in the 2-norm and Frobenius-norm branches #3062
  • Changed dpnp.tensor.top_k with mode="largest" to no longer return NaN values (or complex values with a NaN component) ahead of finite values, matching the NaN-last order of dpnp.tensor.sort #3066
  • Avoided a copy of dpnp.einsum result into C-order by building the product in the requested layout directly #3069
  • Updated the implementation of dpnp.putmask by adding dedicated contiguous and strided SYCL kernels #3014
  • Changed dpnp.sort, dpnp.argsort, and their dpnp.ndarray/dpnp.tensor counterparts to place NaN values last instead of first when sorting in descending order #3066
  • Documented and made explicit support for copy=None ("copy only if needed") in dpnp.nan_to_num #3083
  • Changed dpnp.linalg.pinv to compute the default tolerance from the machine epsilon of the data type used for the computation, and to return a floating-point result for an empty integer or boolean array #3090
  • Avoided a full-size copy of a broadcast input in dpnp.nansum, dpnp.nanprod, dpnp.nancumsum and dpnp.nancumprod by replacing NaN values only in the distinct elements of the input #3108

Deprecated

  • Deprecated setting the shape via the shape attribute of dpnp.ndarray and dpnp.tensor.usm_ndarray. Use dpnp.reshape/dpnp.tensor.reshape (or the reshape method) instead #2967
  • Deprecated dpnp.config.__DPNP_QUEUE_GPU__, dpnp.config.__DPNP_OUTPUT_NUMPY__ and dpnp.config.__DPNP_OUTPUT_DPCTL_DEFAULT_SHARED__, which have no effect; reading or setting them now emits a DeprecationWarning #3107

Removed

  • Removed support for arrays of 2-element vectors in dpnp.cross, which now requires (arrays of) 3-element vectors and raises ValueError otherwise #2950
  • Removed dpnp.row_stack in favor of dpnp.vstack #2957
  • Removed all references to the unimplemented dpnp.ndarray.resize method from the documentation #2989
  • Removed an obsolete oneAPI 2021.x workaround from the Windows conda build script that manually prepended BUILD_PREFIX paths onto the LIB and INCLUDE #3013

Fixed

  • Fixed a crash at process exit on Windows when dpnp is built with oneMKL 2026.0, caused by the destructor of the oneMKL mt19937 random number engine running while the library is being unloaded #2871
  • Fixed incorrect in-place advanced indexing for 4D arrays when using range or list as index keys #2872
  • Fixed conda build command syntax in GitHub workflows and documentation to use conda-build #2888
  • Fixed incorrect dpnp.tensor.acosh result for complex(±0, NaN) special case to match the Python Array API specification #2914
  • Fixed fork PR documentation workflow failures by implementing conditional publishing strategy: upstream PRs publish to GitHub Pages with comment, fork PRs upload artifacts #2910
  • Fixed missing libtensor headers in the installed dpnp package #2915
  • Fixed boolean mask indexing to raise IndexError when mask dimensions don't match the indexed array dimensions, aligning with NumPy behavior. Previously, incompatible boolean masks silently returned incorrect results instead of raising an error #2929
  • Fixed a bug in astype where casting floating point types to unsigned integral types could cause an intermediate signed integral type to overflow, leading to incorrect results #2930
  • Fixed incorrect dpnp.tensor.expm1 result for complex(±0, 0) special case on CPU to match the Python Array API specification #2926
  • Fixed tests which expected lists from dpctl functions which now return tuples (i.e., dpctl.SyclDevice.create_sub_devices) #2945
  • Fixed PytestRemovedIn10Warning raised by pytest 9.1.0 by converting class-scoped fixtures to class methods #2952
  • Fixed dpnp.linalg.svd(..., hermitian=True) returning a non-unitary vh for singular input arrays due to a zero sign appearing #2954
  • Fixed scalar conversion of size-one dpnp.tensor.usm_ndarray (e.g. int(), float(), indexing) which failed with NumPy 2.5 after the in-place ndarray.shape assignment was deprecated #2958
  • Fixed dpnp.mgrid and dpnp.ogrid to return consistent results between single-slice and tuple-of-slices syntax when the step is a complex number with a non-integer magnitude (e.g. 2.5j) #2971
  • Fixed icx/icpx warning during conda build by stripping the GCC-only -fno-merge-constants flag injected by conda-forge into CFLAGS/CXXFLAGS #2978
  • Fixed dpnp.asnumpy and dpnp.ndarray.asnumpy ignoring the order keyword, which caused a non-contiguous source array to be returned with a non-contiguous layout even when order="C" was requested #2980
  • Fixed a flood of deprecation warnings from the DPC++/SYCL headers when building dpnp.tensor on Windows #2993
  • Fixed dpnp.tensor.acosh and dpnp.tensor.acos returning infinity for complex numbers with large negative real parts #2928
  • Fixed __array_namespace_info__().devices() and .default_device() to return Python array API compatible device objects #2979
  • Fixed dpnp.interp with an empty input array x to return an empty array with the correct dtype #2985
  • Fixed dpnp.interp returning nan when querying at an exact knot point whose adjacent fp value is inf #2986
  • Fixed missing strides validation in dpnp.tensor.usm_ndarray constructor when allocating new memory #2927
  • Fixed dpnp.bincount raising a ValueError on an empty input array instead of returning an empty intp array #3018
  • Fixed dpnp.tensor.top_k aborting for k=0 by returning empty result arrays without launching a zero-sized kernel #3022
  • Fixed comparison functions (dpnp.equal, dpnp.not_equal, dpnp.less, dpnp.less_equal, dpnp.greater, dpnp.greater_equal) and dpnp.divide raising OverflowError when comparing an integer array against a Python integer scalar outside the array dtype's range #3017
  • Fixed a crash in boolean-mask advanced indexing (dpnp.ndarray get/set item) when the selection is empty (e.g. a scalar False index that injects a length-0 axis) #3019
  • Released the GIL before the remaining blocking OneMKL BLAS and LAPACK calls to prevent host tasks contention, completing the work started in #2850 #3027
  • Fixed dpnp.repeat raising an unclear TypeError for a nested sequence of repeats #3024
  • Fixed dpnp.ndarray.view ignoring the USM element offset of a sliced array, which also caused dpnp.einsum to silently return wrong results for a single sliced operand with no summed index #3037
  • Fixed dpnp.all and dpnp.any aborting when reducing over an empty axis (e.g. an array with a zero-length dimension) #3021
  • Released the GIL before the blocking OneMKL DFT calls in the FFT extension #3040
  • Fixed astype casting an out-of-range floating point value to a signed narrow integer type saturating to the destination min/max instead of wrapping like NumPy, generalizing the earlier unsigned-only fix #3033
  • Fixed dpnp.insert silently ignoring out-of-bounds negative indices in a multi-element obj, so a mix of in-bounds and out-of-bounds indices now consistently raises IndexError #3041
  • Fixed a per-call sycl::queue leak in usm_ndarray::get_queue()/get_device() #3042
  • Fixed dpnp.linspace returning nan for equal infinite endpoints #3043
  • Fixed dpnp.cumsum, dpnp.cumprod, and their nan/cumulative_* variants (including dpnp.tensor.cumulative_sum/cumulative_prod) silently returning incorrect results when accumulating along an axis of an array with more than one row #3063
  • Fixed dpnp.einsum returning a result whose memory layout differs from NumPy for the default order="K", and ignoring out and order for a contraction over a size-0 dimension #3058
  • Fixed operations on a boolean array whose bytes are not 0x00/0x01 #3055
  • Fixed the dpnp.ndarray constructor returning a view at the wrong address #3068
  • Fixed the strided kernel of dpnp.full and dpnp.tensor.full not waiting on the events passed to the binding #3072
  • Fixed the list of events the copy kernels of dpnp.reshape, dpnp.tensor.reshape, dpnp.roll and dpnp.tensor.roll wait on being padded with default-constructed events #3072
  • Fixed simplify_iteration_three_strides and simplify_iteration_four_strides accumulating into their third and fourth output displacements without zeroing them first, which required the caller to initialize them #3072
  • Fixed dpnp.ndarray.flat indexing and assignment edge cases, adding support for slices, ellipsis, and integer/boolean array indices #3045
  • Fixed dpnp.nanmedian dropping kept dimensions of size 1, which produced a wrong result shape #3081
  • Fixed incorrect results of dpnp.tensor.vecdot in some cases with strided outputs and of dpnp.tensor reductions, dpnp.tensor.vecdot and dpnp.tensor.matmul on large inputs with some data types #3082
  • Fixed dpnp.median and dpnp.nanmedian raising a ValueError for a tuple axis when a kept dimension has size 0 #3081
  • Fixed a RuntimeError raised by dpnp.tensor kernels launched over more than INT_MAX work-items when built with DPC++ compiler 2026.2 or newer, by also passing -fno-sycl-id-queries-fit-in-int to the linker #3089
  • Fixed dpnp.__all__ missing ndarray and __array_namespace_info__ and listing mean, median and min twice #3100
  • Fixed dpnp.repeat and dpnp.tensor.repeat silently returning wrong results for uint64 repeats above the int64 maximum #3115
  • Fixed importing dpnp.scipy.sparse re-enabling the GIL on free-threaded Python builds, because its pybind11 extension did not declare free-threading support #3101
  • Fixed the CuPy-based dpnp.scipy tests under dpnp/tests/third_party/cupyx/scipy_tests/ missing from the dpnp package, so they never ran against an installed package #3102
  • Fixed a RuntimeError raised by kernels of the blas, statistics, ufunc and window extensions and of the legacy backend launched over more than INT_MAX work-items when built with DPC++ compiler 2026.2 or newer #3104
  • Fixed the Linux conda build producing a wheel with an invalid manylinux___x86_64 platform tag when the conda CLI is not on PATH #3126

Contributors


Full Changelog: 0.20.0...0.21.0