Skip to content

Commit 00a7755

Browse files
authored
Merge branch 'master' into update-gemm-batch
2 parents 78bec82 + a8e6fce commit 00a7755

32 files changed

+69
-56
lines changed

.github/workflows/build-sphinx.yml

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

@@ -199,7 +199,7 @@ jobs:
199199
runs-on: ubuntu-20.04
200200

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

.github/workflows/conda-package.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
access_token: ${{ github.token }}
8383

8484
- name: Checkout DPNP repo
85-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
85+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
8686
with:
8787
fetch-depth: 0
8888

@@ -123,7 +123,7 @@ jobs:
123123
run: conda build --no-test --python ${{ matrix.python }} --numpy 1.23 ${{ env.CHANNELS }} conda-recipe
124124

125125
- name: Upload artifact
126-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
126+
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
127127
with:
128128
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
129129
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
@@ -156,7 +156,7 @@ jobs:
156156

157157
steps:
158158
- name: Download artifact
159-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
159+
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
160160
with:
161161
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
162162
path: ${{ env.pkg-path-in-channel }}
@@ -271,7 +271,7 @@ jobs:
271271

272272
steps:
273273
- name: Download artifact
274-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
274+
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
275275
with:
276276
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
277277
path: ${{ env.pkg-path-in-channel }}
@@ -417,7 +417,7 @@ jobs:
417417
418418
steps:
419419
- name: Download artifact
420-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
420+
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5
421421
with:
422422
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
423423

@@ -456,7 +456,7 @@ jobs:
456456
run: conda install anaconda-client
457457

458458
- name: Checkout repo
459-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
459+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
460460
with:
461461
repository: IntelPython/devops-tools
462462
fetch-depth: 0

.github/workflows/generate_coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
access_token: ${{ github.token }}
3333

3434
- name: Checkout repo
35-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
35+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3636
with:
3737
fetch-depth: 0
3838

.github/workflows/openssf-scorecard.yml

Lines changed: 3 additions & 3 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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
36+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
3737
with:
3838
persist-credentials: false
3939

@@ -60,14 +60,14 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
63+
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
6464
with:
6565
name: SARIF file
6666
path: results.sarif
6767
retention-days: 14
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@4355270be187e1b672a7a1c7c7bae5afdc1ab94a # v3.24.10
71+
uses: github/codeql-action/upload-sarif@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1
7272
with:
7373
sarif_file: results.sarif

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ jobs:
1818
sudo ln -s /usr/bin/clang-format-12 /usr/bin/clang-format
1919
clang-format --version
2020
21-
- name: Set up pylint
21+
- name: Set up pip packages
2222
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
2323
with:
2424
packages: |
25+
codespell
2526
pylint
2627
2728
- name: Checkout DPNP repo
28-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
29+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2930

3031
- name: Set up python
3132
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/PyCQA/bandit
5-
rev: '1.7.7'
5+
rev: '1.7.8'
66
hooks:
77
- id: bandit
88
pass_filenames: false
@@ -42,8 +42,14 @@ repos:
4242
- id: rst-directive-colons
4343
- id: rst-inline-touching-normal
4444
- id: text-unicode-replacement-char
45+
- repo: https://github.com/codespell-project/codespell
46+
rev: v2.2.6
47+
hooks:
48+
- id: codespell
49+
additional_dependencies:
50+
- tomli
4551
- repo: https://github.com/psf/black
46-
rev: 23.12.1
52+
rev: 24.4.0
4753
hooks:
4854
- id: black
4955
args: ["--check", "--diff", "--color"]

doc/_templates/autosummary/class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{% endblock %}
4242

4343
..
44-
Atributes
44+
Attributes
4545
4646
{% block attributes %} {% if attributes %}
4747

doc/docstring_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
Recommendations:
4444
1. Short description
45-
maybe partially taken/combinated from `numpy` and `cupy` docstrings.
45+
maybe partially taken/combined from `numpy` and `cupy` docstrings.
4646
2. Limitations basically should be described according to the code,
4747
paying attention to raised exceptions and fallback to `numpy`.
4848
3. See Also may include links to similar functionality in `dpnp`

dpnp/backend/cmake/Modules/IntelSYCLConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function(SYCL_FEATURE_TEST_RUN TEST_EXE)
188188
set(IntelSYCL_FOUND False)
189189
set(SYCL_REASON_FAILURE "SYCL: feature test execution failed!!")
190190
endif()
191-
# TODO: what iff the result is false.. error or ignore?
191+
# TODO: what if the result is false.. error or ignore?
192192

193193
set( test_result "${result}" PARENT_SCOPE)
194194
set( test_output "${output}" PARENT_SCOPE)

dpnp/backend/examples/example_bs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ void black_scholes(double *price,
144144
dpnp_memory_free_c(w1);
145145
double *halfs_mul_erf_w1 =
146146
(double *)dpnp_memory_alloc_c(size * sizeof(double));
147-
// halfs_mul_erf_w1 = halfs * erf_w1
147+
// halfs_mul_erf_w1 = half * erf_w1
148148
dpnp_multiply_c<double, double, double>(halfs_mul_erf_w1, half, scalar_size,
149149
&scalar_size, ndim, erf_w1, size,
150150
&size, ndim, NULL);
151151
dpnp_memory_free_c(erf_w1);
152152
double *d1 = (double *)dpnp_memory_alloc_c(size * sizeof(double));
153-
// d1 = halfs + halfs_mul_erf_w1
153+
// d1 = half + halfs_mul_erf_w1
154154
dpnp_add_c<double, double, double>(d1, half, scalar_size, &scalar_size,
155155
ndim, halfs_mul_erf_w1, size, &size,
156156
ndim, NULL);
@@ -161,13 +161,13 @@ void black_scholes(double *price,
161161
dpnp_memory_free_c(w2);
162162
double *halfs_mul_erf_w2 =
163163
(double *)dpnp_memory_alloc_c(size * sizeof(double));
164-
// halfs_mul_erf_w2 = halfs * erf_w2
164+
// halfs_mul_erf_w2 = half * erf_w2
165165
dpnp_multiply_c<double, double, double>(halfs_mul_erf_w2, half, scalar_size,
166166
&scalar_size, ndim, erf_w2, size,
167167
&size, ndim, NULL);
168168
dpnp_memory_free_c(erf_w2);
169169
double *d2 = (double *)dpnp_memory_alloc_c(size * sizeof(double));
170-
// d2 = halfs + halfs_mul_erf_w2
170+
// d2 = half + halfs_mul_erf_w2
171171
dpnp_add_c<double, double, double>(d2, half, scalar_size, &scalar_size,
172172
ndim, halfs_mul_erf_w2, size, &size,
173173
ndim, NULL);

dpnp/backend/extensions/blas/gemm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ std::pair<sycl::event, sycl::event>
181181
}
182182
if (b_shape[1] != c_shape[1]) {
183183
throw py::value_error("The number of columns in B must be equal to "
184-
"the number of coulmns in result array.");
184+
"the number of columns in result array.");
185185
}
186186

187187
size_t src_nelems = m * n;

dpnp/backend/extensions/blas/gemm_batch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ std::pair<sycl::event, sycl::event>
195195
}
196196
if (b_shape[2] != c_shape[2]) {
197197
throw py::value_error("The number of columns in B must be equal to "
198-
"the number of coulmns in result array.");
198+
"the number of columns in result array.");
199199
}
200200

201201
std::int64_t first_dim;

dpnp/backend/extensions/sycl_ext/dispatcher_utils.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ struct coord_in_space<DispatchT, Matcher, std::tuple<CurrentAxis>>
300300
}
301301
};
302302

303-
template <typename DispatchT, typename Matcher, typename... Axises>
304-
struct coord_in_space<DispatchT, Matcher, std::tuple<Axises...>>
303+
template <typename DispatchT, typename Matcher, typename... Axes>
304+
struct coord_in_space<DispatchT, Matcher, std::tuple<Axes...>>
305305
{
306-
using CurrentAxis = typename pop_tuple_type<std::tuple<Axises...>>::element;
307-
using OtherAxises = typename pop_tuple_type<std::tuple<Axises...>>::rest;
306+
using CurrentAxis = typename pop_tuple_type<std::tuple<Axes...>>::element;
307+
using OtherAxises = typename pop_tuple_type<std::tuple<Axes...>>::rest;
308308

309309
static bool get(const DispatchT *data, int *result)
310310
{

dpnp/dpnp_iface_manipulation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,11 @@ def result_type(*arrays_and_dtypes):
14101410
"""
14111411

14121412
usm_arrays_and_dtypes = [
1413-
dpnp.get_usm_ndarray(X)
1414-
if isinstance(X, (dpnp_array, dpt.usm_ndarray))
1415-
else X
1413+
(
1414+
dpnp.get_usm_ndarray(X)
1415+
if isinstance(X, (dpnp_array, dpt.usm_ndarray))
1416+
else X
1417+
)
14161418
for X in arrays_and_dtypes
14171419
]
14181420
return dpt.result_type(*usm_arrays_and_dtypes)

examples/example4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"""Example 1.
2929
3030
This example shows input and output types of specified function
31-
This is usefull for development
31+
This is useful for development
3232
3333
"""
3434

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
line-length = 80
33
target-version = ['py38', 'py39', 'py310']
44

5+
[tool.codespell]
6+
builtin = "clear,rare,informal,names"
7+
check-filenames = true
8+
ignore-words-list="amin,arange,elemt,fro,hist,ith,mone,nd,nin,sinc,vart"
9+
quiet-level = 3
10+
511
[tool.pylint.basic]
612
include-naming-hint = true
713

scripts/build_deps_dpctl_win.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set DPCTL_DIST=%CD%\dist_dpctl
1010

1111
call conda uninstall -y dpctl
1212

13-
echo +++++++++++++++++++++++++ Downlowd DPCTL +++++++++++++++++++++++++++
13+
echo +++++++++++++++++++++++++ Download DPCTL +++++++++++++++++++++++++++
1414
call git clone https://github.com/IntelPython/dpctl.git
1515
cd dpctl
1616

scripts/gen_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run(
4646
"LLVM_TOOLS_HOME": bin_llvm,
4747
}
4848

49-
# extend with global enviroment variables
49+
# extend with global environment variables
5050
env.update({k: v for k, v in os.environ.items() if k != "PATH"})
5151

5252
if verbose:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
__version__ = version_mod.get_versions()["version"]
1616

1717
"""
18-
Set project auxilary data like readme and licence files
18+
Set project auxiliary data like readme and licence files
1919
"""
2020
with open("README.md") as f:
2121
__readme_file__ = f.read()

tests/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def is_cpu_device(device=None):
235235

236236
def is_win_platform():
237237
"""
238-
Return True if a test is runing on Windows OS, False otherwise.
238+
Return True if a test is running on Windows OS, False otherwise.
239239
"""
240240
return platform.startswith("win")
241241

tests/test_linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def test_eigenvalues(self, func, shape, dtype, order):
510510
# NumPy with OneMKL and with rocSOLVER sorts in ascending order,
511511
# so w's should be directly comparable.
512512
# However, both OneMKL and rocSOLVER pick a different convention for
513-
# constructing eigenvectors, so v's are not directly comparible and
513+
# constructing eigenvectors, so v's are not directly comparable and
514514
# we verify them through the eigen equation A*v=w*v.
515515
if func in ("eig", "eigh"):
516516
w, _ = getattr(numpy.linalg, func)(a_order)

tests/test_logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ def test_logical_not(dtype):
297297
@pytest.mark.parametrize("x2", [5, [1, 2, 5, 6]], ids=["5", "[1, 2, 5, 6]"])
298298
@pytest.mark.parametrize("dtype", get_all_dtypes(no_complex=True))
299299
def test_elemwise_comparison(op, x1, x2, dtype):
300-
create_func = (
301-
lambda xp, a: xp.asarray(a, dtype=dtype)
300+
create_func = lambda xp, a: (
301+
xp.asarray(a, dtype=dtype)
302302
if not numpy.isscalar(a)
303303
else numpy.dtype(dtype=dtype).type(a)
304304
)

tests/test_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ def test_no_miss_numbers(self, dtype):
11391139
],
11401140
)
11411141
def test_shuffle1(self, conv):
1142-
# `conv` contans test lists, arrays (of various dtypes), and multidimensional
1142+
# `conv` contains test lists, arrays (of various dtypes), and multidimensional
11431143
# versions of both, c-contiguous or not.
11441144
#
11451145
# This test is a modification of the original tests of `numpy.random` (both the same):

tests/test_sycl_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
elif device.device_type.name not in list_of_device_type_str:
4444
pass
4545
elif device.backend.name in "opencl" and device.is_gpu:
46-
# due to reproted crash on Windows: CMPLRLLVM-55640
46+
# due to reported crash on Windows: CMPLRLLVM-55640
4747
pass
4848
else:
4949
valid_devices.append(device)

tests/third_party/cupy/indexing_tests/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_unknown_clip(self):
235235
a = xp.array([0, 3, -1, 5])
236236
c = testing.shaped_arange((3, 4), xp, numpy.float32)
237237
with pytest.raises(ValueError):
238-
a.choose(c, mode="unknow")
238+
a.choose(c, mode="unknown")
239239

240240
def test_raise(self):
241241
a = cupy.array([2])

tests/third_party/cupy/linalg_tests/test_eigenvalue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_eigh_batched(self, xp, dtype):
7878
# NumPy, cuSOLVER, rocSOLVER all sort in ascending order,
7979
# so w's should be directly comparable. However, both cuSOLVER
8080
# and rocSOLVER pick a different convention for constructing
81-
# eigenvectors, so v's are not directly comparible and we verify
81+
# eigenvectors, so v's are not directly comparable and we verify
8282
# them through the eigen equation A*v=w*v.
8383
A = _get_hermitian(xp, a, self.UPLO)
8484
for i in range(a.shape[0]):
@@ -102,7 +102,7 @@ def test_eigh_complex_batched(self, xp, dtype):
102102
# NumPy, cuSOLVER, rocSOLVER all sort in ascending order,
103103
# so w's should be directly comparable. However, both cuSOLVER
104104
# and rocSOLVER pick a different convention for constructing
105-
# eigenvectors, so v's are not directly comparible and we verify
105+
# eigenvectors, so v's are not directly comparable and we verify
106106
# them through the eigen equation A*v=w*v.
107107
A = _get_hermitian(xp, a, self.UPLO)
108108

tests/third_party/cupy/manipulation_tests/test_tiling.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def test_method(self):
4444
)
4545
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
4646
class TestRepeatListBroadcast(unittest.TestCase):
47-
4847
"""Test for `repeats` argument using single element list.
4948
5049
This feature is only supported in NumPy 1.10 or later.
@@ -76,7 +75,6 @@ def test_array_repeat(self, xp):
7675
{"repeats": [2], "axis": 0},
7776
)
7877
class TestRepeat1DListBroadcast(unittest.TestCase):
79-
8078
"""See comment in TestRepeatListBroadcast class."""
8179

8280
@testing.numpy_cupy_array_equal()

0 commit comments

Comments
 (0)