From c580f7500f557c89a3521e1e84c7afa55f44c358 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:29 +0200 Subject: [PATCH 1/6] Remove a duplicate pre-commit hook check-case-conflict was listed twice; keep the entry in the Git group. --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e697bcf2d67..4d8e006524c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,6 @@ repos: # Contents - id: check-ast - id: check-builtin-literals - - id: check-case-conflict - id: check-executables-have-shebangs - id: check-merge-conflict - id: check-shebang-scripts-are-executable From 862087e74018b840370606cdbe96a811df141323 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:32 +0200 Subject: [PATCH 2/6] Explain the write permissions in bump-sycl-deps.yml The job pushes a branch with the updated pins and opens a pull request from it, which needs contents: write and pull-requests: write. --- .github/workflows/bump-sycl-deps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bump-sycl-deps.yml b/.github/workflows/bump-sycl-deps.yml index 7eee31555bb..713b5da2b0e 100644 --- a/.github/workflows/bump-sycl-deps.yml +++ b/.github/workflows/bump-sycl-deps.yml @@ -25,7 +25,9 @@ jobs: timeout-minutes: 15 permissions: + # Needed to push the branch with the updated pins contents: write + # Needed to open a pull request from that branch pull-requests: write env: From 5ac21e04c05722cad885bbaa2b6a3bd195dafae2 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:35 +0200 Subject: [PATCH 3/6] Remove a duplicate flake8 per-file-ignores entry --- .flake8 | 1 - 1 file changed, 1 deletion(-) diff --git a/.flake8 b/.flake8 index 37b70721bd4..20aa38f7ad2 100644 --- a/.flake8 +++ b/.flake8 @@ -40,7 +40,6 @@ extend-ignore = per-file-ignores = __init__.py: E402, F401 dpnp/dpnp_algo/__init__.py: F401 - dpnp/dpnp_algo/__init__.py: F401 dpnp/fft/__init__.py: F401 dpnp/linalg/__init__.py: F401 dpnp/random/__init__.py: F401 From 8ff6918fe2039ce02f29c7f767be2d47e502ce35 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:37 +0200 Subject: [PATCH 4/6] Package dpnp/tests/third_party/__init__.py Without it the installed dpnp.tests.third_party was an implicit namespace package, unlike in the source tree. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 08fadda683d..acb8b643f80 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ "tests/tensor/*.py", "tests/tensor/*/*.py", "tests/testing/*.py", + "tests/third_party/*.py", "tests/third_party/cupy/*.py", "tests/third_party/cupy/*/*.py", "tests/third_party/cupyx/*.py", From 3b58103faeb30b960584d95fca97beb134dfa74d Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:57 +0200 Subject: [PATCH 5/6] Remove the always-skipped zero-copy tests They import modules that no longer exist, so they were always skipped, and nothing else uses them. --- .../third_party/intel/test_zero_copy_test1.py | 36 --------- .../third_party/intel/zero-copy-test1.py | 79 ------------------- 2 files changed, 115 deletions(-) delete mode 100644 dpnp/tests/third_party/intel/test_zero_copy_test1.py delete mode 100644 dpnp/tests/third_party/intel/zero-copy-test1.py diff --git a/dpnp/tests/third_party/intel/test_zero_copy_test1.py b/dpnp/tests/third_party/intel/test_zero_copy_test1.py deleted file mode 100644 index c59cd5b3188..00000000000 --- a/dpnp/tests/third_party/intel/test_zero_copy_test1.py +++ /dev/null @@ -1,36 +0,0 @@ -import importlib -import sys - -import pytest - - -class dummymodule: - pass - - -sys.modules["numba_dppy"] = dummymodule - -module_not_found = False - -reason = "" - -try: - zero_copy_test1 = importlib.import_module("zero-copy-test1") -except ModuleNotFoundError as e: - module_not_found = True - reason = str(e) - - -@pytest.mark.skipif(module_not_found, reason=reason) -def test_dpnp_interaction_with_dpctl_memory(): - return zero_copy_test1.test_dpnp_interaction_with_dpctl_memory() - - -@pytest.mark.skipif(module_not_found, reason=reason) -def test_dpnp_array_has_iface(): - return zero_copy_test1.test_dpnp_array_has_iface() - - -@pytest.mark.skipif(module_not_found, reason=reason) -def test_dpctl_dparray_has_iface(): - return zero_copy_test1.test_dpctl_dparray_has_iface() diff --git a/dpnp/tests/third_party/intel/zero-copy-test1.py b/dpnp/tests/third_party/intel/zero-copy-test1.py deleted file mode 100644 index 3a749c3d990..00000000000 --- a/dpnp/tests/third_party/intel/zero-copy-test1.py +++ /dev/null @@ -1,79 +0,0 @@ -import dpctl -import dpctl.memory as dpmem -import dpctl.tensor.numpy_usm_shared as usmarray -import numba_dppy as dppy -import numpy as np -import pytest - -import dpnp - - -class DuckUSMArray: - def __init__(self, shape, dtype="d", host_buffer=None): - nelems = np.prod(shape) - bytes = nelems * np.dtype(dtype).itemsize - shmem = dpmem.MemoryUSMShared(bytes) - if isinstance(host_buffer, np.ndarray): - shmem.copy_from_host(host_buffer.view(dtype="|u1")) - self.arr = np.ndarray(shape, dtype=dtype, buffer=shmem) - - def __getitem__(self, index): - return self.arr[index] - - def __setitem__(self, index, val): - self.arr.__setitem__(index, val) - - @property - def __sycl_usm_array_interface__(self): - iface = self.arr.__array_interface__ - b = self.arr.base - iface["syclobj"] = b.__sycl_usm_array_interface__["syclobj"] - iface["version"] = 1 - return iface - - -def test_dpnp_interaction_with_dpctl_memory(): - """Tests if dpnp supports zero-copy data exchange with another Python - object that defines `__sycl_usm_array_interface__` - """ - hb = np.arange(0, 100, dtype=np.int64) - da = DuckUSMArray(hb.shape, dtype=hb.dtype, host_buffer=hb) - - Y = dpnp.asarray(da) - # dpnp array must infer dimensions/dtype from input object - assert Y.dtype == hb.dtype - assert Y.shape == hb.shape - - Y[0] = 10 - assert da[0] == 10 # check zero copy - - -def test_dppy_array_pass(): - """Tests if dppy supports passing an array-like object DuckArray that defines `__sycl_usm_array_interface__` - to a dppy.kernel - """ - - @dppy.kernel - def dppy_f(array_like_obj): - i = dppy.get_global_id(0) - array_like_obj[i] = 10 - - global_size = 100 - hb = np.arange(0, global_size, dtype="i4") - da = DuckUSMArray(hb.shape, dtype=hb.dtype, host_buffer=hb) - - dppy_f[global_size, dppy.DEFAULT_LOCAL_SIZE](da) - - assert da[0] == 10 - - -def test_dpctl_dparray_has_iface(): - """Tests if dpctl.dptensor.numpy_usm_shared defines '__sycl_usm_array_interface__'""" - X = usmarray.ones(10) - assert type(getattr(X, "__sycl_usm_array_interface__", None) is dict) - - -def test_dpnp_array_has_iface(): - """Tests if dpnp.ndarray defines '__sycl_usm_array_interface__'""" - X = dpnp.array([1]) - assert type(getattr(X, "__sycl_usm_array_interface__", None) is dict) From edc9ae70d1b5abbd04b3b50766fdd941fe13bc6a Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 15 Oct 2026 16:01:58 +0200 Subject: [PATCH 6/6] Remove the numpy_ext wrapper It only called the tests_external runner. --- dpnp/tests/third_party/numpy_ext/__init__.py | 42 -------------------- 1 file changed, 42 deletions(-) delete mode 100644 dpnp/tests/third_party/numpy_ext/__init__.py diff --git a/dpnp/tests/third_party/numpy_ext/__init__.py b/dpnp/tests/third_party/numpy_ext/__init__.py deleted file mode 100644 index 382f3402676..00000000000 --- a/dpnp/tests/third_party/numpy_ext/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# ***************************************************************************** -# Copyright (c) 2016, Intel Corporation -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# - Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# - Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# - Neither the name of the copyright holder nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -# THE POSSIBILITY OF SUCH DAMAGE. -# ***************************************************************************** - -""" -To run numpy tests under dpnp. ->>> python -m tests.third_party.numpy_ext -to run specific test suite: ->>> python -m tests.third_party.numpy_ext core/tests/test_umath.py -to run specific test case: ->>> python -m tests.third_party.numpy_ext core/tests/test_umath.py::TestHypot::test_simple -""" - -import dpnp -from tests_external.numpy import runtests - -code = runtests.run() -exit(code)