Skip to content

Commit 9e1fd55

Browse files
Merge include-dpctl-tensor into update_tensor_docs
2 parents 90227c4 + 761573c commit 9e1fd55

File tree

163 files changed

+28488
-480
lines changed

Some content is hidden

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

163 files changed

+28488
-480
lines changed

.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: 80
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: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -117,44 +117,25 @@ jobs:
117117
mamba info
118118
mamba list
119119
120-
- name: Build dpnp tensor with coverage
121-
id: build_tensor
120+
- name: Build dpnp with coverage
121+
id: build_coverage
122122
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
123-
env:
124-
SYCL_CACHE_PERSISTENT: 1
125-
CMAKE_BUILD_PARALLEL_LEVEL: 2
126123
with:
127124
shell: bash
128-
timeout_minutes: 90
125+
timeout_minutes: 120
129126
max_attempts: 5
130127
retry_on: error
131128
command: |
132129
. $CONDA/etc/profile.d/conda.sh
133130
conda activate coverage
134131
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
135132
git clean -fxd
136-
python scripts/gen_coverage.py --build-step tensor
137-
138-
- name: Build dpnp with coverage (skip tensor)
139-
id: build_skip_tensor
140-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
141-
env:
142-
SYCL_CACHE_PERSISTENT: 1
143-
with:
144-
shell: bash
145-
timeout_minutes: 60
146-
max_attempts: 5
147-
retry_on: error
148-
command: |
149-
. $CONDA/etc/profile.d/conda.sh
150-
conda activate coverage
151-
[ -f /opt/intel/oneapi/setvars.sh ] && source /opt/intel/oneapi/setvars.sh
152-
python scripts/gen_coverage.py --build-step skip-tensor
133+
export SKIP_TENSOR_TESTS=1
134+
python scripts/gen_coverage.py
153135
154136
- name: Total number of coverage attempts
155137
run: |
156-
echo "Total tensor build attempts: ${{ steps.build_tensor.outputs.total_attempts }}"
157-
echo "Total skip-tensor build attempts: ${{ steps.build_skip_tensor.outputs.total_attempts }}"
138+
echo "Total number of coverage attempts: ${{ steps.build_coverage.outputs.total_attempts }}"
158139
159140
- name: Upload coverage data to coveralls.io
160141
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7

.gitignore

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

3030
*dpnp_backend*
31-
dpnp/include/
31+
dpnp/include/dpnp/tensor/*.h
3232
dpnp/**/*.cpython*.so
3333
dpnp/**/*.pyd
3434
*~

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ option(
5050
)
5151
option(
5252
DPNP_TENSOR_OFFLOAD_COMPRESS
53-
"Build using offload section compression feature of DPC++ to reduce \
53+
"Build dpnp tensor using offload section compression feature of DPC++ to reduce \
5454
size of shared object with offloading sections"
5555
OFF
5656
)

dpnp/CMakeLists.txt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,10 @@ function(build_dpnp_tensor_ext _trgt _src _dest)
9292
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
9393
set(_cythonize_trgt "${_trgt}_cythonize_pyx")
9494
python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src})
95-
if(BUILD_DPNP_SYCL)
95+
if(BUILD_DPNP_TENSOR_SYCL)
9696
add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
9797
target_compile_options(${_trgt} PRIVATE -fno-sycl-id-queries-fit-in-int)
98-
# For coverage builds, use per_source instead of per_kernel to reduce memory
99-
if(DPNP_GENERATE_COVERAGE)
100-
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_source)
101-
else()
102-
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_kernel)
103-
endif()
98+
target_link_options(${_trgt} PRIVATE -fsycl-device-code-split=per_kernel)
10499
if(DPNP_TENSOR_OFFLOAD_COMPRESS)
105100
target_link_options(${_trgt} PRIVATE --offload-compress)
106101
endif()
@@ -179,14 +174,17 @@ function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
179174
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
180175
endfunction()
181176

182-
# Control which components to build (for memory-constrained CI builds)
183-
# DPNP_BUILD_COMPONENTS:
184-
# ALL (default),
185-
# TENSOR_ONLY,
186-
# SKIP_TENSOR,
187-
if(NOT DEFINED DPNP_BUILD_COMPONENTS)
188-
set(DPNP_BUILD_COMPONENTS "ALL")
189-
endif()
177+
add_subdirectory(tensor)
178+
179+
add_subdirectory(backend)
180+
add_subdirectory(backend/extensions/blas)
181+
add_subdirectory(backend/extensions/fft)
182+
add_subdirectory(backend/extensions/indexing)
183+
add_subdirectory(backend/extensions/lapack)
184+
add_subdirectory(backend/extensions/statistics)
185+
add_subdirectory(backend/extensions/ufunc)
186+
add_subdirectory(backend/extensions/vm)
187+
add_subdirectory(backend/extensions/window)
190188

191189
if(DPNP_BUILD_COMPONENTS STREQUAL "ALL" OR DPNP_BUILD_COMPONENTS STREQUAL "TENSOR_ONLY")
192190
add_subdirectory(tensor)

dpnp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
[os.getenv("PATH", ""), dll_path]
6161
)
6262

63-
from dpnp.tensor import __array_api_version__, DLDeviceType
63+
from .tensor import __array_api_version__, DLDeviceType
6464

6565
from .dpnp_array import dpnp_array as ndarray
6666
from .dpnp_array_api_info import __array_namespace_info__

dpnp/backend/extensions/blas/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
4040
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
4141

4242
# Ensure Cython modules build first so _usmarray.h exists
43-
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
44-
if(TARGET _usmarray)
45-
add_dependencies(${python_module_name} _usmarray)
46-
endif()
43+
add_dependencies(${python_module_name} _usmarray)
4744

4845
if(_dpnp_sycl_targets)
4946
# make fat binary

dpnp/backend/extensions/fft/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
3434
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
3535

3636
# Ensure Cython modules build first so _usmarray.h exists
37-
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
38-
if(TARGET _usmarray)
39-
add_dependencies(${python_module_name} _usmarray)
40-
endif()
37+
add_dependencies(${python_module_name} _usmarray)
4138

4239
if(_dpnp_sycl_targets)
4340
# make fat binary

dpnp/backend/extensions/indexing/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
3737
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
3838

3939
# Ensure Cython modules build first so _usmarray.h exists
40-
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
41-
if(TARGET _usmarray)
42-
add_dependencies(${python_module_name} _usmarray)
43-
endif()
40+
add_dependencies(${python_module_name} _usmarray)
4441

4542
if(_dpnp_sycl_targets)
4643
# make fat binary

0 commit comments

Comments
 (0)