Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
85c4906
Initialize dpnp/tests/tensor and migrate test_tensor_* files
vlad-perevezentsev Mar 12, 2026
244dd6a
Migrate test_usm_ndarray_* to dpnp/tests/tensor
vlad-perevezentsev Mar 12, 2026
b61078f
Fix test_boolean_reductions_nan_inf to assert array instead of scalar
vlad-perevezentsev Mar 12, 2026
fd62a26
Migrate elementwise tests to dpnp/tests/tensor/elementwise
vlad-perevezentsev Mar 12, 2026
e2e633e
Fix incorrect expected dtype in test_complex_usm_type
vlad-perevezentsev Mar 12, 2026
a06936d
Fix incorrect expected dtype in test_hyper_complex_contig
vlad-perevezentsev Mar 13, 2026
935e4e6
Fix incorrect expected dtype in test_log1p_special_cases
vlad-perevezentsev Mar 13, 2026
6f5a792
Fix round() output dtype for boolean input to match numpy
vlad-perevezentsev Mar 13, 2026
42cb05b
Fix incorrect expected dtype in test_trig_complex_contig
vlad-perevezentsev Mar 13, 2026
bf41dc6
Include tensor folder tests in package distribution
vlad-perevezentsev Mar 13, 2026
1a56ad0
Move dpnp/tests/tensor into dpctl_ext/tests
vlad-perevezentsev Mar 16, 2026
fad5749
Update imports in tensor tests and add conftest.py
vlad-perevezentsev Mar 16, 2026
bd015a5
Update package_data for tensor tests in setup.py
vlad-perevezentsev Mar 16, 2026
7c6afd2
Include dpctl_ext tensor tests in public CI pipeline
vlad-perevezentsev Mar 16, 2026
bbda500
Extend package_data with dpctl_ext/tests/*.py
vlad-perevezentsev Mar 16, 2026
7ccc050
Increase build timeout-minutes public CI
vlad-perevezentsev Mar 16, 2026
5c96686
Increase coverage build timeout to 90 minutes
vlad-perevezentsev Mar 16, 2026
252f385
Merge move_usm_ndarray into move_tensor_tests
vlad-perevezentsev Mar 19, 2026
7294993
Enable dpctl_ext tests in conda test scripts
vlad-perevezentsev Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exclude =
conda.recipe,
dpnp/tests/*.py,
tests_external/*.py,
dpctl_ext/tests/*.py,

# Print detailed statistic if any issue detected
count = True
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
actions: write

runs-on: ${{ matrix.os }}
timeout-minutes: 80
timeout-minutes: 90

defaults:
run:
Expand Down Expand Up @@ -247,6 +247,26 @@ jobs:
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
fi

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -n auto -ra --pyargs dpctl_ext.tests

- name: Run tensor tests
if: env.rerun-tests-on-failure == 'true'
id: run_tests_dpctl_ext_linux
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}

python -m pytest -n auto -ra --pyargs dpctl_ext.tests

test_windows:
name: Test

Expand Down Expand Up @@ -406,6 +426,24 @@ jobs:
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
}

- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
shell: pwsh
run: |
python -m pytest -n auto -ra --pyargs dpctl_ext.tests

- name: Run tensor tests
if: env.rerun-tests-on-failure == 'true'
id: run_tests_dpctl_ext_win
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
shell: pwsh
command: |
python -m pytest -n auto -ra --pyargs dpctl_ext.tests

upload:
name: Upload

Expand Down
3 changes: 3 additions & 0 deletions conda-recipe/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ if %errorlevel% neq 0 exit 1

"%PYTHON%" -m pytest -ra --pyargs dpnp
if %errorlevel% neq 0 exit 1

"%PYTHON%" -m pytest -ra --pyargs dpctl_ext
if %errorlevel% neq 0 exit 1
1 change: 1 addition & 0 deletions conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ set -e
$PYTHON -c "import dpnp; print(dpnp.__version__)"
$PYTHON -m dpctl -f
$PYTHON -m pytest -ra --pyargs dpnp
$PYTHON -m pytest -ra --pyargs dpctl_ext
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ template <typename T>
struct RoundOutputType
{
using value_type = typename std::disjunction<
td_ns::TypeMapResultEntry<T, bool, sycl::half>,
td_ns::TypeMapResultEntry<T, std::uint8_t>,
td_ns::TypeMapResultEntry<T, std::uint16_t>,
td_ns::TypeMapResultEntry<T, std::uint32_t>,
Expand Down
37 changes: 37 additions & 0 deletions dpctl_ext/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# *****************************************************************************
# Copyright (c) 2026, 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.
# *****************************************************************************

import numpy

from dpnp.tests import testing

numpy.testing.assert_allclose = testing.assert_allclose
numpy.testing.assert_almost_equal = testing.assert_almost_equal
numpy.testing.assert_array_almost_equal = testing.assert_array_almost_equal
numpy.testing.assert_array_equal = testing.assert_array_equal
numpy.testing.assert_equal = testing.assert_equal
31 changes: 31 additions & 0 deletions dpctl_ext/tests/tensor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *****************************************************************************
# Copyright (c) 2026, 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.
# *****************************************************************************

__doc__ = r"""
Test suite for tensor functionality migrated from dpctl.
Running test suite requires Cython and a working compiler."""
31 changes: 31 additions & 0 deletions dpctl_ext/tests/tensor/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *****************************************************************************
# Copyright (c) 2026, 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.
# *****************************************************************************

"""Configures pytest to discover helper/ module"""

from dpnp.tests.conftest import suppress_invalid_numpy_warnings
32 changes: 32 additions & 0 deletions dpctl_ext/tests/tensor/elementwise/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# *****************************************************************************
# Copyright (c) 2026, 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.
# *****************************************************************************

"""
Collection of test and utility files for testing elementwise operations
over :class:`dpctl.tensor.usm_ndarray`.
"""
Loading
Loading