Skip to content

Commit

Permalink
Require dpcpp compiler 2024.0 and runtime >=2024.0 (#1625)
Browse files Browse the repository at this point in the history
* Require dpcpp compiler 2024.0 and runtime >=2024.0

* fix build error

* Pinned compiler and dpctl versions

* Rolled back to intel channel for conda build

* Power is properly working for complex types with latest dpctl

* Keep backward compatibility with dpctl 0.15.0

* Install dpctl version compatible with DPC++ 2023.2 while collecting coverage

---------

Co-authored-by: Anton Volkov <antonwolfy@gmail.com>
Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 5bcf910 commit 525116a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Install dpnp dependencies
run: |
conda install numpy"<1.24" dpctl">=0.15.0" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
conda install numpy"<1.24" dpctl">=0.15.1dev2" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
- name: Install cuPy dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

env:
python-ver: '3.10'
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
CHANNELS: '-c dppy/label/coverage -c intel -c conda-forge --override-channels'

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
# use DPC++ compiler 2023.2 to work around an issue with crash
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
dpctl">=0.15.1dev2" dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
Expand Down
11 changes: 7 additions & 4 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{% set required_compiler_and_mkl_version = "2024.0" %}
{% set required_dpctl_version = "0.15.1dev2" %}

package:
name: dpnp
version: {{ GIT_DESCRIBE_TAG }}
Expand All @@ -13,19 +16,19 @@ requirements:
- cmake >=3.21
- ninja
- git
- dpctl >=0.15.0
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.2.0') }}
- dpctl >={{ required_dpctl_version }}
- mkl-devel-dpcpp >={{ required_compiler_and_mkl_version }}
- onedpl-devel
- tbb-devel
- wheel
- scikit-build
build:
- {{ compiler('cxx') }}
- {{ compiler('dpcpp') }} >=2023.2.0 # [not osx]
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }} # [not osx]
- sysroot_linux-64 >=2.28 # [linux]
run:
- python
- dpctl >=0.15.0
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin=None) }}
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
Expand Down
12 changes: 6 additions & 6 deletions tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1876,13 +1876,13 @@ def test_complex_values(self):
dp_arr = dpnp.array(np_arr)
func = lambda x: x**2

# Linux: ((inf + 0j) ** 2) == (Inf + NaNj) in dpnp and == (NaN + NaNj) in numpy
# Win: ((inf + 0j) ** 2) == (Inf + 0j) in dpnp and == (Inf + NaNj) in numpy
# TODO: unmute the test once it's available
if is_win_platform():
assert_equal(func(dp_arr)[5], numpy.inf)
else:
assert_equal(func(dp_arr)[5], (numpy.inf + 0j) * 1)
assert_allclose(func(np_arr)[:5], func(dp_arr).asnumpy()[:5], rtol=1e-6)
pytest.skip(
"Until the latest dpctl is available on internal channel"
)

assert_dtype_allclose(func(dp_arr), func(np_arr))

@pytest.mark.parametrize("val", [0, 1], ids=["0", "1"])
@pytest.mark.parametrize("dtype", [dpnp.int32, dpnp.int64])
Expand Down

0 comments on commit 525116a

Please sign in to comment.