Skip to content

Commit 9c63896

Browse files
committed
Merge branch 'master' into merge_to_gold
2 parents 6501ffe + 5b25163 commit 9c63896

File tree

85 files changed

+8898
-4488
lines changed

Some content is hidden

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

85 files changed

+8898
-4488
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
types: [opened, synchronize, reopened, closed]
88

99
env:
10+
GH_BOT_NAME: 'github-actions[bot]'
11+
GH_BOT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
12+
GH_EVENT_OPEN_PR_UPSTREAM: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' &&
13+
github.event.pull_request && !github.event.pull_request.head.repo.fork }}
14+
GH_EVENT_PUSH_UPSTREAM: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' &&
15+
github.event.ref == 'refs/heads/master' && github.event.repository && !github.event.repository.fork }}
1016
PUBLISH_DIR: doc/_build/html/
1117

1218
defaults:
@@ -91,7 +97,7 @@ jobs:
9197
9298
- name: Install dpnp dependencies
9399
run: |
94-
conda install numpy"<1.24" dpctl">=0.15.1dev1" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
100+
conda install numpy"<1.24" dpctl">=0.15.1dev2" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64"<2024.0.1" \
95101
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
96102
97103
- name: Install cuPy dependencies
@@ -125,36 +131,40 @@ jobs:
125131
working-directory: 'dpnp/backend/doc'
126132

127133
- name: Copy backend docs
128-
run: cp -r dpnp/backend/doc/html doc/_build/html/backend_doc
134+
run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc
129135

130136
# https://github.com/marketplace/actions/github-pages-action
137+
# The step is only used to build docs while pushing a PR to "master"
131138
- name: Deploy docs
132-
if: |
133-
github.event.pull_request && !github.event.pull_request.head.repo.fork &&
134-
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
139+
if: env.GH_EVENT_PUSH_UPSTREAM
135140
uses: peaceiris/actions-gh-pages@v3.9.3
136141
with:
137142
github_token: ${{ secrets.GITHUB_TOKEN }}
138143
publish_dir: ${{ env.PUBLISH_DIR }}
144+
keep_files: true
145+
commit_message: ${{ github.event.head_commit.message }}
146+
publish_branch: gh-pages
147+
user_name: ${{ env.GH_BOT_NAME }}
148+
user_email: ${{ env.GH_BOT_EMAIL }}
139149

150+
# The step is only used to build docs while pushing to PR branch
140151
- name: Publish pull-request docs
141-
if: |
142-
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
152+
if: env.GH_EVENT_OPEN_PR_UPSTREAM
143153
uses: peaceiris/actions-gh-pages@v3.9.3
144154
with:
145155
github_token: ${{ secrets.GITHUB_TOKEN }}
146156
publish_dir: ${{ env.PUBLISH_DIR }}
147157
destination_dir: ./pull/${{ github.event.number }}
148158
allow_empty_commit : true
149159
keep_files: true
150-
commit_message: ${{ github.event.head_commit.message }}
160+
commit_message: ${{ github.event.pull_request.title }}
151161
publish_branch: gh-pages
152-
user_name: 'github-actions[bot]'
153-
user_email: 'github-actions[bot]@users.noreply.github.com'
162+
user_name: ${{ env.GH_BOT_NAME }}
163+
user_email: ${{ env.GH_BOT_EMAIL }}
154164

165+
# The step is only used to build docs while pushing to PR branch
155166
- name: Comment with URL to published pull-request docs
156-
if: |
157-
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
167+
if: env.GH_EVENT_OPEN_PR_UPSTREAM
158168
env:
159169
PR_NUM: ${{ github.event.number }}
160170
uses: mshick/add-pr-comment@v2.8.1
@@ -163,9 +173,11 @@ jobs:
163173
View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html
164174
allow-repeats: false
165175

176+
# The job is only used to build docs when PR is closed (action from PR branch)
166177
clean:
167178
if: |
168-
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
179+
github.event_name == 'pull_request' && github.event.action == 'closed' &&
180+
github.event.pull_request && !github.event.pull_request.head.repo.fork
169181
170182
needs: build-and-deploy
171183

@@ -185,8 +197,8 @@ jobs:
185197
git checkout --track tokened_docs/gh-pages
186198
echo `pwd`
187199
[ -d pull/${PR_NUM} ] && git rm -rf pull/${PR_NUM}
188-
git config --global user.name 'github-actions[bot]'
189-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
200+
git config --global user.name ${{ env.GH_BOT_NAME }}
201+
git config --global user.email ${{ env.GH_BOT_EMAIL }}
190202
git commit -m "Removing docs for closed pull request ${PR_NUM}"
191203
git push tokened_docs gh-pages
192204

.github/workflows/conda-package.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
# TODO: to add test_arraymanipulation.py back to the scope once crash on Windows is gone
1414
TEST_SCOPE: >-
1515
test_arraycreation.py
16+
test_amin_amax.py
1617
test_dot.py
1718
test_dparray.py
1819
test_copy.py
@@ -24,28 +25,24 @@ env:
2425
test_random_state.py
2526
test_sort.py
2627
test_special.py
28+
test_statistics.py
2729
test_sycl_queue.py
2830
test_umath.py
2931
test_usm_type.py
3032
third_party/cupy/core_tests
3133
third_party/cupy/linalg_tests/test_product.py
34+
third_party/cupy/linalg_tests/test_solve.py
3235
third_party/cupy/logic_tests/test_comparison.py
3336
third_party/cupy/logic_tests/test_truth.py
3437
third_party/cupy/manipulation_tests/test_basic.py
3538
third_party/cupy/manipulation_tests/test_dims.py
3639
third_party/cupy/manipulation_tests/test_join.py
3740
third_party/cupy/manipulation_tests/test_rearrange.py
3841
third_party/cupy/manipulation_tests/test_transpose.py
39-
third_party/cupy/math_tests/test_arithmetic.py
40-
third_party/cupy/math_tests/test_explog.py
41-
third_party/cupy/math_tests/test_floating.py
42-
third_party/cupy/math_tests/test_hyperbolic.py
43-
third_party/cupy/math_tests/test_matmul.py
44-
third_party/cupy/math_tests/test_misc.py
45-
third_party/cupy/math_tests/test_rounding.py
46-
third_party/cupy/math_tests/test_trigonometric.py
42+
third_party/cupy/math_tests
4743
third_party/cupy/sorting_tests/test_sort.py
4844
third_party/cupy/sorting_tests/test_count.py
45+
third_party/cupy/statistics_tests/test_meanvar.py
4946
VER_JSON_NAME: 'version.json'
5047
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
5148
VER_SCRIPT2: "d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
@@ -422,7 +419,7 @@ jobs:
422419
run: conda install anaconda-client
423420

424421
- name: Checkout repo
425-
uses: actions/checkout@v2
422+
uses: actions/checkout@v3.5.2
426423
with:
427424
repository: IntelPython/devops-tools
428425
fetch-depth: 0

.github/workflows/generate_coverage.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
env:
1717
python-ver: '3.10'
18-
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
18+
CHANNELS: '-c dppy/label/coverage -c intel -c conda-forge --override-channels'
1919

2020
steps:
2121
- name: Cancel Previous Runs
@@ -42,17 +42,33 @@ jobs:
4242
4343
- name: Install dpnp dependencies
4444
run: |
45+
# use DPC++ compiler 2023.2 to work around an issue with crash
4546
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
46-
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
47+
dpctl">=0.15.1dev2" dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
48+
onedpl-devel ${{ env.CHANNELS }}
4749
4850
- name: Conda info
4951
run: |
5052
conda info
5153
conda list
5254
5355
- name: Build dpnp with coverage
56+
id: build_coverage
57+
uses: nick-fields/retry@v2.9.0
58+
with:
59+
shell: bash
60+
timeout_minutes: 60
61+
max_attempts: 5
62+
retry_on: error
63+
command: |
64+
. $CONDA/etc/profile.d/conda.sh
65+
conda activate coverage
66+
git clean -fxd
67+
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
68+
69+
- name: Total number of coverage attempts
5470
run: |
55-
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
71+
echo "Total number of coverage attempts made: ${{ steps.build_coverage.outputs.total_attempts }}"
5672
5773
- name: Install coverall dependencies
5874
run: |

conda-recipe/meta.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
{% set required_compiler_and_mkl_version = "2024.0" %}
2+
{% set required_dpctl_version = "0.15.1dev2" %}
3+
14
package:
25
name: dpnp
36
version: {{ GIT_DESCRIBE_TAG }}
@@ -13,19 +16,19 @@ requirements:
1316
- cmake >=3.21
1417
- ninja
1518
- git
16-
- dpctl >=0.15.1dev1
17-
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2024.0.0') }}
19+
- dpctl >={{ required_dpctl_version }}
20+
- mkl-devel-dpcpp >={{ required_compiler_and_mkl_version }}
1821
- onedpl-devel
1922
- tbb-devel
2023
- wheel
2124
- scikit-build
2225
build:
2326
- {{ compiler('cxx') }}
24-
- {{ compiler('dpcpp') }} >=2024.0.0 # [not osx]
27+
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }} # [not osx]
2528
- sysroot_linux-64 >=2.28 # [linux]
2629
run:
2730
- python
28-
- dpctl >=0.15.1dev1
31+
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin=None) }}
2932
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
3033
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
3134
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}

doc/reference/math.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Trigonometric functions
2323
dpnp.unwrap
2424
dpnp.deg2rad
2525
dpnp.rad2deg
26+
dpnp.reduce_hypot
2627

2728

2829
Hyperbolic functions
@@ -94,6 +95,7 @@ Exponents and logarithms
9495
dpnp.log1p
9596
dpnp.logaddexp
9697
dpnp.logaddexp2
98+
dpnp.logsumexp
9799

98100

99101
Other special functions

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
set(python_module_name _lapack_impl)
2828
set(_module_src
2929
${CMAKE_CURRENT_SOURCE_DIR}/lapack_py.cpp
30+
${CMAKE_CURRENT_SOURCE_DIR}/gesv.cpp
3031
${CMAKE_CURRENT_SOURCE_DIR}/heevd.cpp
3132
${CMAKE_CURRENT_SOURCE_DIR}/syevd.cpp
3233
)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//*****************************************************************************
2+
// Copyright (c) 2023, Intel Corporation
3+
// All rights reserved.
4+
//
5+
// Redistribution and use in source and binary forms, with or without
6+
// modification, are permitted provided that the following conditions are met:
7+
// - Redistributions of source code must retain the above copyright notice,
8+
// this list of conditions and the following disclaimer.
9+
// - Redistributions in binary form must reproduce the above copyright notice,
10+
// this list of conditions and the following disclaimer in the documentation
11+
// and/or other materials provided with the distribution.
12+
//
13+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23+
// THE POSSIBILITY OF SUCH DAMAGE.
24+
//*****************************************************************************
25+
26+
#pragma once
27+
#include <cstring>
28+
#include <stdexcept>
29+
30+
namespace dpnp
31+
{
32+
namespace backend
33+
{
34+
namespace ext
35+
{
36+
namespace lapack
37+
{
38+
namespace helper
39+
{
40+
template <typename T>
41+
struct value_type_of
42+
{
43+
using type = T;
44+
};
45+
46+
template <typename T>
47+
struct value_type_of<std::complex<T>>
48+
{
49+
using type = T;
50+
};
51+
} // namespace helper
52+
} // namespace lapack
53+
} // namespace ext
54+
} // namespace backend
55+
} // namespace dpnp

0 commit comments

Comments
 (0)