This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Enable dynamic linking with MKL and compiler based OpenMP (#…
…20474) OneMKL 2021.3 fixed linking OpenMP while using SDL and MKL_THREADING_LAYER set to GNU. * Disabling SDL with MKL threading on Windows * Use multi-threading 'on' as the default option * Sets the interface layer for Intel oneAPI MKL at runtime * Clean up the apt cache * Moving mkl runtime initialization to the function * Cleaning MKL find_path cmake directories * [WIP] Adding github runner for MAC OS to check MKL specific changes This is a temporary change to check if adding MKL runtime support won't crash MacOS. * clang format + mkl workflow rename * Fixing some formatting + installing patchelf * setting up Mac OS rpath for MKL libraries * Run only mkl tests * Fix for finding MKL libraries on MacOs by FindBLAS.cmake Turn off SDL for MKL on MacOS as it need fixes. * Enable linking MxNET with MKL static libraries on MacOS Add proper mkl_threading flags for Mac Os. Enable all tests that are for MacOS + MKL tests. Rebuild numpy with MKL BLAS (instead of OpenBLAS). * Excluding MKL bf16 tests as CI MacOs machines seems not to have avx512 support.
- Loading branch information
Showing
14 changed files
with
308 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: mkl continuous build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
macosx-x86_64: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Compilation cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.ccache | ||
# We include the commit sha in the cache key, as new cache entries are | ||
# only created if there is no existing entry for the key yet. | ||
key: ${{ runner.os }}-ccache-${{ github.sha }} | ||
# Restore any ccache cache entry, if none for | ||
# ${{ runner.os }}-ccache-${{ github.sha }} exists | ||
restore-keys: | | ||
${{ runner.os }}-ccache | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.6' | ||
architecture: x64 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
brew install nasm automake ninja libtool cmake pkgconfig protobuf hdf5 zlib ccache | ||
ccache -M 500M # Limit the ccache size; Github's overall cache limit is 5GB | ||
python -m pip install -r ci/docker/install/requirements | ||
shell: bash | ||
|
||
- name: Build project | ||
run: | | ||
./tools/staticbuild/build.sh cpu mkl | ||
- name: Setup Python | ||
run: | | ||
python -m pip install --user -e python | ||
- name: Test project | ||
run: | | ||
python -m pytest -n 4 --durations=50 --verbose tests/python/unittest/ -k 'not test_operator and not (test_subgraph or test_custom_op or test_external_op or test_recordimage_dataset_with_data_loader_multiworker or test_multi_worker or test_multi_worker_shape or test_multi_worker_forked_data_loader or test_multi_worker_dataloader_release_pool)' -m 'not serial' | ||
MXNET_ENGINE_TYPE=NaiveEngine python -m pytest -n 4 --durations=50 --verbose tests/python/unittest/ -k 'test_operator and not (test_subgraph or test_custom_op or test_external_op or test_recordimage_dataset_with_data_loader_multiworker or test_multi_worker or test_multi_worker_shape or test_multi_worker_forked_data_loader or test_multi_worker_dataloader_release_pool)' -m 'not serial' | ||
python -m pytest --durations=50 --verbose tests/python/unittest/ -k 'not (test_subgraph or test_custom_op or test_external_op or test_recordimage_dataset_with_data_loader_multiworker or test_multi_worker or test_multi_worker_shape or test_multi_worker_forked_data_loader or test_multi_worker_dataloader_release_pool)' -m 'serial' | ||
python -m pytest -n 4 --durations=50 --verbose tests/python/mkl -k 'not test_bf16_operator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") | ||
set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") | ||
set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") | ||
|
||
set(USE_BLAS "mkl" CACHE STRING "BLAS Vendor") | ||
set(BLA_STATIC ON CACHE BOOL "Use static libraries") | ||
|
||
set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") | ||
set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") | ||
set(USE_OPENMP OFF CACHE BOOL "Build with Openmp support") | ||
set(USE_ONEDNN ON CACHE BOOL "Build with ONEDNN support") | ||
set(USE_LAPACK ON CACHE BOOL "Build with lapack support") | ||
set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") | ||
set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support") | ||
set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support") | ||
set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo") | ||
set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") | ||
set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") | ||
set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") | ||
|
||
set(USE_BLAS "mkl" CACHE STRING "BLAS Vendor") | ||
set(BLA_STATIC ON CACHE BOOL "Use static libraries") | ||
|
||
set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") | ||
set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") | ||
set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") | ||
set(USE_ONEDNN ON CACHE BOOL "Build with ONEDNN support") | ||
set(USE_LAPACK ON CACHE BOOL "Build with lapack support") | ||
set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") | ||
set(USE_SSE ON CACHE BOOL "Build with x86 SSE instruction support") | ||
set(USE_F16C OFF CACHE BOOL "Build with x86 F16C instruction support") | ||
set(USE_LIBJPEG_TURBO ON CACHE BOOL "Build with libjpeg-turbo") | ||
set(USE_DIST_KVSTORE ON CACHE BOOL "Build with DIST_KVSTORE support") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.