Skip to content

Commit a104663

Browse files
authored
Merge branch 'master' into bump-conda-index
2 parents 6d37270 + a48c4af commit a104663

732 files changed

Lines changed: 136378 additions & 2083 deletions

File tree

Some content is hidden

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

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
name: Build and Deploy Docs
2727

2828
runs-on: ubuntu-22.04
29-
timeout-minutes: 60
29+
timeout-minutes: 90
3030

3131
permissions:
3232
# Needed to cancel any previous runs that are not completed for a given workflow

.github/workflows/check-onemath.yaml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
7575

7676
runs-on: ${{ matrix.os }}
77-
timeout-minutes: 60
77+
timeout-minutes: 120
7878

7979
defaults:
8080
run:
@@ -133,6 +133,14 @@ jobs:
133133
if: env.rerun-tests-on-failure != 'true'
134134
run: |
135135
python -m pytest -ra --pyargs dpnp.tests
136+
env:
137+
SKIP_TENSOR_TESTS: 1
138+
SYCL_CACHE_PERSISTENT: 1
139+
140+
- name: Run tensor tests
141+
if: env.rerun-tests-on-failure != 'true'
142+
run: |
143+
python -m pytest -ra --pyargs dpnp.tests.tensor
136144
env:
137145
SYCL_CACHE_PERSISTENT: 1
138146

@@ -150,6 +158,24 @@ jobs:
150158
mamba activate ${{ env.test-env-name }}
151159
152160
python -m pytest -ra --pyargs dpnp.tests
161+
env:
162+
SKIP_TENSOR_TESTS: 1
163+
SYCL_CACHE_PERSISTENT: 1
164+
165+
- name: ReRun tensor tests on Linux
166+
if: env.rerun-tests-on-failure == 'true'
167+
id: run_tensor_tests
168+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
169+
with:
170+
timeout_minutes: ${{ env.rerun-tests-timeout }}
171+
max_attempts: ${{ env.rerun-tests-max-attempts }}
172+
retry_on: any
173+
command: |
174+
. $CONDA/etc/profile.d/conda.sh
175+
. $CONDA/etc/profile.d/mamba.sh
176+
mamba activate ${{ env.test-env-name }}
177+
178+
python -m pytest -ra --pyargs dpnp.tests.tensor
153179
env:
154180
SYCL_CACHE_PERSISTENT: 1
155181

@@ -239,6 +265,14 @@ jobs:
239265
if: env.rerun-tests-on-failure != 'true'
240266
run: |
241267
python -m pytest -ra --pyargs dpnp.tests
268+
env:
269+
SKIP_TENSOR_TESTS: 1
270+
SYCL_CACHE_PERSISTENT: 1
271+
272+
- name: Run tensor tests
273+
if: env.rerun-tests-on-failure != 'true'
274+
run: |
275+
python -m pytest -ra --pyargs dpnp.tests.tensor
242276
env:
243277
SYCL_CACHE_PERSISTENT: 1
244278

@@ -256,5 +290,23 @@ jobs:
256290
mamba activate ${{ env.test-env-name }}
257291
258292
python -m pytest -ra --pyargs dpnp.tests
293+
env:
294+
SKIP_TENSOR_TESTS: 1
295+
SYCL_CACHE_PERSISTENT: 1
296+
297+
- name: ReRun tensor tests on Linux
298+
if: env.rerun-tests-on-failure == 'true'
299+
id: run_tensor_tests_branch
300+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
301+
with:
302+
timeout_minutes: ${{ env.rerun-tests-timeout }}
303+
max_attempts: ${{ env.rerun-tests-max-attempts }}
304+
retry_on: any
305+
command: |
306+
. $CONDA/etc/profile.d/conda.sh
307+
. $CONDA/etc/profile.d/mamba.sh
308+
mamba activate ${{ env.test-env-name }}
309+
310+
python -m pytest -ra --pyargs dpnp.tests.tensor
259311
env:
260312
SYCL_CACHE_PERSISTENT: 1

.github/workflows/conda-package.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
actions: write
3838

3939
runs-on: ${{ matrix.os }}
40-
timeout-minutes: 60
40+
timeout-minutes: 90
4141

4242
defaults:
4343
run:
@@ -220,6 +220,7 @@ jobs:
220220
- name: Run tests
221221
if: env.rerun-tests-on-failure != 'true'
222222
run: |
223+
export SKIP_TENSOR_TESTS=1
223224
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
224225
export DPNP_TEST_ALL_INT_TYPES=1
225226
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
@@ -239,6 +240,7 @@ jobs:
239240
. $CONDA/etc/profile.d/conda.sh
240241
. $CONDA/etc/profile.d/mamba.sh
241242
mamba activate ${{ env.test-env-name }}
243+
export SKIP_TENSOR_TESTS=1
242244
243245
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
244246
export DPNP_TEST_ALL_INT_TYPES=1
@@ -247,6 +249,26 @@ jobs:
247249
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
248250
fi
249251
252+
- name: Run tensor tests
253+
if: env.rerun-tests-on-failure != 'true'
254+
run: |
255+
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
256+
257+
- name: Run tensor tests
258+
if: env.rerun-tests-on-failure == 'true'
259+
id: run_tests_tensor_linux
260+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
261+
with:
262+
timeout_minutes: ${{ env.rerun-tests-timeout }}
263+
max_attempts: ${{ env.rerun-tests-max-attempts }}
264+
retry_on: any
265+
command: |
266+
. $CONDA/etc/profile.d/conda.sh
267+
. $CONDA/etc/profile.d/mamba.sh
268+
mamba activate ${{ env.test-env-name }}
269+
270+
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
271+
250272
test_windows:
251273
name: Test
252274

@@ -382,6 +404,7 @@ jobs:
382404
if: env.rerun-tests-on-failure != 'true'
383405
shell: pwsh
384406
run: |
407+
$env:SKIP_TENSOR_TESTS=1
385408
if (${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }}) {
386409
$env:DPNP_TEST_ALL_INT_TYPES=1
387410
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
@@ -399,13 +422,32 @@ jobs:
399422
retry_on: any
400423
shell: pwsh
401424
command: |
425+
$env:SKIP_TENSOR_TESTS=1
402426
if ( ${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }} ) {
403427
$env:DPNP_TEST_ALL_INT_TYPES=1
404428
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
405429
} else {
406430
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
407431
}
408432
433+
- name: Run tensor tests
434+
if: env.rerun-tests-on-failure != 'true'
435+
shell: pwsh
436+
run: |
437+
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
438+
439+
- name: Run tensor tests
440+
if: env.rerun-tests-on-failure == 'true'
441+
id: run_tests_tensor_win
442+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
443+
with:
444+
timeout_minutes: ${{ env.rerun-tests-timeout }}
445+
max_attempts: ${{ env.rerun-tests-max-attempts }}
446+
retry_on: any
447+
shell: pwsh
448+
command: |
449+
python -m pytest -n auto -ra --pyargs dpnp.tests.tensor
450+
409451
upload:
410452
name: Upload
411453

.github/workflows/generate_coverage.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Generate coverage and push to Coveralls.io
1212

1313
runs-on: ubuntu-latest
14-
timeout-minutes: 120
14+
timeout-minutes: 150
1515

1616
permissions:
1717
# Needed to cancel any previous runs that are not completed for a given workflow
@@ -122,14 +122,15 @@ jobs:
122122
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
123123
with:
124124
shell: bash
125-
timeout_minutes: 60
125+
timeout_minutes: 120
126126
max_attempts: 5
127127
retry_on: error
128128
command: |
129129
. $CONDA/etc/profile.d/conda.sh
130130
conda activate coverage
131131
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
132132
git clean -fxd
133+
export SKIP_TENSOR_TESTS=1
133134
python scripts/gen_coverage.py
134135
135136
- name: Total number of coverage attempts

.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@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
75+
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
7676
with:
7777
sarif_file: results.sarif

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dpnp_pytest.*
2828
example3
2929

3030
*dpnp_backend*
31+
dpnp/include/dpnp/tensor/*.h
3132
dpnp/**/*.cpython*.so
3233
dpnp/**/*.pyd
3334
*~

CHANGELOG.md

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

77
## [0.20.0] - MM/DD/2026
88

9+
This release introduces a major architectural change: the Array API-compliant tensor implementation has been migrated from `dpctl.tensor` into `dpnp.tensor`, simplifying maintenance, reducing cross-project dependencies, and allows the tensor implementation to evolve within `dpnp`.
910
This release changes the license from `BSD-2-Clause` to `BSD-3-Clause`.
1011
This release achieves `dpnp` compatibility with Python 3.14 and enables distributing `dpnp` packages with the latest Python version.
1112
Also, that release drops support for Python 3.9, making Python 3.10 the minimum required version.
@@ -28,6 +29,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
2829
* Added implementation of `dpnp.isin` function [#2595](https://github.com/IntelPython/dpnp/pull/2595)
2930
* Added implementation of `dpnp.scipy.linalg.lu` (SciPy-compatible) [#2787](https://github.com/IntelPython/dpnp/pull/2787)
3031
* Added support for ndarray subclassing via `dpnp.ndarray.view` method with `type` parameter [#2815](https://github.com/IntelPython/dpnp/issues/2815)
32+
* Migrated tensor implementation from `dpctl.tensor` into `dpnp.tensor`, making `dpnp` the primary owner of the Array API-compliant tensor layer [#2856](https://github.com/IntelPython/dpnp/pull/2856)
3133

3234
### Changed
3335

@@ -57,6 +59,8 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
5759
* Updated QR tests to avoid element-wise comparisons for `raw` and `r` modes [#2785](https://github.com/IntelPython/dpnp/pull/2785)
5860
* Moved all SYCL kernel functors from `backend/extensions/` to a unified `backend/kernels/` directory hierarchy [#2816](https://github.com/IntelPython/dpnp/pull/2816)
5961
* `dpnp` uses pybind11 3.0.3 [#2834](https://github.com/IntelPython/dpnp/pull/2834)
62+
* Disabled `dpnp.tensor` tests by default in `conda build --test` to prevent OOM failures during package testing. Set `SKIP_TENSOR_TESTS=0` to re-enable them on systems with enough memory [#2860](https://github.com/IntelPython/dpnp/pull/2860)
63+
* `dpnp` uses pybind11 3.0.4 [#2865](https://github.com/IntelPython/dpnp/pull/2865)
6064

6165
### Deprecated
6266

@@ -84,6 +88,8 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
8488
* Resolved an issue with strides calculation in `dpnp.diagonal` to return correct values for empty diagonals [#2814](https://github.com/IntelPython/dpnp/pull/2814)
8589
* Fixed test tolerance issues for float16 intermediate precision that became visible when testing against conda-forge's NumPy [#2828](https://github.com/IntelPython/dpnp/pull/2828)
8690
* Ensured device aware dtype handling in `dpnp.identity` and `dpnp.gradient` [#2835](https://github.com/IntelPython/dpnp/pull/2835)
91+
* Fixed `dpnp.tensor.round` to use device-aware output dtype for boolean input [#2851](https://github.com/IntelPython/dpnp/pull/2851)
92+
* Resolved a deadlock in `dpnp.linalg.qr` by releasing the GIL before OneMKL `orgqr` call to prevent host tasks contention [#2850](https://github.com/IntelPython/dpnp/pull/2850)
8793

8894
### Security
8995

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,23 @@ project(
3737
)
3838

3939
option(DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" OFF)
40+
option(
41+
DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS
42+
"Build dpnp tensor pybind11 offloading extensions with coverage instrumentation"
43+
OFF
44+
)
4045
option(DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" OFF)
4146
option(
4247
DPNP_WITH_REDIST
4348
"Build DPNP assuming DPC++ redistributable is installed into Python prefix"
4449
OFF
4550
)
51+
option(
52+
DPNP_TENSOR_OFFLOAD_COMPRESS
53+
"Build dpnp tensor using offload section compression feature of DPC++ to reduce \
54+
size of shared object with offloading sections"
55+
OFF
56+
)
4657

4758
set(CMAKE_CXX_STANDARD 17)
4859
set(CMAKE_CXX_STANDARD_REQUIRED True)
@@ -95,8 +106,8 @@ find_package(Python 3.10...<3.15 REQUIRED COMPONENTS Development.Module NumPy)
95106
include(FetchContent)
96107
FetchContent_Declare(
97108
pybind11
98-
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.0.3.tar.gz
99-
URL_HASH SHA256=787459e1e186ee82001759508fefa408373eae8a076ffe0078b126c6f8f0ec5e
109+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.0.4.tar.gz
110+
URL_HASH SHA256=74b6a2c2b4573a400cafb6ecbf60c98df300cd3d0041296b913d02b2cbbb2676
100111
FIND_PACKAGE_ARGS NAMES pybind11
101112
)
102113
FetchContent_MakeAvailable(pybind11)
@@ -106,7 +117,6 @@ find_package(Cython REQUIRED)
106117

107118
find_package(Dpctl REQUIRED)
108119
message(STATUS "Dpctl_INCLUDE_DIR=" ${Dpctl_INCLUDE_DIR})
109-
message(STATUS "Dpctl_TENSOR_INCLUDE_DIR=" ${Dpctl_TENSOR_INCLUDE_DIR})
110120

111121
option(DPNP_USE_ONEMATH "Build DPNP with oneMath" OFF)
112122
set(DPNP_TARGET_CUDA

conda-recipe/run_test.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ if not defined PYTHON (
3131
)
3232

3333

34+
REM Skip tensor tests by default to avoid OOM in conda builds.
35+
REM Set SKIP_TENSOR_TESTS=0 to run them on machines with enough memory.
36+
if not defined SKIP_TENSOR_TESTS (
37+
set "SKIP_TENSOR_TESTS=1"
38+
)
39+
3440
"%PYTHON%" -c "import dpnp; print(dpnp.__version__)"
3541
if %errorlevel% neq 0 exit 1
3642

conda-recipe/run_test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ if [ -z "${PYTHON}" ]; then
3333
PYTHON=$PREFIX/bin/python
3434
fi
3535

36+
# Skip tensor tests by default to avoid OOM in conda builds.
37+
# Set SKIP_TENSOR_TESTS=0 to run them on machines with enough memory.
38+
if [ -z "${SKIP_TENSOR_TESTS}" ]; then
39+
export SKIP_TENSOR_TESTS=1
40+
fi
41+
3642
set -e
3743

3844
$PYTHON -c "import dpnp; print(dpnp.__version__)"

0 commit comments

Comments
 (0)