Skip to content

Commit 238f0e4

Browse files
Merge master into impl_eigvalsh
2 parents 2e0c3c4 + b57d71f commit 238f0e4

Some content is hidden

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

74 files changed

+1649
-1449
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
day: "saturday"
8+
rebase-strategy: "disabled"

.github/workflows/build-sphinx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ jobs:
8686
sudo apt-get install -y nvidia-cuda-toolkit clinfo
8787
8888
- name: Checkout repo
89-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
89+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
9090
with:
9191
fetch-depth: 0
9292

9393
# https://github.com/marketplace/actions/setup-miniconda
9494
- name: Setup miniconda
95-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
95+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
9696
with:
9797
auto-update-conda: true
9898
python-version: ${{ env.python-ver }}
@@ -199,7 +199,7 @@ jobs:
199199
runs-on: ubuntu-20.04
200200

201201
steps:
202-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
202+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
203203
with:
204204
fetch-depth: 0
205205

.github/workflows/conda-package.yml

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
1515
CONDA_BUILD_VERSION: '24.1.2'
1616
CONDA_INDEX_VERSION: '0.4.0'
17+
TEST_ENV_NAME: 'test'
1718
# TODO: to add test_arraymanipulation.py back to the scope once crash on Windows is gone
1819
TEST_SCOPE: >-
1920
test_arraycreation.py
@@ -81,12 +82,12 @@ jobs:
8182
access_token: ${{ github.token }}
8283

8384
- name: Checkout DPNP repo
84-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
85+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
8586
with:
8687
fetch-depth: 0
8788

8889
- name: Setup miniconda
89-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
90+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
9091
with:
9192
auto-update-conda: true
9293
python-version: ${{ matrix.python }}
@@ -107,7 +108,7 @@ jobs:
107108
run: conda install conda-build=${{ env.CONDA_BUILD_VERSION}}
108109

109110
- name: Cache conda packages
110-
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
111+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
111112
env:
112113
CACHE_NUMBER: 1 # Increase to reset cache
113114
with:
@@ -155,7 +156,7 @@ jobs:
155156

156157
steps:
157158
- name: Download artifact
158-
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
159+
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
159160
with:
160161
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
161162
path: ${{ env.pkg-path-in-channel }}
@@ -166,15 +167,15 @@ jobs:
166167
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
167168
168169
- name: Setup miniconda
169-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
170+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
170171
with:
171172
auto-update-conda: true
172173
python-version: ${{ matrix.python }}
173174
miniconda-version: 'latest'
174-
activate-environment: 'test'
175+
activate-environment: ${{ env.TEST_ENV_NAME }}
175176

176177
- name: Install conda-index
177-
run: conda install conda-index=${{ env.CONDA_INDEX_VERSION}}
178+
run: conda install conda-index=${{ env.CONDA_INDEX_VERSION }}
178179

179180
- name: Create conda channel
180181
run: |
@@ -198,7 +199,7 @@ jobs:
198199
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
199200

200201
- name: Cache conda packages
201-
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
202+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
202203
env:
203204
CACHE_NUMBER: 1 # Increase to reset cache
204205
with:
@@ -223,10 +224,25 @@ jobs:
223224
python -c "import dpnp; print(dpnp.__version__)"
224225
225226
# TODO: run the whole scope once the issues on CPU are resolved
227+
# - name: Run tests
228+
# run: |
229+
# python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
230+
# working-directory: ${{ env.tests-path }}
231+
232+
# TODO: remove once 2024.2 release is published
226233
- name: Run tests
227-
run: |
228-
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
229-
working-directory: ${{ env.tests-path }}
234+
id: run_tests_linux
235+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
236+
with:
237+
shell: bash
238+
timeout_minutes: 10
239+
max_attempts: 5
240+
retry_on: any
241+
command: |
242+
. $CONDA/etc/profile.d/conda.sh
243+
conda activate ${{ env.TEST_ENV_NAME }}
244+
cd ${{ env.tests-path }}
245+
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
230246
231247
test_windows:
232248
name: Test ['windows-latest', python='${{ matrix.python }}']
@@ -252,11 +268,10 @@ jobs:
252268
extracted-pkg-path: '${{ github.workspace }}\pkg'
253269
tests-path: '${{ github.workspace }}\pkg\info\test\tests\'
254270
ver-json-path: '${{ github.workspace }}\version.json'
255-
active-env-name: 'test'
256271

257272
steps:
258273
- name: Download artifact
259-
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
274+
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
260275
with:
261276
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
262277
path: ${{ env.pkg-path-in-channel }}
@@ -276,12 +291,12 @@ jobs:
276291
dir ${{ env.extracted-pkg-path }}
277292
278293
- name: Setup miniconda
279-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
294+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
280295
with:
281296
auto-update-conda: true
282297
python-version: ${{ matrix.python }}
283298
miniconda-version: 'latest'
284-
activate-environment: ${{ env.active-env-name }}
299+
activate-environment: ${{ env.TEST_ENV_NAME }}
285300

286301
- name: Store conda paths as envs
287302
run: |
@@ -323,7 +338,7 @@ jobs:
323338
run: more lockfile
324339

325340
- name: Cache conda packages
326-
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
341+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
327342
env:
328343
CACHE_NUMBER: 1 # Increase to reset cache
329344
with:
@@ -334,9 +349,6 @@ jobs:
334349
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
335350
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
336351
337-
- name: Install opencl_rt
338-
run: conda install opencl_rt -c intel --override-channels
339-
340352
- name: Install dpnp
341353
run: |
342354
@echo on
@@ -362,10 +374,24 @@ jobs:
362374
python -c "import dpnp; print(dpnp.__version__)"
363375
364376
# TODO: run the whole scope once the issues on CPU are resolved
377+
# - name: Run tests
378+
# run: |
379+
# python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
380+
# working-directory: ${{ env.tests-path }}
381+
382+
# TODO: remove once 2024.2 release is published
365383
- name: Run tests
366-
run: |
367-
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
368-
working-directory: ${{ env.tests-path }}
384+
id: run_tests_win
385+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
386+
with:
387+
shell: cmd
388+
timeout_minutes: 15
389+
max_attempts: 5
390+
retry_on: any
391+
command: >-
392+
conda activate ${{ env.TEST_ENV_NAME }}
393+
& cd ${{ env.tests-path }}
394+
& python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
369395
370396
upload:
371397
name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}']
@@ -391,12 +417,12 @@ jobs:
391417
392418
steps:
393419
- name: Download artifact
394-
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
420+
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
395421
with:
396422
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
397423

398424
- name: Setup miniconda
399-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
425+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
400426
with:
401427
auto-update-conda: true
402428
python-version: ${{ matrix.python }}
@@ -419,7 +445,7 @@ jobs:
419445
run:
420446
shell: bash -el {0}
421447
steps:
422-
- uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
448+
- uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
423449
with:
424450
run-post: false
425451
channel-priority: "disabled"
@@ -430,7 +456,7 @@ jobs:
430456
run: conda install anaconda-client
431457

432458
- name: Checkout repo
433-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
459+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
434460
with:
435461
repository: IntelPython/devops-tools
436462
fetch-depth: 0

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
access_token: ${{ github.token }}
3131

3232
- name: Checkout repo
33-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
3434
with:
3535
fetch-depth: 0
3636

3737
- name: Setup miniconda
38-
uses: conda-incubator/setup-miniconda@392cf345b1784333caa1a1185081c71e6ffd61bc # v3.0.2
38+
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3
3939
with:
4040
auto-update-conda: true
4141
python-version: ${{ env.python-ver }}

.github/workflows/openssf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: "Checkout code"
36-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
3737
with:
3838
persist-credentials: false
3939

@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
71+
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
7272
with:
7373
sarif_file: results.sarif

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
pylint
2626
2727
- name: Checkout DPNP repo
28-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
2929

3030
- name: Set up python
3131
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0

conda-recipe/meta.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% set required_compiler_and_mkl_version = "2024.0" %}
22
{% set excluded_compiler_version1 = "2024.0.1" %}
33
{% set excluded_compiler_version2 = "2024.0.2" %}
4+
{% set excluded_compiler_version3 = "2024.0.3" %}
45
{% set required_dpctl_version = "0.16.0" %}
56

67
package:
@@ -26,7 +27,8 @@ requirements:
2627
- scikit-build
2728
build:
2829
- {{ compiler('cxx') }}
29-
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [not osx]
30+
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }},!={{ excluded_compiler_version3 }} # [win]
31+
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [linux]
3032
- sysroot_linux-64 >=2.28 # [linux]
3133
run:
3234
- python

doc/dpctl.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@ Interplay with the Data Parallel Control Library
1010
An example below demonstrates how the Data Parallel Extension for NumPy* can be
1111
easily combined with the device management interface provided by dpctl package.
1212

13-
Literally, the SYCL* queue manager interface from the dpctl package allows
14-
to set an input queue as the currently usable queue inside the context
15-
manager's scope. This way an array creation function from the dpnp package
16-
which is defined inside the context will allocate the data using that queue.
17-
1813
.. code-block:: python
1914
:linenos:
2015
21-
import dpctl
22-
import dpnp as np
16+
import dpctl
17+
import dpnp
18+
19+
d = dpctl.select_cpu_device()
20+
x = dpnp.array([1, 2, 3], device=d)
21+
s = dpnp.sum(x)
22+
23+
y = dpnp.linspace(0, dpnp.pi, num=10**6, device="gpu")
24+
f = 1 + y * dpnp.sin(y)
25+
26+
# locate argument where function attains global maximum
27+
max_arg = x[dpnp.argmax(f)]
28+
max_val = dpnp.max(f)
2329
24-
with dpctl.device_context("opencl:gpu"):
25-
x = np.array([1, 2, 3])
26-
s = np.sum(x)
2730
2831
For more information please refer to `Data Parallel Control Library`_
2932
documentation.

doc/reference/dtype.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Data type testing
4444
dpnp.issubdtype
4545
dpnp.issubsctype
4646
dpnp.issubclass_
47-
dpnp.find_common_type
4847

4948
Miscellaneous
5049
-------------

dpnp/backend/examples/example10.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ void test_dpnp_random_normal(const size_t size,
5050
double dev_time_used = 0.0;
5151
double sum_dev_time_used = 0.0;
5252

53-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
54-
5553
double *result = (double *)dpnp_memory_alloc_c(size * sizeof(double));
5654

5755
dpnp_rng_srand_c(seed); // TODO: will move

dpnp/backend/examples/example3.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ int main(int, char **)
4444
{
4545
const size_t size = 256;
4646

47-
dpnp_queue_initialize_c();
4847
std::cout << "SYCL queue is CPU: " << dpnp_queue_is_cpu_c() << std::endl;
4948

5049
int *array1 = (int *)dpnp_memory_alloc_c(size * sizeof(int));

dpnp/backend/examples/example5.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ int main(int, char **)
5252
{
5353
const size_t size = 256;
5454

55-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
56-
5755
double *result = (double *)dpnp_memory_alloc_c(size * sizeof(double));
5856

5957
size_t seed = 10;

dpnp/backend/examples/example7.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ int main(int, char **)
4545
const size_t size = 2;
4646
size_t len = size * size;
4747

48-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
49-
5048
float *array = (float *)dpnp_memory_alloc_c(len * sizeof(float));
5149
float *result1 = (float *)dpnp_memory_alloc_c(size * sizeof(float));
5250
float *result2 = (float *)dpnp_memory_alloc_c(len * sizeof(float));

dpnp/backend/examples/example8.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ int main(int, char **)
4242
{
4343
const size_t size = 16;
4444

45-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
46-
4745
double *array = (double *)dpnp_memory_alloc_c(size * sizeof(double));
4846
long *result = (long *)dpnp_memory_alloc_c(size * sizeof(long));
4947

dpnp/backend/examples/example9.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ int main(int, char **)
4646
long result = 0;
4747
long result_verification = 0;
4848

49-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
50-
5149
long *array =
5250
reinterpret_cast<long *>(dpnp_memory_alloc_c(size * sizeof(long)));
5351

dpnp/backend/examples/example_bs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ int main(int, char **)
229229
const double RISK_FREE = 0.1;
230230
const double VOLATILITY = 0.2;
231231

232-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
233232
std::cout << "SYCL queue is CPU: " << dpnp_queue_is_cpu_c() << std::endl;
234233

235234
double *price = (double *)dpnp_memory_alloc_c(SIZE * sizeof(double));

0 commit comments

Comments
 (0)