Skip to content

Commit 3febb00

Browse files
authored
Merge branch 'master' into exclude-kernels-headers-from-default-coverage
2 parents fea1842 + 37db1c5 commit 3febb00

File tree

15 files changed

+210
-99
lines changed

15 files changed

+210
-99
lines changed

.github/workflows/conda-package.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
32+
python: ['3.10', '3.11', '3.12', '3.13']
3333
os: [ubuntu-22.04, windows-2022]
3434

3535
permissions:
@@ -128,7 +128,7 @@ jobs:
128128
strategy:
129129
fail-fast: false
130130
matrix:
131-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
131+
python: ['3.10', '3.11', '3.12', '3.13']
132132
os: [ubuntu-latest]
133133

134134
env:
@@ -256,7 +256,7 @@ jobs:
256256
strategy:
257257
fail-fast: false
258258
matrix:
259-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
259+
python: ['3.10', '3.11', '3.12', '3.13']
260260
os: [windows-2022]
261261

262262
env:
@@ -405,7 +405,7 @@ jobs:
405405
strategy:
406406
fail-fast: false
407407
matrix:
408-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
408+
python: ['3.10', '3.11', '3.12', '3.13']
409409
os: [ubuntu-22.04, windows-2022]
410410

411411
runs-on: ${{ matrix.os }}

.github/workflows/cron-run-tests.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
package-name: dpnp
1414
channels-list: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1515
test-env-name: test
16+
test-packages: 'pytest scipy'
1617
rerun-tests-max-attempts: 2
1718
rerun-tests-timeout: 20
1819

@@ -37,20 +38,8 @@ jobs:
3738
strategy:
3839
fail-fast: false
3940
matrix:
40-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
41+
python: ['3.10', '3.11', '3.12', '3.13']
4142
runner: [ubuntu-22.04, ubuntu-24.04, windows-2022]
42-
include:
43-
- python: 3.9
44-
# do not install scipy due to import issue
45-
test-packages: "pytest"
46-
- python: 3.10
47-
test-packages: "pytest scipy"
48-
- python: 3.11
49-
test-packages: "pytest scipy"
50-
- python: 3.12
51-
test-packages: "pytest scipy"
52-
- python: 3.13
53-
test-packages: "pytest scipy"
5443

5544
steps:
5645
- name: Cancel Previous Runs
@@ -96,12 +85,12 @@ jobs:
9685
id: install_dpnp
9786
continue-on-error: true
9887
run: |
99-
mamba install ${{ env.package-name }}=${{ steps.find_latest_tag.outputs.tag }} ${{ matrix.test-packages }} ${{ env.channels-list }}
88+
mamba install ${{ env.package-name }}=${{ steps.find_latest_tag.outputs.tag }} ${{ env.test-packages }} ${{ env.channels-list }}
10089
10190
- name: ReInstall dpnp
10291
if: steps.install_dpnp.outcome == 'failure'
10392
run: |
104-
mamba install ${{ env.package-name }}=${{ steps.find_latest_tag.outputs.tag }} ${{ matrix.test-packages }} ${{ env.channels-list }}
93+
mamba install ${{ env.package-name }}=${{ steps.find_latest_tag.outputs.tag }} ${{ env.test-packages }} ${{ env.channels-list }}
10594
10695
- name: List installed packages
10796
run: mamba list

.github/workflows/openssf-scorecard.yml

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

7373
# Upload the results to GitHub's code scanning dashboard.
7474
- name: "Upload to code-scanning"
75-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
75+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
7676
with:
7777
sarif_file: results.sarif

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ repos:
6565
- id: black
6666
exclude: "dpnp/_version.py"
6767
- repo: https://github.com/pycqa/isort
68-
rev: 6.1.0
68+
rev: 7.0.0
6969
hooks:
7070
- id: isort
7171
name: isort (python)

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [0.20.0] - MM/DD/2026
88

99
This release changes the license from `BSD-2-Clause` to `BSD-3-Clause`.
10+
The release drops support for Python 3.9, making Python 3.10 the minimum required version.
1011

1112
### Added
1213

@@ -24,6 +25,8 @@ This release changes the license from `BSD-2-Clause` to `BSD-3-Clause`.
2425

2526
### Removed
2627

28+
* Dropped support for Python 3.9 [#2626](https://github.com/IntelPython/dpnp/pull/2626)
29+
2730
### Fixed
2831

2932
### Security

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test:
6363
requires:
6464
- pytest
6565
- setuptools
66-
- scipy # [py>39]
66+
- scipy
6767

6868
about:
6969
home: https://github.com/IntelPython/dpnp

doc/quick_start_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Follow device driver installation instructions to complete the step.
2424
Python Interpreter
2525
==================
2626

27-
You will need Python 3.9, 3.10, 3.11, 3.12 or 3.13 installed on your system. If you
27+
You will need Python 3.10, 3.11, 3.12 or 3.13 installed on your system. If you
2828
do not have one yet the easiest way to do that is to install
2929
`Intel Distribution for Python*`_. It installs all essential Python numerical
3030
and machine learning packages optimized for the Intel hardware, including

dpnp/tests/test_fft.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def test_error(self, xp):
261261
if xp == dpnp:
262262
# dpnp and stock NumPy raise TypeError
263263
# Intel NumPy raises SystemError for Python 3.10 and 3.11
264-
# and no error for Python 3.9
265264
assert_raises(TypeError, xp.fft.fft, a, n=5.0)
266265

267266
# Invalid number of FFT point for incorrect n value

dpnp/tests/third_party/cupy/core_tests/test_ndarray_indexing.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import unittest
24
import warnings
35

@@ -6,6 +8,10 @@
68

79
import dpnp as cupy
810
from dpnp.tests.third_party.cupy import testing
11+
from dpnp.tests.third_party.cupy.testing._protocol_helpers import (
12+
DummyObjectWithCudaArrayInterface,
13+
DummyObjectWithCuPyGetNDArray,
14+
)
915

1016
if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1":
1117
from numpy.exceptions import ComplexWarning
@@ -130,9 +136,30 @@
130136
)
131137
class TestArrayIndexingParameterized(unittest.TestCase):
132138

139+
_getitem_hip_skip_condition = [
140+
((1, 0, 2), (2, 3, 4), None),
141+
((-1, 0, -2), (2, 3, 4), None),
142+
((1, 0, 2), (2, 3, 4), (2, 0, 1)),
143+
((-1, 0, -2), (2, 3, 4), (2, 0, 1)),
144+
((slice(None, None, None), None), (2,), None),
145+
((slice(-9, -10, -1),), (10,), None),
146+
((slice(-4, -5, -1),), (10,), None),
147+
((slice(-5, -6, -1),), (10,), None),
148+
]
149+
150+
def _check_getitem_hip_skip_condition(self):
151+
return (
152+
self.indexes,
153+
self.shape,
154+
self.transpose,
155+
) in self._getitem_hip_skip_condition
156+
133157
@testing.for_all_dtypes()
134158
@testing.numpy_cupy_array_equal()
135159
def test_getitem(self, xp, dtype):
160+
# if cupy.cuda.runtime.is_hip:
161+
# if self._check_getitem_hip_skip_condition():
162+
# pytest.xfail("HIP may have a bug")
136163
a = testing.shaped_arange(self.shape, xp, dtype)
137164
if self.transpose:
138165
a = a.transpose(self.transpose)
@@ -261,3 +288,18 @@ def test_remain0d(self, xp):
261288
a = xp.zeros((2, 3, 4), dtype=dtype)
262289
a[0, 1, 2] = testing.shaped_arange((), xp, dtype)
263290
return a
291+
292+
293+
@pytest.mark.skip("CUDA array interface is not supported")
294+
@pytest.mark.parametrize(
295+
"cupy_like",
296+
[
297+
DummyObjectWithCuPyGetNDArray,
298+
DummyObjectWithCudaArrayInterface,
299+
],
300+
)
301+
def test_setitem_with_cupy_like(cupy_like):
302+
# Test that normal assignment supports interfaces
303+
a = cupy.zeros(10)
304+
a[...] = cupy_like(cupy.arange(10))
305+
testing.assert_array_equal(a, cupy.arange(10))

dpnp/tests/third_party/cupy/core_tests/test_reduction.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
from __future__ import annotations
2+
13
import unittest
24

35
import numpy
46
import pytest
5-
from dpctl.tensor._numpy_helper import AxisError
67

78
import dpnp as cupy
89

910
# import cupy._core._accelerator as _acc
1011
# from cupy import _core
1112
from dpnp.tests.third_party.cupy import testing
13+
from dpnp.tests.third_party.cupy.testing._protocol_helpers import (
14+
DummyObjectWithCudaArrayInterface,
15+
DummyObjectWithCuPyGetNDArray,
16+
)
17+
18+
# from cupy.exceptions import ComplexWarning, AxisError
1219

13-
if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1":
14-
from numpy.exceptions import ComplexWarning
15-
else:
16-
from numpy import ComplexWarning
1720

1821
pytest.skip(
1922
"create/get_reduction_func() and ReductionKernel are not supported",
@@ -258,3 +261,26 @@ def test_large_dims_keep_kernels(self):
258261
shape = (4, 3, 2, 4, 3, 2, 2)
259262
axis = (1, 4, 3, 6)
260263
self.check_int8_sum(shape, axis=axis, keepdims=True)
264+
265+
266+
class TestArgumentTypes:
267+
kernel = _core.create_reduction_func(
268+
"my_sum", ("f->f",), ("in0", "a + b", "out0 = a", None), 0
269+
)
270+
271+
@pytest.mark.parametrize(
272+
"cupy_like",
273+
[
274+
DummyObjectWithCuPyGetNDArray,
275+
DummyObjectWithCudaArrayInterface,
276+
],
277+
)
278+
def test_cupy_like_protocols(self, cupy_like):
279+
# Check that reduction kernels work on the cupy like protocols
280+
x = cupy_like(cupy.arange(10, dtype=cupy.float32))
281+
res = self.kernel(x)
282+
assert res == 45
283+
284+
def test_bad_argument(self):
285+
with pytest.raises(TypeError, match="Argument 'a' has incorrect type"):
286+
self.kernel(numpy.array([1, 2, 3]))

0 commit comments

Comments
 (0)