Skip to content

Commit 3146234

Browse files
Merge master into impl_of_interp
2 parents a65a1dd + 15ed961 commit 3146234

16 files changed

+43
-43
lines changed

.github/workflows/array-api-skips.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ array_api_tests/test_operators_and_elementwise_functions.py::test_clip
66
# unexpected result is returned - unmute when dpctl-1986 is resolved
77
array_api_tests/test_operators_and_elementwise_functions.py::test_asin
88
array_api_tests/test_operators_and_elementwise_functions.py::test_asinh
9-
10-
# advanced indexing relating issues (waiting a fix from dpctl)
11-
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[1]
12-
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[None]
13-
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[1]
14-
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[None]

.github/workflows/build-sphinx.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
oneapi-pkgs-env: ''
4343
# Enable env when it's required to use only conda packages without OneAPI installation
4444
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
45+
dpctl-pkg-txt: 'environments/dpctl_pkg.txt'
4546

4647
steps:
4748
- name: Cancel Previous Runs
@@ -149,7 +150,7 @@ jobs:
149150
- name: Install dpctl
150151
if: env.oneapi-pkgs-env == ''
151152
run: |
152-
pip install -i https://pypi.anaconda.org/dppy/label/dev/simple dpctl==0.20.0dev0
153+
pip install -r ${{ env.dpctl-pkg-txt }}
153154
154155
- name: Conda info
155156
run: |

.github/workflows/conda-package.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ jobs:
8282
environment-file: ${{ env.build-conda-pkg-env }}
8383
activate-environment: ${{ env.build-env-name }}
8484

85+
- name: List installed packages
86+
run: mamba list
87+
8588
- name: Store conda paths as envs
8689
shell: bash -el {0}
8790
run: |

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
oneapi-pkgs-env: ''
2727
# Enable env when it's required to use only conda packages without OneAPI installation
2828
# oneapi-pkgs-env: '${{ github.workspace }}/environments/oneapi_pkgs.yml'
29+
dpctl-pkg-txt: 'environments/dpctl_pkg.txt'
2930

3031
steps:
3132
- name: Cancel Previous Runs
@@ -108,7 +109,7 @@ jobs:
108109
- name: Install dpctl
109110
if: env.oneapi-pkgs-env == ''
110111
run: |
111-
pip install -i https://pypi.anaconda.org/dppy/label/dev/simple dpctl==0.20.0dev0
112+
pip install -r ${{ env.dpctl-pkg-txt }}
112113
113114
- name: Conda info
114115
run: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
* The vector norms `ord={None, 1, 2, inf}` and the matrix norms `ord={None, 1, 2, inf, "fro", "nuc"}` now consistently return zero for empty arrays, which are arrays with at least one axis of size zero. This change affects `dpnp.linalg.norm`, `dpnp.linalg.vector_norm`, and `dpnp.linalg.matrix_norm`. Previously, dpnp would either raise errors or return zero depending on the parameters provided [#2371](https://github.com/IntelPython/dpnp/pull/2371)
2323
* Extended `dpnp.fft.fftfreq` and `dpnp.fft.rfftfreq` functions to support `dtype` keyword per Python Array API spec 2024.12 [#2384](https://github.com/IntelPython/dpnp/pull/2384)
2424
* Updated `dpnp.fix` to return output with the same data-type of input [#2392](https://github.com/IntelPython/dpnp/pull/2392)
25+
* Updated `dpnp.einsum` to add support for `order=None` [#2411](https://github.com/IntelPython/dpnp/pull/2411)
2526

2627
### Fixed
2728

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set max_compiler_and_mkl_version = environ.get("MAX_BUILD_CMPL_MKL_VERSION", "2026.0a0") %}
22
{% set required_compiler_and_mkl_version = "2025.0" %}
3-
{% set required_dpctl_version = "0.19.0*" %}
3+
{% set required_dpctl_version = "0.20.0*" %}
44

55
package:
66
name: dpnp

dpnp/dpnp_iface_linearalgebra.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,13 @@ def einsum(
215215
If provided, forces the calculation to use the data type specified.
216216
217217
Default: ``None``.
218-
order : {"C", "F", "A", "K"}, optional
218+
order : {None, "C", "F", "A", "K"}, optional
219219
Controls the memory layout of the output. ``"C"`` means it should be
220220
C-contiguous. ``"F"`` means it should be F-contiguous, ``"A"`` means
221221
it should be ``"F"`` if the inputs are all ``"F"``, ``"C"`` otherwise.
222222
``"K"`` means it should be as close to the layout as the inputs as
223-
is possible, including arbitrarily permuted axes.
223+
is possible, including arbitrarily permuted axes. ``order=None`` is
224+
equivalent to ``order="K"``.
224225
225226
Default: ``"K"``.
226227
casting : {"no", "equiv", "safe", "same_kind", "unsafe"}, optional

dpnp/dpnp_iface_mathematical.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ def around(x, /, decimals=0, out=None):
612612
Parameters
613613
----------
614614
x : {dpnp.ndarray, usm_ndarray}
615-
Input array, expected to have a real-valued data type.
615+
Input array, expected to have a boolean or real-valued data type.
616616
out : {None, dpnp.ndarray, usm_ndarray}, optional
617617
Output array to populate.
618618
Array must have the correct shape and the expected data type.
@@ -792,6 +792,7 @@ def clip(a, /, min=None, max=None, *, out=None, order="K", **kwargs):
792792

793793
conj = conjugate
794794

795+
795796
_COPYSIGN_DOCSTRING = """
796797
Composes a floating-point value with the magnitude of `x1_i` and the sign of
797798
`x2_i` for each element of input arrays `x1` and `x2`.
@@ -1718,7 +1719,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
17181719
Parameters
17191720
----------
17201721
x : {dpnp.ndarray, usm_ndarray}
1721-
Input array, expected to have a real-valued data type.
1722+
Input array, expected to have a boolean or real-valued data type.
17221723
out : {None, dpnp.ndarray, usm_ndarray}, optional
17231724
Output array to populate.
17241725
Array must have the correct shape and the expected data type.
@@ -1879,7 +1880,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
18791880
Parameters
18801881
----------
18811882
x : {dpnp.ndarray, usm_ndarray}
1882-
Input array, expected to have a real-valued data type.
1883+
Input array, expected to have a boolean or real-valued data type.
18831884
out : {None, dpnp.ndarray, usm_ndarray}, optional
18841885
Output array to populate.
18851886
Array must have the correct shape and the expected data type.
@@ -4731,7 +4732,7 @@ def trapezoid(y, x=None, dx=1.0, axis=-1):
47314732
Parameters
47324733
----------
47334734
x : {dpnp.ndarray, usm_ndarray}
4734-
Input array, expected to have a real-valued data type.
4735+
Input array, expected to have a boolean or real-valued data type.
47354736
out : {None, dpnp.ndarray, usm_ndarray}, optional
47364737
Output array to populate.
47374738
Array must have the correct shape and the expected data type.

dpnp/dpnp_utils/dpnp_utils_einsum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def dpnp_einsum(
10341034
)
10351035
arrays.append(operands[id])
10361036
result_dtype = dpnp.result_type(*arrays) if dtype is None else dtype
1037-
if order in "aA":
1037+
if order is not None and order in "aA":
10381038
order = "F" if all(arr.flags.fnc for arr in arrays) else "C"
10391039

10401040
input_subscripts = [

dpnp/tests/test_linalg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,10 @@ def test_output_order(self):
16471647
assert tmp.flags.c_contiguous is False
16481648
assert tmp.flags.f_contiguous is False
16491649

1650+
tmp = dpnp.einsum("...ft,mf->...mt", a, b, order=None, optimize=opt)
1651+
assert tmp.flags.c_contiguous is False
1652+
assert tmp.flags.f_contiguous is False
1653+
16501654
tmp = dpnp.einsum("...ft,mf->...mt", a, b, optimize=opt)
16511655
assert tmp.flags.c_contiguous is False
16521656
assert tmp.flags.f_contiguous is False

dpnp/tests/test_mathematical.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,20 +2315,11 @@ def test_out(self, func, dt_in, dt_out):
23152315
if dt_in != dt_out:
23162316
if numpy.can_cast(dt_in, dt_out, casting="same_kind"):
23172317
# NumPy allows "same_kind" casting, dpnp does not
2318-
if func != "fix" and dt_in == dpnp.bool and dt_out == dpnp.int8:
2319-
# TODO: get rid of w/a when dpctl#2030 is fixed
2320-
pass
2321-
else:
2322-
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
2318+
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
23232319
else:
23242320
assert_raises(ValueError, getattr(dpnp, func), ia, out=iout)
23252321
assert_raises(TypeError, getattr(numpy, func), a, out=out)
23262322
else:
2327-
if func != "fix" and dt_in == dpnp.bool:
2328-
# TODO: get rid of w/a when dpctl#2030 is fixed
2329-
out = out.astype(numpy.int8)
2330-
iout = iout.astype(dpnp.int8)
2331-
23322323
expected = getattr(numpy, func)(a, out=out)
23332324
result = getattr(dpnp, func)(ia, out=iout)
23342325
assert result is iout
@@ -2354,11 +2345,6 @@ def test_out_usm_ndarray(self, func, dt):
23542345
out = numpy.empty(a.shape, dtype=dt)
23552346
ia, usm_out = dpnp.array(a), dpt.asarray(out)
23562347

2357-
if func != "fix" and dt == dpnp.bool:
2358-
# TODO: get rid of w/a when dpctl#2030 is fixed
2359-
out = out.astype(numpy.int8)
2360-
usm_out = dpt.asarray(usm_out, dtype=dpnp.int8)
2361-
23622348
expected = getattr(numpy, func)(a, out=out)
23632349
result = getattr(dpnp, func)(ia, out=usm_out)
23642350
assert result.get_array() is usm_out

dpnp/tests/test_umath.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ def test_umaths(test_cases):
108108
and is_gpu_device()
109109
):
110110
pytest.skip("dpctl-1652")
111-
elif umath in ["ceil", "floor", "trunc"] and args[0].dtype == dpnp.bool:
112-
pytest.skip("dpctl-2030")
113111
elif (
114112
umath == "tan"
115113
and dpnp.issubdtype(args[0].dtype, dpnp.complexfloating)

dpnp/tests/third_party/cupy/core_tests/test_ndarray_adv_indexing.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -609,14 +609,22 @@ def test_invalid_adv_getitem(self):
609609
},
610610
{"shape": (2, 3, 4), "indexes": (slice(None), []), "value": 1},
611611
{"shape": (2, 3, 4), "indexes": ([], []), "value": 1},
612-
# {'shape': (2, 3, 4), 'indexes': numpy.array([], dtype=numpy.bool_),
613-
# 'value': 1}, #dpctl-1913
614-
# {'shape': (2, 3, 4),
615-
# 'indexes': (slice(None), numpy.array([], dtype=numpy.bool_)),
616-
# 'value': 1}, #dpctl-1913
617-
# {'shape': (2, 3, 4), 'indexes': numpy.array([[], []], dtype=numpy.bool_),
618-
# 'value': numpy.random.uniform(size=(4,))}, #dpctl-1913
619-
# {'shape': (2, 3, 4), 'indexes': numpy.empty((0, 0, 4), bool), 'value': 1}, #dpctl-1913
612+
{
613+
"shape": (2, 3, 4),
614+
"indexes": numpy.array([], dtype=numpy.bool_),
615+
"value": 1,
616+
},
617+
{
618+
"shape": (2, 3, 4),
619+
"indexes": (slice(None), numpy.array([], dtype=numpy.bool_)),
620+
"value": 1,
621+
},
622+
{
623+
"shape": (2, 3, 4),
624+
"indexes": numpy.array([[], []], dtype=numpy.bool_),
625+
"value": numpy.random.uniform(size=(4,)),
626+
},
627+
{"shape": (2, 3, 4), "indexes": numpy.empty((0, 0, 4), bool), "value": 1},
620628
# multiple masks
621629
{"shape": (2, 3, 4), "indexes": (True, [True, False]), "value": 1},
622630
{"shape": (2, 3, 4), "indexes": (False, [True, False]), "value": 1},

environments/build_conda_pkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.12 # conda-build does not support python 3.13
6-
- conda-build=25.3.1
6+
- conda-build=25.3.2

environments/dpctl_pkg.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--index-url https://pypi.anaconda.org/dppy/label/dev/simple
2+
dpctl>=0.20.0dev0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ def _get_cmdclass():
8484
},
8585
include_package_data=False,
8686
python_requires=">=3.9,<3.14",
87-
install_requires=["dpctl >= 0.19.0dev0", "numpy"],
87+
install_requires=["dpctl >= 0.20.0dev0", "numpy"],
8888
)

0 commit comments

Comments
 (0)