Skip to content

Commit 7a8b0b8

Browse files
authored
Merge branch 'master' into use-windows-latest
2 parents 0f5825f + 27051e5 commit 7a8b0b8

24 files changed

+435
-2616
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ exclude =
5454
.git,
5555
benchmarks/*.py,
5656
build,
57+
dpnp/_version.py,
5758
dpnp/to_numba/*.py,
5859
conda.recipe,
5960
dpnp/tests/*.py,
6061
tests_external/*.py,
61-
versioneer.py,
6262

6363
# Print detailed statistic if any issue detected
6464
count = True

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dpnp/_version.py export-subst

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
persist-credentials: false
3939

4040
- name: "Run analysis"
41-
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
41+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
4242
with:
4343
results_file: results.sarif
4444
results_format: sarif

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ repos:
5454
rev: 25.1.0
5555
hooks:
5656
- id: black
57+
exclude: "dpnp/_version.py"
5758
- repo: https://github.com/pycqa/isort
5859
rev: 6.0.1
5960
hooks:
6061
- id: isort
6162
name: isort (python)
63+
exclude: "dpnp/_version.py"
6264
- id: isort
6365
name: isort (cython)
6466
types: [cython]

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [0.18.0] - MM/DD/2025
7+
## [0.18.0] - 05/DD/2025
88

99
This release achieves 100% compliance with Python Array API specification (revision [2024.12](https://data-apis.org/array-api/2024.12/)).
10+
The release provides enhanced compatibility with NumPy 2.2.5. Window and mathematical routines are complemented by a set of new functions.
11+
Moreover, it adds support to build `dpnp` from the source for AMD GPUs.
1012

1113
### Added
1214

@@ -39,13 +41,17 @@ This release achieves 100% compliance with Python Array API specification (revis
3941
* The parameter `axis` in `dpnp.take_along_axis` function has now a default value of `-1` [#2442](https://github.com/IntelPython/dpnp/pull/2442)
4042
* Updates the list of required python versions documented in `Quick Start Guide` [#2449](https://github.com/IntelPython/dpnp/pull/2449)
4143
* Updated FFT module to ensure an input array is Hermitian before calling complex-to-real FFT [#2444](https://github.com/IntelPython/dpnp/pull/2444)
44+
* Aligned `black` configuration with the list of supported python versions [#2457](https://github.com/IntelPython/dpnp/pull/2457)
45+
* Use `pyproject.toml` instead of `setup.py` aligning with current packaging best practices [#2462](https://github.com/IntelPython/dpnp/pull/2462)
46+
* Added a clarification to `dpnp.linalg.cond` docstring about its behavior with singular matrices [#2500] (https://github.com/IntelPython/dpnp/pull/2500)
4247

4348
### Fixed
4449

4550
* Resolved an issue with an incorrect result returned due to missing dependency from the strided kernel on a copy event in `dpnp.erf` [#2378](https://github.com/IntelPython/dpnp/pull/2378)
4651
* Updated `conda create` commands build and install instructions of `Quick start guide` to avoid a compilation error [#2395](https://github.com/IntelPython/dpnp/pull/2395)
4752
* Added handling of empty string passed to a test env variable defining data type scope as a `False` value [#2415](https://github.com/IntelPython/dpnp/pull/2415)
4853
* Resolved build issues on non-Intel targets in `dpnp.i0` and `dpnp.kaiser` [#2439](https://github.com/IntelPython/dpnp/pull/2439)
54+
* Ensure consistency in the `dpnp.linalg.LinAlgError` exception raised on singular input matrices for both non-batched and batched cases in `dpnp.linalg.inv` [#2458] (https://github.com/IntelPython/dpnp/pull/2458)
4955

5056

5157
## [0.17.0] - 02/26/2025

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ FetchContent_Declare(
5555
pybind11
5656
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
5757
URL_HASH SHA256=e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20
58+
FIND_PACKAGE_ARGS NAMES pybind11
5859
)
5960
FetchContent_MakeAvailable(pybind11)
6061

conda-recipe/bld.bat

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
2-
SET "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
3-
SET "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
2+
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
3+
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
44

55
"%PYTHON%" setup.py clean --all
66

77
set "MKLROOT=%PREFIX%/Library"
88
set "TBB_ROOT_HINT=%PREFIX%/Library"
99
set "DPL_ROOT_HINT=%PREFIX%/Library"
1010

11-
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
12-
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
13-
1411
REM Overriding IPO is useful for building in resources constrained VMs (public CI)
1512
if DEFINED OVERRIDE_INTEL_IPO (
16-
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
13+
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
1714
)
1815

19-
FOR %%V IN (17.0.0 17 18.0.0 18 19.0.0 19) DO @(
16+
FOR %%V IN (17.0.0 17 18.0.0 18 19.0.0 19 20.0.0 20 21.0.0 21) DO @(
2017
REM set DIR_HINT if directory exists
2118
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
22-
SET "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
19+
set "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
2320
)
2421
)
2522

@@ -37,21 +34,37 @@ if EXIST "%PLATFORM_DIR%" (
3734
if errorlevel 1 exit 1
3835
)
3936

40-
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
41-
rem Install and assemble wheel package from the build bits
42-
"%PYTHON%" setup.py install bdist_wheel %SKBUILD_ARGS%
43-
if errorlevel 1 exit 1
44-
copy dist\dpnp*.whl %WHEELS_OUTPUT_FOLDER%
45-
if errorlevel 1 exit 1
46-
) ELSE (
47-
rem Only install
48-
"%PYTHON%" setup.py install %SKBUILD_ARGS%
49-
if errorlevel 1 exit 1
37+
set "CC=icx"
38+
set "CXX=icx"
39+
40+
set "CMAKE_GENERATOR=Ninja"
41+
:: Make CMake verbose
42+
set "VERBOSE=1"
43+
44+
%PYTHON% -m build -w -n -x
45+
if %ERRORLEVEL% neq 0 exit 1
46+
47+
:: `pip install dist\numpy*.whl` does not work on windows,
48+
:: so use a loop; there's only one wheel in dist/ anyway
49+
for /f %%f in ('dir /b /S .\dist') do (
50+
%PYTHON% -m wheel tags --remove --build %GIT_DESCRIBE_NUMBER% %%f
51+
if %ERRORLEVEL% neq 0 exit 1
5052
)
5153

52-
rem copy back
53-
if EXIST "%PLATFORM_DIR%" (
54-
rem copy back
55-
copy /Y "%FN%" "%PLATFORM_DIR%\%FN%"
56-
if errorlevel 1 exit 1
54+
:: wheel file was renamed
55+
for /f %%f in ('dir /b /S .\dist') do (
56+
%PYTHON% -m pip install %%f ^
57+
--no-build-isolation ^
58+
--no-deps ^
59+
--only-binary :all: ^
60+
--no-index ^
61+
--prefix %PREFIX% ^
62+
-vv
63+
if %ERRORLEVEL% neq 0 exit 1
64+
)
65+
66+
:: Copy wheel package
67+
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
68+
copy dist\dpnp*.whl %WHEELS_OUTPUT_FOLDER%
69+
if %ERRORLEVEL% neq 0 exit 1
5770
)

conda-recipe/build.sh

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,38 @@ export ICPXCFG
1212
ICXCFG="$(pwd)/icpx_for_conda.cfg"
1313
export ICXCFG
1414

15-
export CMAKE_GENERATOR="Ninja"
16-
export TBB_ROOT_HINT=$PREFIX
17-
export DPL_ROOT_HINT=$PREFIX
18-
export MKL_ROOT_HINT=$PREFIX
19-
SKBUILD_ARGS=(-- "-DCMAKE_C_COMPILER:PATH=icx" "-DCMAKE_CXX_COMPILER:PATH=icpx" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
20-
SKBUILD_ARGS=("${SKBUILD_ARGS[@]}" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
21-
SKBUILD_ARGS=("${SKBUILD_ARGS[@]}" "-DDPNP_WITH_REDIST:BOOL=ON")
22-
23-
# Build wheel package
24-
WHEELS_BUILD_ARGS=("-p" "manylinux_2_28_x86_64")
25-
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
26-
$PYTHON setup.py install bdist_wheel "${WHEELS_BUILD_ARGS[@]}" "${SKBUILD_ARGS[@]}"
27-
cp dist/dpnp*.whl "${WHEELS_OUTPUT_FOLDER}"
28-
else
29-
$PYTHON setup.py install "${SKBUILD_ARGS[@]}"
15+
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
16+
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
17+
18+
if [ -e "_skbuild" ]; then
19+
${PYTHON} setup.py clean --all
20+
fi
21+
22+
export CC=icx
23+
export CXX=icpx
24+
25+
export CMAKE_GENERATOR=Ninja
26+
# Make CMake verbose
27+
export VERBOSE=1
28+
29+
CMAKE_ARGS="${CMAKE_ARGS} -DDPNP_WITH_REDIST:BOOL=ON"
30+
31+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
32+
${PYTHON} -m build -w -n -x
33+
34+
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
35+
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
36+
dist/dpnp*.whl
37+
38+
${PYTHON} -m pip install dist/dpnp*.whl \
39+
--no-build-isolation \
40+
--no-deps \
41+
--only-binary :all: \
42+
--no-index \
43+
--prefix "${PREFIX}" \
44+
-vv
45+
46+
# Copy wheel package
47+
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
48+
cp dist/dpnp*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
3049
fi

conda-recipe/meta.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
{% set required_compiler_and_mkl_version = "2025.0" %}
33
{% set required_dpctl_version = "0.20.0*" %}
44

5+
{% set pyproject = load_file_data('pyproject.toml') %}
6+
{% set py_build_deps = pyproject.get('build-system', {}).get('requires', []) %}
7+
58
package:
69
name: dpnp
710
version: {{ GIT_DESCRIBE_TAG }}
@@ -11,18 +14,27 @@ source:
1114
requirements:
1215
host:
1316
- python
14-
- setuptools
15-
- numpy >=1.23
16-
- cython
17-
- cmake >=3.21
18-
- ninja
19-
- git
17+
- pip >=25.0
18+
- pybind11 >=2.13.6
19+
{% for dep in py_build_deps %}
20+
{% if dep.startswith('dpctl') %}
2021
- dpctl >={{ required_dpctl_version }}
22+
{% elif dep.startswith('ninja') %}
23+
- {{ dep.split(';')[0] }} # [not win]
24+
{% elif dep.startswith('cmake') %}
25+
- {{ dep }}
26+
{% elif dep.startswith('build>=') %}
27+
- {{ 'python-' ~ dep }}
28+
{% else %}
29+
- {{ dep|replace('_','-') }}
30+
{% endif %}
31+
{% endfor %}
32+
# versioneer dependency
33+
- tomli # [py<311]
34+
# Do not use pyproject.toml for setting dependencies on OneAPI packages
2135
- mkl-devel-dpcpp >={{ required_compiler_and_mkl_version }},<{{ max_compiler_and_mkl_version }}
2236
- onedpl-devel
2337
- tbb-devel
24-
- wheel
25-
- scikit-build
2638
build:
2739
- {{ compiler('cxx') }}
2840
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},<{{ max_compiler_and_mkl_version }}

doc/quick_start_guide.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ On Linux:
9494

9595
.. code-block:: bash
9696
97-
conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel \
98-
onedpl-devel cmake scikit-build ninja pytest intel-gpu-ocl-icd-system \
97+
conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel \
98+
onedpl-devel cmake scikit-build ninja versioneer pytest intel-gpu-ocl-icd-system \
9999
-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels
100100
conda activate build-env
101101
102102
On Windows:
103103

104104
.. code-block:: bash
105105
106-
conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel \
107-
onedpl-devel cmake scikit-build ninja pytest intel-gpu-ocl-icd-system \
106+
conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel \
107+
onedpl-devel cmake scikit-build ninja versioneer pytest intel-gpu-ocl-icd-system \
108108
-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels
109109
conda activate build-env
110110

0 commit comments

Comments
 (0)