Skip to content

Commit f46c6f2

Browse files
feature: oneMKL migration (#2865) (#2919)
1 parent 56cf01b commit f46c6f2

File tree

77 files changed

+1376
-3307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1376
-3307
lines changed

.ci/env/apt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function install_dpcpp {
3737
}
3838

3939
function install_mkl {
40-
sudo apt-get install intel-oneapi-mkl-devel
40+
sudo apt-get install -y intel-oneapi-mkl-devel=2024.2.1-103
4141
}
4242

4343
function install_clang-format {

.ci/pipeline/ci.yml

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ variables:
2828
TBB_VERSION : 'v2021.10.0'
2929
VM_IMAGE : 'ubuntu-22.04'
3030
SYSROOT_OS: 'jammy'
31+
WIN_BASEKIT_VERSION: '2024.2.1.101'
32+
WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_$(WIN_BASEKIT_VERSION)_offline.exe'
33+
WINDOWS_DPCPP_COMPONENTS: 'intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.tbb.devel'
3134

3235
jobs:
3336
- job: 'FormatterChecks'
@@ -58,6 +61,9 @@ jobs:
5861
- script: |
5962
.ci/env/apt.sh dev-base
6063
displayName: 'apt-get and conda install'
64+
- script: |
65+
.ci/env/apt.sh mkl
66+
displayName: 'mkl installation'
6167
- script: |
6268
.ci/scripts/describe_system.sh
6369
displayName: 'System info'
@@ -415,6 +421,9 @@ jobs:
415421
- script: |
416422
.ci/env/apt.sh dpcpp
417423
displayName: 'dpcpp installation'
424+
- script: |
425+
.ci/env/apt.sh mkl
426+
displayName: 'mkl installation'
418427
- script: |
419428
source /opt/intel/oneapi/compiler/latest/env/vars.sh
420429
.ci/scripts/describe_system.sh
@@ -435,14 +444,17 @@ jobs:
435444
continueOnError: true
436445
- script: |
437446
source /opt/intel/oneapi/compiler/latest/env/vars.sh
447+
source /opt/intel/oneapi/mkl/latest/env/vars.sh
438448
.ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake
439449
displayName: 'daal/cpp examples'
440450
- script: |
441451
source /opt/intel/oneapi/compiler/latest/env/vars.sh
452+
source /opt/intel/oneapi/mkl/latest/env/vars.sh
442453
.ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake
443454
displayName: 'oneapi/cpp examples'
444455
- script: |
445456
source /opt/intel/oneapi/compiler/latest/env/vars.sh
457+
source /opt/intel/oneapi/mkl/latest/env/vars.sh
446458
.ci/scripts/test.sh --test-kind samples --build-dir $(release.dir) --compiler gnu --interface daal/cpp/mpi --conda-env ci-env --build-system cmake
447459
displayName: 'daal/cpp/mpi samples'
448460
- task: PublishPipelineArtifact@1
@@ -520,12 +532,15 @@ jobs:
520532
--test_thread_mode=par
521533
displayName: 'cpp-examples-thread-release-static'
522534
523-
- script: |
524-
export DALROOT=`pwd`/bazel-bin/release/daal/latest
525-
bazel test //examples/oneapi/cpp:all \
526-
--test_link_mode=release_dynamic \
527-
--test_thread_mode=par
528-
displayName: 'cpp-examples-thread-release-dynamic'
535+
# The issue that bazel doesnt link MKL libs via -Wl, --start-group..
536+
# oneDAL make build pass this test
537+
# TODO: add cycle linking in bazel
538+
# - script: |
539+
# export DALROOT=`pwd`/bazel-bin/release/daal/latest
540+
# bazel test //examples/oneapi/cpp:all \
541+
# --test_link_mode=release_dynamic \
542+
# --test_thread_mode=par
543+
# displayName: 'cpp-examples-thread-release-dynamic'
529544

530545
- script: |
531546
bazel test //cpp/daal:tests
@@ -645,57 +660,6 @@ jobs:
645660
displayName: 'Upload conformance tests artifacts'
646661
continueOnError: true
647662

648-
- job: 'macOSMakeClang'
649-
timeoutInMinutes: 0
650-
variables:
651-
release.dir: '__release_mac_clang'
652-
platform.type : 'mac32e'
653-
pool:
654-
vmImage: 'macos-12'
655-
steps:
656-
- script: |
657-
brew install dos2unix tree
658-
conda create -n ci-env -q -y -c conda-forge python=3.10
659-
source /usr/local/miniconda/etc/profile.d/conda.sh
660-
conda activate ci-env
661-
pip install -q cpufeature
662-
displayName: 'brew and conda install'
663-
- script: |
664-
source /usr/local/miniconda/etc/profile.d/conda.sh
665-
conda activate ci-env
666-
.ci/scripts/describe_system.sh
667-
displayName: 'System info'
668-
- script: |
669-
.ci/scripts/build.sh --compiler clang --target daal --optimizations "sse2 avx2" --conda-env ci-env
670-
displayName: 'make daal'
671-
- script: |
672-
.ci/scripts/build.sh --compiler clang --target onedal_c --optimizations "sse2 avx2"
673-
displayName: 'make onedal_c'
674-
- task: PublishPipelineArtifact@1
675-
inputs:
676-
artifactName: '$(platform.type) build'
677-
targetPath: '$(Build.Repository.LocalPath)/$(release.dir)'
678-
displayName: 'Upload build artifacts'
679-
continueOnError: true
680-
- script: |
681-
.ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface daal/cpp --build-system cmake
682-
displayName: 'daal/cpp examples'
683-
- script: |
684-
.ci/scripts/test.sh --test-kind examples --build-dir $(release.dir) --compiler clang --interface oneapi/cpp --build-system cmake
685-
displayName: 'oneapi/cpp examples'
686-
- script: |
687-
deploy/nuget/prepare_dal_nuget.sh --release-dir $(release.dir) --build-nupkg yes
688-
tree -h -I include __nuget/inteldal*/
689-
ls -lh __nuget/inteldal*.nupkg
690-
displayName: 'nuget pkg'
691-
- task: PublishPipelineArtifact@1
692-
inputs:
693-
artifactName: '$(platform.type) fail'
694-
targetPath: '$(Build.Repository.LocalPath)/$(release.dir)'
695-
displayName: 'Uploading on fail'
696-
condition: failed()
697-
continueOnError: true
698-
699663
- job: 'WindowsMakeVC'
700664
timeoutInMinutes: 0
701665
variables:
@@ -704,6 +668,8 @@ jobs:
704668
pool:
705669
vmImage: 'windows-2022'
706670
steps:
671+
- script: .ci/scripts/install_windows.bat $(WINDOWS_BASEKIT_URL) $(WINDOWS_DPCPP_COMPONENTS)
672+
displayName: Install oneAPI Base Toolkit
707673
- script: |
708674
set PATH=C:\msys64\usr\bin;%PATH%
709675
pip install cpufeature
@@ -714,9 +680,13 @@ jobs:
714680
bash .ci/scripts/describe_system.sh
715681
displayName: 'System info'
716682
- script: |
683+
call C:\temp\oneapi\setvars.bat --force
684+
set MKL_FPK_GPU_VERSION_LINE=2024.0.0
717685
.\.ci\scripts\build.bat daal vc avx2
718686
displayName: 'make daal'
719687
- script: |
688+
call C:\temp\oneapi\setvars.bat --force
689+
set MKL_FPK_GPU_VERSION_LINE=2024.0.0
720690
.\.ci\scripts\build.bat onedal_c vc avx2
721691
displayName: 'make onedal_c'
722692
- task: PublishPipelineArtifact@1
@@ -726,10 +696,12 @@ jobs:
726696
displayName: 'Upload build artifacts'
727697
continueOnError: true
728698
- script: |
699+
call C:\temp\oneapi\setvars.bat --force
729700
.\.ci\scripts\test.bat daal\cpp lib msvs cmake
730701
.\.ci\scripts\test.bat daal\cpp dll msvs cmake
731702
displayName: 'daal/cpp examples'
732703
- script: |
704+
call C:\temp\oneapi\setvars.bat --force
733705
.\.ci\scripts\test.bat oneapi\cpp lib msvs cmake
734706
.\.ci\scripts\test.bat oneapi\cpp dll msvs cmake
735707
displayName: 'oneapi/cpp examples'

.ci/scripts/build.bat

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ set PATH=C:\msys64\usr\bin;%PATH%
2828
echo pacman -S --noconfirm msys/make msys/dos2unix
2929
pacman -S --noconfirm msys/make msys/dos2unix
3030

31-
echo call .ci\env\tbb.bat
32-
if "%TBBROOT%"=="" if not exist .\__deps\tbb\win\tbb call .ci\env\tbb.bat || set errorcode=1
33-
34-
echo call .\dev\download_micromkl.bat
35-
if "%MKLGPUFPKROOT%"=="" if not exist .\__deps\mklgpufpk\win call .\dev\download_micromkl.bat || set errorcode=1
36-
37-
echo call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall" x64
38-
if "%VISUALSTUDIOVERSION%"=="" call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall" x64 || set errorcode=1
31+
IF "%VS_VER%"=="2017_build_tools" (
32+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
33+
echo "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
34+
) ELSE (
35+
IF "%VS_VER%"=="2019_build_tools" (
36+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
37+
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
38+
) ELSE (
39+
@call "C:\temp\oneapi\setvars-vcvarsall.bat" %VS_VER%
40+
echo "C:\temp\oneapi\setvars-vcvarsall.bat" %VS_VER%
41+
)
42+
)
3943

4044
echo make %1 -j%NUMBER_OF_PROCESSORS% COMPILER=%2 PLAT=win32e REQCPU=%3
4145
make %1 -j%NUMBER_OF_PROCESSORS% COMPILER=%2 PLAT=win32e REQCPU=%3 || set errorcode=1

.ci/scripts/build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ fi
160160
#main actions
161161
echo "Call env scripts"
162162
if [ "${backend_config}" == "mkl" ]; then
163-
echo "Sourcing MKL env"
164-
"${ONEDAL_DIR}"/dev/download_micromkl.sh with_gpu="${with_gpu}"
163+
source /opt/intel/oneapi/mkl/latest/env/vars.sh
165164
elif [ "${backend_config}" == "ref" ] && [ ! -z "${BLAS_INSTALL_DIR}" ]; then
166165
export OPENBLASROOT="${BLAS_INSTALL_DIR}"
167166
elif [ "${backend_config}" == "ref" ]; then

.ci/scripts/install_windows.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
rem ============================================================================
3+
rem Copyright contributors to the oneDAL project
4+
rem
5+
rem Licensed under the Apache License, Version 2.0 (the "License");
6+
rem you may not use this file except in compliance with the License.
7+
rem You may obtain a copy of the License at
8+
rem
9+
rem http://www.apache.org/licenses/LICENSE-2.0
10+
rem
11+
rem Unless required by applicable law or agreed to in writing, software
12+
rem distributed under the License is distributed on an "AS IS" BASIS,
13+
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
rem See the License for the specific language governing permissions and
15+
rem limitations under the License.
16+
rem ============================================================================
17+
18+
set URL=%1
19+
set COMPONENTS=%2
20+
21+
curl.exe --output %TEMP%\webimage.exe --url %URL% --retry 5 --retry-delay 5
22+
start /b /wait %TEMP%\webimage.exe -s -x -f webimage_extracted --log extract.log
23+
del %TEMP%\webimage.exe
24+
if "%COMPONENTS%"=="" (
25+
webimage_extracted\bootstrapper.exe -s --action install --eula=accept --install-dir=C:\temp\oneapi\ -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
26+
) else (
27+
webimage_extracted\bootstrapper.exe -s --action install --components=%COMPONENTS% --eula=accept --install-dir=C:\temp\oneapi\ -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
28+
)
29+
set installer_exit_code=%ERRORLEVEL%
30+
rd /s/q "webimage_extracted"
31+
exit /b %installer_exit_code%

.ci/scripts/test.bat

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,20 @@ echo CPUCOUNT=%CPUCOUNT%
3434
echo PATH=C:\msys64\usr\bin;%PATH%
3535
set PATH=C:\msys64\usr\bin;%PATH%
3636

37-
echo call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall" x64
38-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall" x64 || set errorcode=1
37+
echo "%VISUALSTUDIOVERSION% HERE"
38+
39+
IF "%VS_VER%"=="2017_build_tools" (
40+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
41+
echo "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
42+
) ELSE (
43+
IF "%VS_VER%"=="2019_build_tools" (
44+
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
45+
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
46+
) ELSE (
47+
@call "C:\temp\oneapi\setvars-vcvarsall.bat" %VS_VER%
48+
echo "C:\temp\oneapi\setvars-vcvarsall.bat" %VS_VER%
49+
)
50+
)
3951

4052
echo call __release_win_vc\daal\latest\env\vars.bat
4153
call __release_win_vc\daal\latest\env\vars.bat || set errorcode=1

.github/workflows/nightly-build.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ on:
2424
permissions:
2525
contents: read
2626

27+
env:
28+
WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_2024.2.1.101_offline.exe'
29+
WINDOWS_ALL_COMPONENTS: 'intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.tbb.devel'
30+
2731
jobs:
2832
build_lnx:
2933
name: oneDAL Linux nightly build
@@ -38,6 +42,8 @@ jobs:
3842
repository: oneapi-src/oneDAL
3943
- name: Install DPC++
4044
run: .ci/env/apt.sh dpcpp
45+
- name: Install MKL
46+
run: .ci/env/apt.sh mkl
4147
- name: System Info
4248
run: |
4349
source /opt/intel/oneapi/compiler/latest/env/vars.sh
@@ -68,32 +74,34 @@ jobs:
6874
with:
6975
repository: oneapi-src/oneDAL
7076
- name: Install DPC++
77+
shell: cmd
7178
run: |
72-
& .ci/scripts/install_dpc.ps1
73-
- name: Prepare Intel OpenCL CPU runtime
74-
run: |
75-
# Store the unpacked runtime to centralize and reduce external downloads
76-
& .ci/scripts/collect_opencl_rt.ps1
79+
call .\.ci\scripts\install_windows.bat ${{ env.WINDOWS_BASEKIT_URL }} ${{ env.WINDOWS_ALL_COMPONENTS }}
7780
- name: System Info
7881
shell: cmd
7982
run: |
8083
set PATH=C:\msys64\usr\bin;%PATH%
8184
pip install cpufeature
82-
call .\dpcpp\compiler\latest\env\vars.bat
85+
call C:\temp\oneapi\setvars.bat
8386
bash .ci/scripts/describe_system.sh
8487
- name: Make daal
8588
shell: cmd
8689
run: |
90+
call C:\temp\oneapi\setvars.bat
91+
set MKL_FPK_GPU_VERSION_LINE=2024.0.0
8792
call .\.ci\scripts\build.bat daal vc avx2
8893
- name: Make onedal
8994
shell: cmd
9095
run: |
96+
call C:\temp\oneapi\setvars.bat
97+
set MKL_FPK_GPU_VERSION_LINE=2024.0.0
9198
call .\.ci\scripts\build.bat onedal_c vc avx2
9299
- name: Make oneapi_dpc
93100
shell: cmd
94101
run: |
95-
call .\dpcpp\compiler\latest\env\vars.bat
96-
call .\dpcpp\compiler\latest\bin\sycl-ls.exe
102+
call C:\temp\oneapi\setvars.bat
103+
set MKL_FPK_GPU_VERSION_LINE=2024.0.0
104+
call C:\temp\oneapi\compiler\latest\bin\sycl-ls.exe
97105
call .\.ci\scripts\build.bat onedal_dpc vc avx2
98106
- name: Archive build
99107
uses: actions/upload-artifact@v4
@@ -103,14 +111,9 @@ jobs:
103111
- name: Compress DPC++
104112
shell: cmd
105113
run: |
106-
tar -cvzf icx.zip .\dpcpp
114+
tar -cvzf icx.zip C:\temp\oneapi
107115
- name: Archive DPC++
108116
uses: actions/upload-artifact@v4
109117
with:
110118
name: icx_compiler
111119
path: .\icx.zip
112-
- name: Archive Intel OpenCL CPU runtime
113-
uses: actions/upload-artifact@v4
114-
with:
115-
name: opencl_rt_installer
116-
path: .\opencl_rt.msi

WORKSPACE

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@ opencl_repo(
2222
name = "opencl",
2323
)
2424

25-
load("@onedal//dev/bazel/deps:micromkl.bzl", "micromkl_repo", "micromkl_dpc_repo")
26-
micromkl_repo(
27-
name = "micromkl",
28-
root_env_var = "MKLFPKROOT",
29-
url = "https://github.com/oneapi-src/oneDAL/releases/download/Dependencies/mklfpk_lnx_20230413.tgz",
30-
sha256 = "e99dd6fb18f1fda382c53373262d1bb44c1b58aa6edff94cfb0e9d8dcd3395ed",
31-
)
32-
33-
micromkl_dpc_repo(
34-
name = "micromkl_dpc",
35-
root_env_var = "MKLGPUFPKROOT",
36-
url = "https://github.com/oneapi-src/oneDAL/releases/download/Dependencies/mklgpufpk_lnx_20240605.tgz",
37-
sha256 = "0787a92e9580ed6b9fb97d054a0ed77994dbc18b4b3fb099451cb1e6ebdf4f16",
38-
)
39-
4025
load("@onedal//dev/bazel/deps:openblas.bzl", "openblas_repo")
4126
openblas_repo(
4227
name = "openblas",
@@ -87,16 +72,23 @@ mkl_repo(
8772
name = "mkl",
8873
root_env_var = "MKLROOT",
8974
urls = [
75+
# TODO: when the issue with binutils will be solved, replace 2023.0 to 2024.2
9076
"https://files.pythonhosted.org/packages/76/8c/2e6fb6186fa9335a0feb7845e001e18c22627a06ae68650e5a84ca2b536d/mkl_static-2023.0.0-py2.py3-none-manylinux1_x86_64.whl",
91-
"https://files.pythonhosted.org/packages/cf/d1/ea2d769006337d968a89337dd1c3eb09c528f9ac629e8ab99324e1122f03/mkl_include-2023.0.0-py2.py3-none-manylinux1_x86_64.whl",
77+
#"https://files.pythonhosted.org/packages/c1/44/42ea3ad7bbaa65acb54c977961118d7b24ea687e7c3d64aba0a019cbfa19/mkl_static-2024.2.0-py2.py3-none-manylinux1_x86_64.whl",
78+
"https://files.pythonhosted.org/packages/80/e4/93ddfd475420f1c24d96f3bba1f87ec31a1eea847884c4ccb243cb336a61/mkl_include-2024.2.0-py2.py3-none-manylinux1_x86_64.whl",
79+
"https://files.pythonhosted.org/packages/c9/3a/8797ef320a04e0b939a07365f09ce11f5484150bd3600c6400391c5c36e9/mkl_devel_dpcpp-2024.2.0-py2.py3-none-manylinux1_x86_64.whl",
9280
],
9381
sha256s = [
9482
"49d16f315f6803b1046a4796686af766ad487f9f6d98ea76b6cdb2ebd5b559f9",
95-
"14b0958dff799378975d83fbd00ce756645aa36b9f924bdfdb0fb031f72b734d",
83+
#"8c2a6c6a144c5619f1df75fd550b32730f3e0632b55a15a42a95516e142ccf47",
84+
"63ed16ece64d9420e9fe1d5e1b55e0680632b61ad1c0e5f207b17f85233fcc09",
85+
"b80099209aef1b147b8f1c1621a47078fba2c17b2faee131939ea4d32da2c35c",
9686
],
9787
strip_prefixes = [
9888
"mkl_static-2023.0.0.data/data",
99-
"mkl_include-2023.0.0.data/data",
89+
#"mkl_static-2024.2.0.data/data",
90+
"mkl_include-2024.2.0.data/data",
91+
"mkl_devel_dpcpp-2024.2.0.data/data",
10092
],
10193
)
10294

0 commit comments

Comments
 (0)