Skip to content

Commit e634aa8

Browse files
authored
Merge branch 'master' into enable-clip-tests
2 parents 0635fcf + 316240c commit e634aa8

File tree

85 files changed

+3594
-2491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3594
-2491
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
oneapi-pkgs-env: ''
4343
# Enable env when it's required to use only conda packages without OneAPI installation
4444
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
45+
dpctl-pkg-txt: 'environments/dpctl_pkg.txt'
4546

4647
steps:
4748
- name: Cancel Previous Runs
@@ -149,7 +150,7 @@ jobs:
149150
- name: Install dpctl
150151
if: env.oneapi-pkgs-env == ''
151152
run: |
152-
pip install -i https://pypi.anaconda.org/dppy/label/dev/simple dpctl==0.20.0dev0
153+
pip install -r ${{ env.dpctl-pkg-txt }}
153154
154155
- name: Conda info
155156
run: |

.github/workflows/check-mkl-interfaces.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Merge conda env files
5050
run: |
51-
conda-merge ${{ env.build-with-oneapi-env }} ${{ env.dpctl-pkg-env }} ${{ env.oneapi-pkgs-env }} > ${{ env.environment-file }}
51+
conda-merge ${{ env.dpctl-pkg-env }} ${{ env.oneapi-pkgs-env }} ${{ env.build-with-oneapi-env }} > ${{ env.environment-file }}
5252
cat ${{ env.environment-file }}
5353
5454
- name: Upload artifact
@@ -229,7 +229,7 @@ jobs:
229229
python -c "import dpnp; print(dpnp.__version__)"
230230
231231
- name: Run tests
232-
if: env.rerun-tests-on-failure == 'true'
232+
if: env.rerun-tests-on-failure != 'true'
233233
run: |
234234
python -m pytest -ra --pyargs dpnp.tests
235235
env:

.github/workflows/conda-package.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ jobs:
8282
environment-file: ${{ env.build-conda-pkg-env }}
8383
activate-environment: ${{ env.build-env-name }}
8484

85+
- name: List installed packages
86+
run: mamba list
87+
8588
- name: Store conda paths as envs
8689
shell: bash -el {0}
8790
run: |
@@ -93,13 +96,13 @@ jobs:
9396
continue-on-error: true
9497
run: conda build --no-test --python ${{ matrix.python }} --numpy 2.0 ${{ env.channels-list }} conda-recipe
9598
env:
96-
MAX_BUILD_CMPL_MKL_VERSION: '2025.1a0'
99+
MAX_BUILD_CMPL_MKL_VERSION: '2025.2a0'
97100

98101
- name: ReBuild conda package
99102
if: steps.build_conda_pkg.outcome == 'failure'
100103
run: conda build --no-test --python ${{ matrix.python }} --numpy 2.0 ${{ env.channels-list }} conda-recipe
101104
env:
102-
MAX_BUILD_CMPL_MKL_VERSION: '2025.1a0'
105+
MAX_BUILD_CMPL_MKL_VERSION: '2025.2a0'
103106

104107
- name: Upload artifact
105108
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -625,6 +628,7 @@ jobs:
625628
python -m pytest --json-report --json-report-file=${{ env.json-report-file }} --disable-deadline --skips-file ${{ env.array-api-skips-file }} array_api_tests || true
626629
env:
627630
ARRAY_API_TESTS_MODULE: 'dpnp'
631+
ARRAY_API_TESTS_VERSION: '2024.12'
628632
SYCL_CACHE_PERSISTENT: 1
629633
working-directory: ${{ env.array-api-tests-path }}
630634

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
oneapi-pkgs-env: ''
2727
# Enable env when it's required to use only conda packages without OneAPI installation
2828
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
29+
dpctl-pkg-txt: 'environments/dpctl_pkg.txt'
2930

3031
steps:
3132
- name: Cancel Previous Runs
@@ -108,7 +109,7 @@ jobs:
108109
- name: Install dpctl
109110
if: env.oneapi-pkgs-env == ''
110111
run: |
111-
pip install -i https://pypi.anaconda.org/dppy/label/dev/simple dpctl==0.20.0dev0
112+
pip install -r ${{ env.dpctl-pkg-txt }}
112113
113114
- name: Conda info
114115
run: |

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
71+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
7272
with:
7373
sarif_file: results.sarif

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030

3131
- name: Set up python
32-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
32+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
3333
with:
3434
python-version: '3.13'
3535

.pre-commit-config.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/PyCQA/bandit
5-
rev: '1.7.9'
5+
rev: '1.8.3'
66
hooks:
77
- id: bandit
88
pass_filenames: false
99
args: ["-r", "dpnp", "-lll"]
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.6.0
11+
rev: v5.0.0
1212
hooks:
1313
- id: check-ast
1414
- id: check-builtin-literals
@@ -44,17 +44,18 @@ repos:
4444
- id: rst-inline-touching-normal
4545
- id: text-unicode-replacement-char
4646
- repo: https://github.com/codespell-project/codespell
47-
rev: v2.3.0
47+
rev: v2.4.1
4848
hooks:
4949
- id: codespell
50+
args: ["-L", "abd"] # ignore "abd" used in einsum tests
5051
additional_dependencies:
5152
- tomli
5253
- repo: https://github.com/psf/black
53-
rev: 24.4.2
54+
rev: 25.1.0
5455
hooks:
5556
- id: black
5657
- repo: https://github.com/pycqa/isort
57-
rev: 5.13.2
58+
rev: 6.0.1
5859
hooks:
5960
- id: isort
6061
name: isort (python)
@@ -65,20 +66,20 @@ repos:
6566
name: isort (pyi)
6667
types: [pyi]
6768
- repo: https://github.com/pycqa/flake8
68-
rev: 7.1.0
69+
rev: 7.1.2
6970
hooks:
7071
- id: flake8
7172
args: ["--config=.flake8"]
7273
additional_dependencies:
7374
- flake8-docstrings==1.7.0
74-
- flake8-bugbear==24.4.26
75+
- flake8-bugbear==24.12.12
7576
- repo: https://github.com/pocc/pre-commit-hooks
7677
rev: v1.3.5
7778
hooks:
7879
- id: clang-format
7980
args: ["-i"]
8081
- repo: https://github.com/gitleaks/gitleaks
81-
rev: v8.18.4
82+
rev: v8.24.0
8283
hooks:
8384
- id: gitleaks
8485
- repo: https://github.com/jumanjihouse/pre-commit-hooks
@@ -102,3 +103,8 @@ repos:
102103
"--disable=unused-wildcard-import"
103104
]
104105
files: '^dpnp/(dpnp_iface.*|fft|linalg)'
106+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
107+
rev: v2.14.0
108+
hooks:
109+
- id: pretty-format-toml
110+
args: [--autofix]

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [0.18.0] - MM/DD/2025
88

9+
This release achieves 100% compliance with Python Array API specification (revision [2024.12](https://data-apis.org/array-api/2024.12/)).
10+
911
### Added
1012

1113
* Added implementation of `dpnp.hamming` [#2341](https://github.com/IntelPython/dpnp/pull/2341), [#2357](https://github.com/IntelPython/dpnp/pull/2357)
1214
* Added implementation of `dpnp.hanning` [#2358](https://github.com/IntelPython/dpnp/pull/2358)
1315
* Added implementation of `dpnp.blackman` [#2363](https://github.com/IntelPython/dpnp/pull/2363)
1416
* Added implementation of `dpnp.bartlett` [#2366](https://github.com/IntelPython/dpnp/pull/2366)
17+
* Added implementation of `dpnp.convolve` [#2205](https://github.com/IntelPython/dpnp/pull/2205)
18+
* Added implementation of `dpnp.kaiser` [#2387](https://github.com/IntelPython/dpnp/pull/2387)
1519

1620
### Changed
1721

22+
* Improved performance of `dpnp.nansum`, `dpnp.nanprod`, `dpnp.nancumsum`, and `dpnp.nancumprod` by reusing `dpnp.nan_to_num` function in implementation of the functions [#2339](https://github.com/IntelPython/dpnp/pull/2339)
1823
* Allowed input array of `uint64` dtype in `dpnp.bincount` [#2361](https://github.com/IntelPython/dpnp/pull/2361)
1924
* The vector norms `ord={None, 1, 2, inf}` and the matrix norms `ord={None, 1, 2, inf, "fro", "nuc"}` now consistently return zero for empty arrays, which are arrays with at least one axis of size zero. This change affects `dpnp.linalg.norm`, `dpnp.linalg.vector_norm`, and `dpnp.linalg.matrix_norm`. Previously, dpnp would either raise errors or return zero depending on the parameters provided [#2371](https://github.com/IntelPython/dpnp/pull/2371)
25+
* Extended `dpnp.fft.fftfreq` and `dpnp.fft.rfftfreq` functions to support `dtype` keyword per Python Array API spec 2024.12 [#2384](https://github.com/IntelPython/dpnp/pull/2384)
26+
* Updated `dpnp.fix` to return output with the same data-type of input [#2392](https://github.com/IntelPython/dpnp/pull/2392)
27+
* Updated `dpnp.einsum` to add support for `order=None` [#2411](https://github.com/IntelPython/dpnp/pull/2411)
28+
* Updated Python Array API specification version supported to `2024.12` [#2416](https://github.com/IntelPython/dpnp/pull/2416)
29+
* Removed `einsum_call` keyword from `dpnp.einsum_path` signature [#2421](https://github.com/IntelPython/dpnp/pull/2421)
2030

2131
### Fixed
2232

2333
* 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)
34+
* 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)
35+
* 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)
2436

2537

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

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set max_compiler_and_mkl_version = environ.get("MAX_BUILD_CMPL_MKL_VERSION", "2026.0a0") %}
22
{% set required_compiler_and_mkl_version = "2025.0" %}
3-
{% set required_dpctl_version = "0.19.0*" %}
3+
{% set required_dpctl_version = "0.20.0*" %}
44

55
package:
66
name: dpnp

doc/quick_start_guide.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,18 @@ On Linux:
8888

8989
.. code-block:: bash
9090
91-
conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c https://software.repos.intel.com/python/conda/ -c conda-forge
91+
conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel \
92+
onedpl-devel cmake scikit-build ninja pytest intel-gpu-ocl-icd-system \
93+
-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge
9294
conda activate build-env
9395
9496
On Windows:
9597

9698
.. code-block:: bash
9799
98-
conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c https://software.repos.intel.com/python/conda/ -c conda-forge
100+
conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel \
101+
onedpl-devel cmake scikit-build ninja pytest intel-gpu-ocl-icd-system \
102+
-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge
99103
conda activate build-env
100104
101105
To build and install the package on Linux OS, run:

doc/reference/array_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Array API standard compatibility
88

99
DPNP's main namespace as well as the :mod:`dpnp.fft` and :mod:`dpnp.linalg`
1010
namespaces are compatible with the
11-
`2023.12 version <https://data-apis.org/array-api/2023.12/index.html>`__
11+
`2024.12 version <https://data-apis.org/array-api/2024.12/index.html>`__
1212
of the Python array API standard.
1313

1414
Inspection

dpnp/backend/extensions/blas/blas_py.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ PYBIND11_MODULE(_blas_impl, m)
6262
using event_vecT = std::vector<sycl::event>;
6363

6464
{
65-
dot_ns::init_dot_dispatch_vector<dot_impl_fn_ptr_t,
66-
blas_ns::DotContigFactory>(
65+
dot_ns::init_dot_dispatch_vector<blas_ns::DotContigFactory>(
6766
dot_dispatch_vector);
6867

6968
auto dot_pyapi = [&](sycl::queue &exec_q, const arrayT &src1,
@@ -81,8 +80,7 @@ PYBIND11_MODULE(_blas_impl, m)
8180
}
8281

8382
{
84-
dot_ns::init_dot_dispatch_vector<dot_impl_fn_ptr_t,
85-
blas_ns::DotcContigFactory>(
83+
dot_ns::init_dot_dispatch_vector<blas_ns::DotcContigFactory>(
8684
dotc_dispatch_vector);
8785

8886
auto dotc_pyapi = [&](sycl::queue &exec_q, const arrayT &src1,
@@ -101,8 +99,7 @@ PYBIND11_MODULE(_blas_impl, m)
10199
}
102100

103101
{
104-
dot_ns::init_dot_dispatch_vector<dot_impl_fn_ptr_t,
105-
blas_ns::DotuContigFactory>(
102+
dot_ns::init_dot_dispatch_vector<blas_ns::DotuContigFactory>(
106103
dotu_dispatch_vector);
107104

108105
auto dotu_pyapi = [&](sycl::queue &exec_q, const arrayT &src1,

dpnp/backend/extensions/blas/dot_common.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ typedef sycl::event (*dot_impl_fn_ptr_t)(sycl::queue &,
5050
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
5151
namespace py = pybind11;
5252

53-
template <typename dispatchT>
5453
std::pair<sycl::event, sycl::event>
5554
dot_func(sycl::queue &exec_q,
5655
const dpctl::tensor::usm_ndarray &vectorX,
5756
const dpctl::tensor::usm_ndarray &vectorY,
5857
const dpctl::tensor::usm_ndarray &result,
5958
const std::vector<sycl::event> &depends,
60-
const dispatchT &dot_dispatch_vector)
59+
const dot_impl_fn_ptr_t *dot_dispatch_vector)
6160
{
6261
const int vectorX_nd = vectorX.get_ndim();
6362
const int vectorY_nd = vectorY.get_ndim();
@@ -166,12 +165,10 @@ std::pair<sycl::event, sycl::event>
166165
return std::make_pair(args_ev, dot_ev);
167166
}
168167

169-
template <typename dispatchT,
170-
template <typename fnT, typename T>
171-
typename factoryT>
172-
void init_dot_dispatch_vector(dispatchT dot_dispatch_vector[])
168+
template <template <typename fnT, typename T> typename factoryT>
169+
void init_dot_dispatch_vector(dot_impl_fn_ptr_t dot_dispatch_vector[])
173170
{
174-
dpctl_td_ns::DispatchVectorBuilder<dispatchT, factoryT,
171+
dpctl_td_ns::DispatchVectorBuilder<dot_impl_fn_ptr_t, factoryT,
175172
dpctl_td_ns::num_types>
176173
contig;
177174
contig.populate_dispatch_vector(dot_dispatch_vector);

dpnp/backend/extensions/statistics/common.hpp renamed to dpnp/backend/extensions/common/ext/common.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
namespace type_utils = dpctl::tensor::type_utils;
3737

38-
namespace statistics::common
38+
namespace ext::common
3939
{
4040

4141
template <typename N, typename D>
@@ -185,4 +185,6 @@ sycl::nd_range<1>
185185
// headers of dpctl.
186186
pybind11::dtype dtype_from_typenum(int dst_typenum);
187187

188-
} // namespace statistics::common
188+
} // namespace ext::common
189+
190+
#include "ext/details/common_internal.hpp"

dpnp/backend/extensions/statistics/common.cpp renamed to dpnp/backend/extensions/common/ext/details/common_internal.hpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
// THE POSSIBILITY OF SUCH DAMAGE.
2424
//*****************************************************************************
2525

26-
#include "common.hpp"
26+
#include "ext/common.hpp"
2727
#include "utils/type_dispatch.hpp"
2828
#include <pybind11/pybind11.h>
2929

3030
namespace dpctl_td_ns = dpctl::tensor::type_dispatch;
3131

32-
namespace statistics::common
32+
namespace ext::common
3333
{
34-
size_t get_max_local_size(const sycl::device &device)
34+
inline size_t get_max_local_size(const sycl::device &device)
3535
{
3636
constexpr const int default_max_cpu_local_size = 256;
3737
constexpr const int default_max_gpu_local_size = 0;
@@ -40,9 +40,9 @@ size_t get_max_local_size(const sycl::device &device)
4040
default_max_gpu_local_size);
4141
}
4242

43-
size_t get_max_local_size(const sycl::device &device,
44-
int cpu_local_size_limit,
45-
int gpu_local_size_limit)
43+
inline size_t get_max_local_size(const sycl::device &device,
44+
int cpu_local_size_limit,
45+
int gpu_local_size_limit)
4646
{
4747
int max_work_group_size =
4848
device.get_info<sycl::info::device::max_work_group_size>();
@@ -56,30 +56,31 @@ size_t get_max_local_size(const sycl::device &device,
5656
return max_work_group_size;
5757
}
5858

59-
sycl::nd_range<1>
59+
inline sycl::nd_range<1>
6060
make_ndrange(size_t global_size, size_t local_range, size_t work_per_item)
6161
{
6262
return make_ndrange(sycl::range<1>(global_size),
6363
sycl::range<1>(local_range),
6464
sycl::range<1>(work_per_item));
6565
}
6666

67-
size_t get_local_mem_size_in_bytes(const sycl::device &device)
67+
inline size_t get_local_mem_size_in_bytes(const sycl::device &device)
6868
{
6969
// Reserving 1kb for runtime needs
7070
constexpr const size_t reserve = 1024;
7171

7272
return get_local_mem_size_in_bytes(device, reserve);
7373
}
7474

75-
size_t get_local_mem_size_in_bytes(const sycl::device &device, size_t reserve)
75+
inline size_t get_local_mem_size_in_bytes(const sycl::device &device,
76+
size_t reserve)
7677
{
7778
size_t local_mem_size =
7879
device.get_info<sycl::info::device::local_mem_size>();
7980
return local_mem_size - reserve;
8081
}
8182

82-
pybind11::dtype dtype_from_typenum(int dst_typenum)
83+
inline pybind11::dtype dtype_from_typenum(int dst_typenum)
8384
{
8485
dpctl_td_ns::typenum_t dst_typenum_t =
8586
static_cast<dpctl_td_ns::typenum_t>(dst_typenum);
@@ -117,4 +118,4 @@ pybind11::dtype dtype_from_typenum(int dst_typenum)
117118
}
118119
}
119120

120-
} // namespace statistics::common
121+
} // namespace ext::common

0 commit comments

Comments
 (0)