Skip to content

Commit 9ade2ca

Browse files
authored
Merge branch 'master' into update_element_wise_func
2 parents 07bf71c + b51100f commit 9ade2ca

Some content is hidden

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

44 files changed

+771
-692
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
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@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
71+
uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # v3.24.7
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/creation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. _routines.creation:
22

3-
Array Creation Routines
3+
Array creation routines
44
=======================
55

66
.. https://docs.scipy.org/doc/numpy/reference/routines.array-creation.html
77
8-
Basic creation routines
8+
From shape or value
99
-----------------------
1010

1111
.. autosummary::
@@ -24,7 +24,7 @@ Basic creation routines
2424
dpnp.full_like
2525

2626

27-
Creation from other data
27+
From existing data
2828
------------------------
2929

3030
.. autosummary::
@@ -35,6 +35,7 @@ Creation from other data
3535
dpnp.asarray
3636
dpnp.asanyarray
3737
dpnp.ascontiguousarray
38+
dpnp.astype
3839
dpnp.copy
3940
dpnp.frombuffer
4041
dpnp.from_dlpack
@@ -61,7 +62,7 @@ Numerical ranges
6162
dpnp.ogrid
6263

6364

64-
Matrix creation
65+
Building matrices
6566
---------------
6667

6768
.. autosummary::
@@ -82,5 +83,4 @@ The Matrix class
8283
:toctree: generated/
8384
:nosignatures:
8485

85-
dpnp.mat
8686
dpnp.bmat

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

0 commit comments

Comments
 (0)