Skip to content

Commit cc8cb2c

Browse files
committed
Install dpctl version compatible with DPC++ 2023.2 while collecting coverage
1 parent 9f7eabb commit cc8cb2c

File tree

4 files changed

+13
-82
lines changed

4 files changed

+13
-82
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Install dpnp dependencies
9393
run: |
94-
conda install numpy"<1.24" dpctl">=0.15.1dev1" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
94+
conda install numpy"<1.24" dpctl">=0.15.1dev2" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
9595
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
9696
9797
- name: Install cuPy dependencies

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 2 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
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
# use DPC++ compiler 2023.2 to work around an issue with crash
4646
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
47-
dpctl dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
47+
dpctl">=0.15.1dev2" dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
4848
onedpl-devel ${{ env.CHANNELS }}
4949
5050
- name: Conda info

conda-recipe/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set required_compiler_and_mkl_version = "2024.0" %}
2-
{% set required_dpctl_version = "0.15.1dev1" %}
2+
{% set required_dpctl_version = "0.15.1dev2" %}
33

44
package:
55
name: dpnp
@@ -28,9 +28,9 @@ requirements:
2828
- sysroot_linux-64 >=2.28 # [linux]
2929
run:
3030
- python
31-
- dpctl >={{ required_dpctl_version }}
32-
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x') }}
33-
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x') }}
31+
- {{ pin_compatible('dpctl', min_pin='x.x.x', upper_bound=None) }}
32+
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
33+
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
3434
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
3535

3636
build:

dpnp/dpnp_algo/dpnp_elementwise_common.py

Lines changed: 6 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -167,80 +167,11 @@ def check_nd_call_func(
167167
)
168168

169169

170-
"""
171-
Below utility functions are required to keep backward compitibility
172-
with DPC++ 2023.2 and dpctl 0.15.0. Otherwise we can't collect coverage report,
173-
since DPC++ 2024.0 has the reported crash issue while running for coverage
174-
and the latest dpctl (i.e. >0.15.0) can't be installed with DPC++ 2023.2.
175-
176-
TODO: remove the w/a once the above issue is resolved.
177-
"""
178-
179-
180-
def _get_impl_fn(dpt_fn):
181-
if hasattr(dpt_fn, "get_implementation_function"):
182-
return dpt_fn.get_implementation_function()
183-
184-
if hasattr(dpt_fn, "__name__"):
185-
if dpt_fn.__name__ == "UnaryElementwiseFunc":
186-
return dpt_fn.unary_fn_
187-
elif dpt_fn.__name__ == "BinaryElementwiseFunc":
188-
return dpt_fn.binary_fn_
189-
190-
raise TypeError(
191-
"Expected an instance of elementwise func class, but got {}".format(
192-
type(dpt_fn)
193-
)
194-
)
195-
196-
197-
def _get_type_resolver_fn(dpt_fn):
198-
if hasattr(dpt_fn, "get_type_result_resolver_function"):
199-
return dpt_fn.get_type_result_resolver_function()
200-
201-
if hasattr(dpt_fn, "result_type_resolver_fn_"):
202-
return dpt_fn.result_type_resolver_fn_
203-
204-
raise TypeError(
205-
"Expected an instance of elementwise func class, but got {}".format(
206-
type(dpt_fn)
207-
)
208-
)
209-
210-
211-
def _get_impl_inplace_fn(dpt_fn):
212-
if hasattr(dpt_fn, "get_implementation_inplace_function"):
213-
return dpt_fn.get_implementation_inplace_function()
214-
215-
if hasattr(dpt_fn, "binary_inplace_fn_"):
216-
return dpt_fn.binary_inplace_fn_
217-
218-
raise TypeError(
219-
"Expected an instance of elementwise func class, but got {}".format(
220-
type(dpt_fn)
221-
)
222-
)
223-
224-
225-
def _get_type_promotion_fn(dpt_fn):
226-
if hasattr(dpt_fn, "get_type_promotion_path_acceptance_function"):
227-
return dpt_fn.get_type_promotion_path_acceptance_function()
228-
229-
if hasattr(dpt_fn, "acceptance_fn_"):
230-
return dpt_fn.acceptance_fn_
231-
232-
raise TypeError(
233-
"Expected an instance of elementwise func class, but got {}".format(
234-
type(dpt_fn)
235-
)
236-
)
237-
238-
239170
def _make_unary_func(
240171
name, dpt_unary_fn, fn_docstring, mkl_fn_to_call=None, mkl_impl_fn=None
241172
):
242-
impl_fn = _get_impl_fn(dpt_unary_fn)
243-
type_resolver_fn = _get_type_resolver_fn(dpt_unary_fn)
173+
impl_fn = dpt_unary_fn.get_implementation_function()
174+
type_resolver_fn = dpt_unary_fn.get_type_result_resolver_function()
244175

245176
def _call_func(src, dst, sycl_queue, depends=None):
246177
"""A callback to register in UnaryElementwiseFunc class of dpctl.tensor"""
@@ -262,10 +193,10 @@ def _call_func(src, dst, sycl_queue, depends=None):
262193
def _make_binary_func(
263194
name, dpt_binary_fn, fn_docstring, mkl_fn_to_call=None, mkl_impl_fn=None
264195
):
265-
impl_fn = _get_impl_fn(dpt_binary_fn)
266-
type_resolver_fn = _get_type_resolver_fn(dpt_binary_fn)
267-
inplce_fn = _get_impl_inplace_fn(dpt_binary_fn)
268-
acceptance_fn = _get_type_promotion_fn(dpt_binary_fn)
196+
impl_fn = dpt_binary_fn.get_implementation_function()
197+
type_resolver_fn = dpt_binary_fn.get_type_result_resolver_function()
198+
inplce_fn = dpt_binary_fn.get_implementation_inplace_function()
199+
acceptance_fn = dpt_binary_fn.get_type_promotion_path_acceptance_function()
269200

270201
def _call_func(src1, src2, dst, sycl_queue, depends=None):
271202
"""A callback to register in UnaryElementwiseFunc class of dpctl.tensor"""

0 commit comments

Comments
 (0)