Skip to content

Commit 93534d7

Browse files
Merge master into impl_qr_new
2 parents 0fe3346 + 94ad65b commit 93534d7

24 files changed

+913
-152
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Cancel Previous Runs
34-
uses: styfle/cancel-workflow-action@0.11.0
34+
uses: styfle/cancel-workflow-action@0.12.0
3535
with:
3636
access_token: ${{ github.token }}
3737

@@ -42,7 +42,7 @@ jobs:
4242
echo "$GITHUB_CONTEXT"
4343
4444
- name: Free Disk Space (Ubuntu)
45-
uses: jlumbroso/free-disk-space@main
45+
uses: jlumbroso/free-disk-space@v1.3.1
4646
with:
4747
docker-images: false
4848

@@ -76,13 +76,13 @@ jobs:
7676
sudo apt-get install -y nvidia-cuda-toolkit clinfo
7777
7878
- name: Checkout repo
79-
uses: actions/checkout@v3.5.2
79+
uses: actions/checkout@v4.1.1
8080
with:
8181
fetch-depth: 0
8282

8383
# https://github.com/marketplace/actions/setup-miniconda
8484
- name: Setup miniconda
85-
uses: conda-incubator/setup-miniconda@v2.2.0
85+
uses: conda-incubator/setup-miniconda@v3.0.1
8686
with:
8787
auto-update-conda: true
8888
python-version: ${{ env.python-ver }}
@@ -184,7 +184,7 @@ jobs:
184184
runs-on: ubuntu-20.04
185185

186186
steps:
187-
- uses: actions/checkout@v3.5.2
187+
- uses: actions/checkout@v4.1.1
188188
with:
189189
fetch-depth: 0
190190

.github/workflows/conda-package.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ jobs:
6868

6969
steps:
7070
- name: Cancel Previous Runs
71-
uses: styfle/cancel-workflow-action@0.11.0
71+
uses: styfle/cancel-workflow-action@0.12.0
7272
with:
7373
access_token: ${{ github.token }}
7474

7575
- name: Checkout DPNP repo
76-
uses: actions/checkout@v3.5.2
76+
uses: actions/checkout@v4.1.1
7777
with:
7878
fetch-depth: 0
7979

8080
- name: Setup miniconda
81-
uses: conda-incubator/setup-miniconda@v2.2.0
81+
uses: conda-incubator/setup-miniconda@v3.0.1
8282
with:
8383
auto-update-conda: true
8484
python-version: ${{ matrix.python }}
@@ -99,7 +99,7 @@ jobs:
9999
run: conda install conda-build
100100

101101
- name: Cache conda packages
102-
uses: actions/cache@v3.3.0
102+
uses: actions/cache@v4
103103
env:
104104
CACHE_NUMBER: 1 # Increase to reset cache
105105
with:
@@ -114,7 +114,7 @@ jobs:
114114
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
115115

116116
- name: Upload artifact
117-
uses: actions/upload-artifact@v3.1.2
117+
uses: actions/upload-artifact@v4.3.0
118118
with:
119119
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
120120
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -147,7 +147,7 @@ jobs:
147147

148148
steps:
149149
- name: Download artifact
150-
uses: actions/download-artifact@v3.0.2
150+
uses: actions/download-artifact@v4.1.1
151151
with:
152152
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
153153
path: ${{ env.pkg-path-in-channel }}
@@ -158,7 +158,7 @@ jobs:
158158
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
159159
160160
- name: Setup miniconda
161-
uses: conda-incubator/setup-miniconda@v2.2.0
161+
uses: conda-incubator/setup-miniconda@v3.0.1
162162
with:
163163
auto-update-conda: true
164164
python-version: ${{ matrix.python }}
@@ -190,7 +190,7 @@ jobs:
190190
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
191191

192192
- name: Cache conda packages
193-
uses: actions/cache@v3.3.0
193+
uses: actions/cache@v4
194194
env:
195195
CACHE_NUMBER: 1 # Increase to reset cache
196196
with:
@@ -248,7 +248,7 @@ jobs:
248248

249249
steps:
250250
- name: Download artifact
251-
uses: actions/download-artifact@v3.0.2
251+
uses: actions/download-artifact@v4.1.1
252252
with:
253253
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
254254
path: ${{ env.pkg-path-in-channel }}
@@ -268,7 +268,7 @@ jobs:
268268
dir ${{ env.extracted-pkg-path }}
269269
270270
- name: Setup miniconda
271-
uses: conda-incubator/setup-miniconda@v2.2.0
271+
uses: conda-incubator/setup-miniconda@v3.0.1
272272
with:
273273
auto-update-conda: true
274274
python-version: ${{ matrix.python }}
@@ -314,7 +314,7 @@ jobs:
314314
run: more lockfile
315315

316316
- name: Cache conda packages
317-
uses: actions/cache@v3.3.0
317+
uses: actions/cache@v4
318318
env:
319319
CACHE_NUMBER: 1 # Increase to reset cache
320320
with:
@@ -382,12 +382,12 @@ jobs:
382382
383383
steps:
384384
- name: Download artifact
385-
uses: actions/download-artifact@v3.0.2
385+
uses: actions/download-artifact@v4.1.1
386386
with:
387387
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
388388

389389
- name: Setup miniconda
390-
uses: conda-incubator/setup-miniconda@v2.2.0
390+
uses: conda-incubator/setup-miniconda@v3.0.1
391391
with:
392392
auto-update-conda: true
393393
python-version: ${{ matrix.python }}
@@ -410,7 +410,7 @@ jobs:
410410
run:
411411
shell: bash -el {0}
412412
steps:
413-
- uses: conda-incubator/setup-miniconda@v2
413+
- uses: conda-incubator/setup-miniconda@v3.0.1
414414
with:
415415
run-post: false
416416
channel-priority: "disabled"
@@ -421,7 +421,7 @@ jobs:
421421
run: conda install anaconda-client
422422

423423
- name: Checkout repo
424-
uses: actions/checkout@v3.5.2
424+
uses: actions/checkout@v4.1.1
425425
with:
426426
repository: IntelPython/devops-tools
427427
fetch-depth: 0

.github/workflows/generate_coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ jobs:
1919

2020
steps:
2121
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@0.11.0
22+
uses: styfle/cancel-workflow-action@0.12.0
2323
with:
2424
access_token: ${{ github.token }}
2525

2626
- name: Checkout repo
27-
uses: actions/checkout@v3.5.2
27+
uses: actions/checkout@v4.1.1
2828
with:
2929
fetch-depth: 0
3030

3131
- name: Setup miniconda
32-
uses: conda-incubator/setup-miniconda@v2.2.0
32+
uses: conda-incubator/setup-miniconda@v3.0.1
3333
with:
3434
auto-update-conda: true
3535
python-version: ${{ env.python-ver }}

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
sudo ln -s /usr/bin/clang-format-12 /usr/bin/clang-format
1717
clang-format --version
1818
19-
- uses: actions/checkout@v3.5.2
20-
- uses: actions/setup-python@v4.6.1
19+
- uses: actions/checkout@v4.1.1
20+
- uses: actions/setup-python@v5
2121
with:
2222
python-version: '3.11'
2323
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/PyCQA/bandit
5-
rev: '1.7.5'
5+
rev: '1.7.7'
66
hooks:
77
- id: bandit
88
pass_filenames: false
99
args: ["-r", "dpnp", "-lll"]
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.4.0
11+
rev: v4.5.0
1212
hooks:
1313
- id: check-ast
1414
- id: check-builtin-literals
@@ -43,12 +43,12 @@ repos:
4343
- id: rst-inline-touching-normal
4444
- id: text-unicode-replacement-char
4545
- repo: https://github.com/psf/black
46-
rev: 23.7.0
46+
rev: 23.12.1
4747
hooks:
4848
- id: black
4949
args: ["--check", "--diff", "--color"]
5050
- repo: https://github.com/pycqa/isort
51-
rev: 5.12.0
51+
rev: 5.13.2
5252
hooks:
5353
- id: isort
5454
name: isort (python)
@@ -59,13 +59,13 @@ repos:
5959
name: isort (pyi)
6060
types: [pyi]
6161
- repo: https://github.com/pycqa/flake8
62-
rev: 6.1.0
62+
rev: 7.0.0
6363
hooks:
6464
- id: flake8
6565
args: ["--config=.flake8"]
6666
additional_dependencies:
6767
- flake8-docstrings==1.7.0
68-
- flake8-bugbear==23.6.5
68+
- flake8-bugbear==24.1.17
6969
- repo: https://github.com/pocc/pre-commit-hooks
7070
rev: v1.3.5
7171
hooks:

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ set(_module_src
3232
${CMAKE_CURRENT_SOURCE_DIR}/gesv.cpp
3333
${CMAKE_CURRENT_SOURCE_DIR}/getrf.cpp
3434
${CMAKE_CURRENT_SOURCE_DIR}/getrf_batch.cpp
35+
${CMAKE_CURRENT_SOURCE_DIR}/getri_batch.cpp
3536
${CMAKE_CURRENT_SOURCE_DIR}/heevd.cpp
3637
${CMAKE_CURRENT_SOURCE_DIR}/orgqr.cpp
3738
${CMAKE_CURRENT_SOURCE_DIR}/orgqr_batch.cpp

dpnp/backend/extensions/lapack/getrf_batch.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ static sycl::event getrf_batch_impl(sycl::queue exec_q,
116116
// Get the indices of the first zero diagonal elements of these matrices
117117
auto error_info = be.exceptions();
118118

119+
auto error_matrices_ids_size = error_matrices_ids.size();
120+
auto dev_info_size = static_cast<std::size_t>(py::len(dev_info));
121+
if (error_matrices_ids_size != dev_info_size) {
122+
throw py::value_error("The size of `dev_info` must be equal to" +
123+
std::to_string(error_matrices_ids_size) +
124+
", but currently it is " +
125+
std::to_string(dev_info_size) + ".");
126+
}
127+
119128
for (size_t i = 0; i < error_matrices_ids.size(); ++i) {
120129
// Assign the index of the first zero diagonal element in each
121130
// error matrix to the corresponding index in 'dev_info'
@@ -190,6 +199,14 @@ std::pair<sycl::event, sycl::event>
190199
", but a 2-dimensional array is expected.");
191200
}
192201

202+
const int dev_info_size = py::len(dev_info);
203+
if (dev_info_size != batch_size) {
204+
throw py::value_error("The size of 'dev_info' (" +
205+
std::to_string(dev_info_size) +
206+
") does not match the expected batch size (" +
207+
std::to_string(batch_size) + ").");
208+
}
209+
193210
// check compatibility of execution queue and allocation queue
194211
if (!dpctl::utils::queues_are_compatible(exec_q, {a_array, ipiv_array})) {
195212
throw py::value_error(
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//*****************************************************************************
2+
// Copyright (c) 2024, 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+
28+
#include <CL/sycl.hpp>
29+
#include <oneapi/mkl.hpp>
30+
31+
#include <dpctl4pybind11.hpp>
32+
33+
namespace dpnp
34+
{
35+
namespace backend
36+
{
37+
namespace ext
38+
{
39+
namespace lapack
40+
{
41+
extern std::pair<sycl::event, sycl::event>
42+
getri_batch(sycl::queue exec_q,
43+
dpctl::tensor::usm_ndarray a_array,
44+
dpctl::tensor::usm_ndarray ipiv_array,
45+
py::list dev_info,
46+
std::int64_t n,
47+
std::int64_t stride_a,
48+
std::int64_t stride_ipiv,
49+
std::int64_t batch_size,
50+
const std::vector<sycl::event> &depends = {});
51+
52+
extern void init_getri_batch_dispatch_vector(void);
53+
} // namespace lapack
54+
} // namespace ext
55+
} // namespace backend
56+
} // namespace dpnp

0 commit comments

Comments
 (0)