Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 9979c3c

Browse files
larroymarcoabreu
authored andcommitted
Fix cmake options parsing in dev_menu (#13458)
Add GPU+MKLDNN unittests to dev_menu
1 parent 7d44deb commit 9979c3c

File tree

2 files changed

+44
-39
lines changed

2 files changed

+44
-39
lines changed

cmake/cmake_options.yml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,35 @@
1616
# under the License.
1717

1818
--- # CMake configuration
19-
USE_CUDA: OFF # Build with CUDA support
20-
USE_OLDCMAKECUDA: OFF # Build with old cmake cuda
21-
USE_NCCL: OFF # Use NVidia NCCL with CUDA
22-
USE_OPENCV: ON # Build with OpenCV support
23-
USE_OPENMP: ON # Build with Openmp support
24-
USE_CUDNN: ON # Build with cudnn support) # one could set CUDNN_ROOT for search path
25-
USE_SSE: ON # Build with x86 SSE instruction support IF NOT ARM
26-
USE_F16C: ON # Build with x86 F16C instruction support) # autodetects support if ON
27-
USE_LAPACK: ON # Build with lapack support
28-
USE_MKL_IF_AVAILABLE: ON # Use MKL if found
29-
USE_MKLML_MKL: ON # Use MKLDNN variant of MKL (if MKL found) IF USE_MKL_IF_AVAILABLE AND (NOT APPLE)
30-
USE_MKLDNN: ON # Use MKLDNN variant of MKL (if MKL found) IF USE_MKL_IF_AVAILABLE AND (NOT APPLE)
31-
USE_OPERATOR_TUNING: ON # Enable auto-tuning of operators IF NOT MSVC
32-
USE_GPERFTOOLS: ON # Build with GPerfTools support (if found)
33-
USE_JEMALLOC: ON # Build with Jemalloc support
34-
USE_PROFILER: ON # Build with Profiler support
35-
USE_DIST_KVSTORE: OFF # Build with DIST_KVSTORE support
36-
USE_PLUGINS_WARPCTC: OFF # Use WARPCTC Plugins
37-
USE_PLUGIN_CAFFE: OFF # Use Caffe Plugin
38-
USE_CPP_PACKAGE: OFF # Build C++ Package
39-
USE_MXNET_LIB_NAMING: ON # Use MXNet library naming conventions.
40-
USE_GPROF: OFF # Compile with gprof (profiling) flag
41-
USE_CXX14_IF_AVAILABLE: OFF # Build with C++14 if the compiler supports it
42-
USE_VTUNE: OFF # Enable use of Intel Amplifier XE (VTune)) # one could set VTUNE_ROOT for search path
43-
ENABLE_CUDA_RTC: ON # Build with CUDA runtime compilation support
44-
BUILD_CPP_EXAMPLES: ON # Build cpp examples
45-
INSTALL_EXAMPLES: OFF # Install the example source files.
46-
USE_SIGNAL_HANDLER: OFF # Print stack traces on segfaults.
47-
USE_TENSORRT: OFF # Enable infeference optimization with TensorRT.
48-
USE_ASAN: OFF # Enable Clang/GCC ASAN sanitizers.
49-
ENABLE_TESTCOVERAGE: OFF # Enable compilation with test coverage metric output
19+
USE_CUDA: "ON" # Build with CUDA support
20+
USE_OLDCMAKECUDA: "OFF" # Build with old cmake cuda
21+
USE_NCCL: "OFF" # Use NVidia NCCL with CUDA
22+
USE_OPENCV: "ON" # Build with OpenCV support
23+
USE_OPENMP: "ON" # Build with Openmp support
24+
USE_CUDNN: "ON" # Build with cudnn support) # one could set CUDNN_ROOT for search path
25+
USE_SSE: "ON" # Build with x86 SSE instruction support IF NOT ARM
26+
USE_F16C: "ON" # Build with x86 F16C instruction support) # autodetects support if "ON"
27+
USE_LAPACK: "ON" # Build with lapack support
28+
USE_MKL_IF_AVAILABLE: "ON" # Use MKL if found
29+
USE_MKLML_MKL: "ON" # Use MKLDNN variant of MKL (if MKL found) IF USE_MKL_IF_AVAILABLE AND (NOT APPLE)
30+
USE_MKLDNN: "ON" # Use MKLDNN variant of MKL (if MKL found) IF USE_MKL_IF_AVAILABLE AND (NOT APPLE)
31+
USE_OPERATOR_TUNING: "ON" # Enable auto-tuning of operators IF NOT MSVC
32+
USE_GPERFTOOLS: "ON" # Build with GPerfTools support (if found)
33+
USE_JEMALLOC: "ON" # Build with Jemalloc support
34+
USE_PROFILER: "ON" # Build with Profiler support
35+
USE_DIST_KVSTORE: "OFF" # Build with DIST_KVSTORE support
36+
USE_PLUGINS_WARPCTC: "OFF" # Use WARPCTC Plugins
37+
USE_PLUGIN_CAFFE: "OFF" # Use Caffe Plugin
38+
USE_CPP_PACKAGE: "OFF" # Build C++ Package
39+
USE_MXNET_LIB_NAMING: "ON" # Use MXNet library naming conventions.
40+
USE_GPROF: "OFF" # Compile with gprof (profiling) flag
41+
USE_CXX14_IF_AVAILABLE: "OFF" # Build with C++14 if the compiler supports it
42+
USE_VTUNE: "OFF" # Enable use of Intel Amplifier XE (VTune)) # one could set VTUNE_ROOT for search path
43+
ENABLE_CUDA_RTC: "ON" # Build with CUDA runtime compilation support
44+
BUILD_CPP_EXAMPLES: "ON" # Build cpp examples
45+
INSTALL_EXAMPLES: "OFF" # Install the example source files.
46+
USE_SIGNAL_HANDLER: "ON" # Print stack traces on segfaults.
47+
USE_TENSORRT: "OFF" # Enable infeference optimization with TensorRT.
48+
USE_ASAN: "OFF" # Enable Clang/GCC ASAN sanitizers.
49+
ENABLE_TESTCOVERAGE: "OFF" # Enable compilation with test coverage metric output
50+
CMAKE_BUILD_TYPE: "Debug"

dev_menu.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ def __call__(self):
4646
resp = input("Please answer yes or no: ")
4747

4848
class CMake(object):
49-
def __init__(self, cmake_options_yaml='cmake/cmake_options.yml'):
50-
self.cmake_options_yaml = cmake_options_yaml
49+
def __init__(self, cmake_options_yaml='cmake_options.yml', cmake_options_yaml_default='cmake/cmake_options.yml'):
50+
if os.path.exists(cmake_options_yaml):
51+
self.cmake_options_yaml = cmake_options_yaml
52+
else:
53+
self.cmake_options_yaml = cmake_options_yaml_default
54+
logging.info('Using {} for CMake configuration'.format(self.cmake_options_yaml))
5155
self.cmake_options = None
5256
self.read_config()
5357

@@ -58,13 +62,8 @@ def read_config(self):
5862

5963
def _cmdlineflags(self):
6064
res = []
61-
def _bool_ON_OFF(x):
62-
if x:
63-
return 'ON'
64-
else:
65-
return 'OFF'
6665
for opt,v in self.cmake_options.items():
67-
res.append('-D{}={}'.format(opt,_bool_ON_OFF(v)))
66+
res.append('-D{}={}'.format(opt,v))
6867
return res
6968

7069
def cmake_command(self) -> str:
@@ -103,6 +102,11 @@ def __call__(self, build_dir='build', generator='Ninja', build_cmd='ninja'):
103102
"ci/build.py --platform ubuntu_gpu /work/runtime_functions.sh build_ubuntu_gpu",
104103
"ci/build.py --nvidiadocker --platform ubuntu_gpu /work/runtime_functions.sh unittest_ubuntu_python3_gpu",
105104
]),
105+
('[Docker] Python3 GPU+MKLDNN unittests',
106+
[
107+
"ci/build.py --platform ubuntu_gpu /work/runtime_functions.sh build_ubuntu_gpu_cmake_mkldnn",
108+
"ci/build.py --nvidiadocker --platform ubuntu_gpu /work/runtime_functions.sh unittest_ubuntu_python3_gpu",
109+
]),
106110
('[Docker] Python3 CPU Intel MKLDNN unittests',
107111
[
108112
"ci/build.py --platform ubuntu_cpu /work/runtime_functions.sh build_ubuntu_cpu_mkldnn",

0 commit comments

Comments
 (0)