Skip to content

Commit

Permalink
Update oneAPI dependencies (#1581) (#1605)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 8, 2023
1 parent 2f0d2db commit 7a32a0a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .ci/pipeline/build-and-test-lnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ steps:
displayName: "System info"
- script: |
conda update -y -q conda
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.14 "; else export DPCPP_PACKAGE=""; fi
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
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then export DPCPP_PACKAGE="dpctl>=0.15 "; else export DPCPP_PACKAGE=""; fi
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"
displayName: "Conda create"
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
Expand All @@ -47,7 +47,7 @@ steps:
bash .ci/scripts/setup_sklearn.sh $(SKLEARN_VERSION)
pip install --upgrade -r requirements-test.txt
pip install $(python .ci/scripts/get_compatible_scipy_version.py)
if [ $(echo $(PYTHON_VERSION) | grep '3.8\|3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.10') ]; then conda install -q -y -c intel dpnp; fi
pip list
displayName: "Install testing requirements"
- script: |
Expand Down
2 changes: 1 addition & 1 deletion .ci/pipeline/build-and-test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) dal-devel impi-devel clang-format pyyaml
- script: conda create -q -y -n CB -c conda-forge -c intel python=$(PYTHON_VERSION) intel::dal-devel impi-devel clang-format pyyaml
displayName: 'Create Anaconda environment'
- script: |
call activate CB
Expand Down
3 changes: 1 addition & 2 deletions .ci/scripts/install_dpcpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1
sudo apt-get install -y intel-dpcpp-cpp-compiler-2024.0
sudo bash -c 'echo libintelocl.so > /etc/OpenCL/vendors/intel-cpu.icd'
sudo mv -f /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga /opt/intel/oneapi/compiler/latest/linux/lib/oclfpga_
51 changes: 0 additions & 51 deletions gen.py

This file was deleted.

12 changes: 11 additions & 1 deletion generator/gen_daal4py.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import re
import shutil
from collections import OrderedDict, defaultdict
from os.path import isdir
from os.path import join as jp
from shutil import copytree, rmtree
from subprocess import call
from sys import platform

from .format import mk_var
from .parse import parse_header, parse_version
Expand Down Expand Up @@ -1196,7 +1198,15 @@ def gen_daal4py(dalroot, outdir, version, warn_all=False, no_dist=False, no_stre
global no_warn
if warn_all:
no_warn = {}
orig_path = jp(dalroot, "include")
orig_path_candidates = [
jp(dalroot, "include", "dal"),
jp(dalroot, "Library", "include", "dal"),
jp(dalroot, "include"),
]
for candidate in orig_path_candidates:
if isdir(candidate):
orig_path = candidate
break
assert os.path.isfile(jp(orig_path, "algorithms", "algorithm.h")) and os.path.isfile(
jp(orig_path, "algorithms", "model.h")
), (
Expand Down
7 changes: 7 additions & 0 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ set(EXTERNAL_INCLUDE_DIRECTORIES
${NUMPY_INCLUDE_DIRS}
)

# TODO: remove this workaround when oneDAL CMake config is fixed
if(WIN32)
list(APPEND EXTERNAL_INCLUDE_DIRECTORIES $ENV{DALROOT}/Library/include/dal $ENV{DALROOT}/include/dal)
else()
list(APPEND EXTERNAL_INCLUDE_DIRECTORIES ${oneDAL_INCLUDE_DIRS}/dal)
endif()

set(EXTERNAL_LINK_DIRECTORIES ${PYTHON_LIBRARY_DIR} ${oneDAL_LIBRARY_DIR})
set(EXTERNAL_LINK_LIBRARIES ${ONEDAL_LIBRARIES})

Expand Down
14 changes: 12 additions & 2 deletions scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
# ===============================================================================

import re
from os.path import isfile
from os.path import join as jp
from sys import platform


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

header_version = jp(dal_root, "include", "services", "library_version_info.h")
version = ""
header_candidates = [
jp(dal_root, "include", "dal", "services", "library_version_info.h"),
jp(dal_root, "Library", "include", "dal", "services", "library_version_info.h"),
jp(dal_root, "include", "services", "library_version_info.h"),
]
for candidate in header_candidates:
if isfile(candidate):
header_version = candidate
break

version = ""
with open(header_version, "r") as header:
if version_type == "release":
version = find_defines(
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,15 @@ def get_build_options():
include_dir_plat = [
os.path.abspath("./src"),
os.path.abspath("."),
dal_root + "/include",
]
include_dir_candidates = [
jp(dal_root, "include"),
jp(dal_root, "include", "dal"),
jp(dal_root, "Library", "include", "dal"),
]
for candidate in include_dir_candidates:
if os.path.isdir(candidate):
include_dir_plat.append(candidate)
# FIXME it is a wrong place for this dependency
if not no_dist:
include_dir_plat.append(mpi_root + "/include")
Expand Down

0 comments on commit 7a32a0a

Please sign in to comment.