Skip to content

Commit 7a32a0a

Browse files
authored
Update oneAPI dependencies (#1581) (#1605)
1 parent 2f0d2db commit 7a32a0a

File tree

8 files changed

+43
-61
lines changed

8 files changed

+43
-61
lines changed

.ci/pipeline/build-and-test-lnx.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ steps:
2424
displayName: "System info"
2525
- script: |
2626
conda update -y -q conda
27-
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.14 "; else export DPCPP_PACKAGE=""; fi
28-
conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) dal-devel mpich pyyaml $DPCPP_PACKAGE dpcpp-cpp-rt>=2023.2.0
27+
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.15 "; else export DPCPP_PACKAGE=""; fi
28+
conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) intel::dal-devel mpich pyyaml $DPCPP_PACKAGE "dpcpp-cpp-rt>=2024.0.0"
2929
displayName: "Conda create"
3030
- script: |
3131
. /usr/share/miniconda/etc/profile.d/conda.sh
@@ -47,7 +47,7 @@ steps:
4747
bash .ci/scripts/setup_sklearn.sh $(SKLEARN_VERSION)
4848
pip install --upgrade -r requirements-test.txt
4949
pip install $(python .ci/scripts/get_compatible_scipy_version.py)
50-
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
50+
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
5151
pip list
5252
displayName: "Install testing requirements"
5353
- script: |

.ci/pipeline/build-and-test-win.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
steps:
1717
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
1818
displayName: Add conda to PATH
19-
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) dal-devel impi-devel clang-format pyyaml
19+
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) intel::dal-devel impi-devel clang-format pyyaml
2020
displayName: 'Create Anaconda environment'
2121
- script: |
2222
call activate CB

.ci/scripts/install_dpcpp.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
2121
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
2222
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
2323
sudo apt-get update
24-
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
24+
sudo apt-get install -y intel-dpcpp-cpp-compiler-2024.0
2525
sudo bash -c 'echo libintelocl.so > /etc/OpenCL/vendors/intel-cpu.icd'
26-
sudo mv -f /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga_

gen.py

-51
This file was deleted.

generator/gen_daal4py.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
import re
2828
import shutil
2929
from collections import OrderedDict, defaultdict
30+
from os.path import isdir
3031
from os.path import join as jp
3132
from shutil import copytree, rmtree
3233
from subprocess import call
34+
from sys import platform
3335

3436
from .format import mk_var
3537
from .parse import parse_header, parse_version
@@ -1196,7 +1198,15 @@ def gen_daal4py(dalroot, outdir, version, warn_all=False, no_dist=False, no_stre
11961198
global no_warn
11971199
if warn_all:
11981200
no_warn = {}
1199-
orig_path = jp(dalroot, "include")
1201+
orig_path_candidates = [
1202+
jp(dalroot, "include", "dal"),
1203+
jp(dalroot, "Library", "include", "dal"),
1204+
jp(dalroot, "include"),
1205+
]
1206+
for candidate in orig_path_candidates:
1207+
if isdir(candidate):
1208+
orig_path = candidate
1209+
break
12001210
assert os.path.isfile(jp(orig_path, "algorithms", "algorithm.h")) and os.path.isfile(
12011211
jp(orig_path, "algorithms", "model.h")
12021212
), (

scripts/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ set(EXTERNAL_INCLUDE_DIRECTORIES
171171
${NUMPY_INCLUDE_DIRS}
172172
)
173173

174+
# TODO: remove this workaround when oneDAL CMake config is fixed
175+
if(WIN32)
176+
list(APPEND EXTERNAL_INCLUDE_DIRECTORIES $ENV{DALROOT}/Library/include/dal $ENV{DALROOT}/include/dal)
177+
else()
178+
list(APPEND EXTERNAL_INCLUDE_DIRECTORIES ${oneDAL_INCLUDE_DIRS}/dal)
179+
endif()
180+
174181
set(EXTERNAL_LINK_DIRECTORIES ${PYTHON_LIBRARY_DIR} ${oneDAL_LIBRARY_DIR})
175182
set(EXTERNAL_LINK_LIBRARIES ${ONEDAL_LIBRARIES})
176183

scripts/version.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
# ===============================================================================
1717

1818
import re
19+
from os.path import isfile
1920
from os.path import join as jp
21+
from sys import platform
2022

2123

2224
def find_defines(defines: list, file_obj):
@@ -36,9 +38,17 @@ def get_onedal_version(dal_root, version_type="release"):
3638
if version_type not in ["release", "binary"]:
3739
raise ValueError(f'Incorrect version type "{version_type}"')
3840

39-
header_version = jp(dal_root, "include", "services", "library_version_info.h")
40-
version = ""
41+
header_candidates = [
42+
jp(dal_root, "include", "dal", "services", "library_version_info.h"),
43+
jp(dal_root, "Library", "include", "dal", "services", "library_version_info.h"),
44+
jp(dal_root, "include", "services", "library_version_info.h"),
45+
]
46+
for candidate in header_candidates:
47+
if isfile(candidate):
48+
header_version = candidate
49+
break
4150

51+
version = ""
4252
with open(header_version, "r") as header:
4353
if version_type == "release":
4454
version = find_defines(

setup.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,15 @@ def get_build_options():
249249
include_dir_plat = [
250250
os.path.abspath("./src"),
251251
os.path.abspath("."),
252-
dal_root + "/include",
253252
]
253+
include_dir_candidates = [
254+
jp(dal_root, "include"),
255+
jp(dal_root, "include", "dal"),
256+
jp(dal_root, "Library", "include", "dal"),
257+
]
258+
for candidate in include_dir_candidates:
259+
if os.path.isdir(candidate):
260+
include_dir_plat.append(candidate)
254261
# FIXME it is a wrong place for this dependency
255262
if not no_dist:
256263
include_dir_plat.append(mpi_root + "/include")

0 commit comments

Comments
 (0)