From b99d26d0d8747b13bb58f53bf3a3bddab995d308 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Thu, 17 Sep 2020 09:59:36 -0700 Subject: [PATCH 1/4] Switch to GCC 8 for distribution build --- cd/mxnet_lib/static/Jenkins_pipeline.groovy | 4 ++-- ci/docker/Dockerfile.build.centos7 | 5 +++-- ci/docker/runtime_functions.sh | 14 +++++++------- ci/jenkins/Jenkins_steps.groovy | 5 +++-- .../src/pages/get_started/build_from_source.md | 8 ++++---- tools/dependencies/protobuf.sh | 5 +++++ tools/pip/setup.py | 5 ++++- 7 files changed, 28 insertions(+), 18 deletions(-) diff --git a/cd/mxnet_lib/static/Jenkins_pipeline.groovy b/cd/mxnet_lib/static/Jenkins_pipeline.groovy index 00653b6713bb..09983207b71d 100644 --- a/cd/mxnet_lib/static/Jenkins_pipeline.groovy +++ b/cd/mxnet_lib/static/Jenkins_pipeline.groovy @@ -32,8 +32,8 @@ libmxnet = 'lib/libmxnet.so' licenses = 'licenses/*' // libmxnet dependencies -mx_native_deps = 'lib/libgfortran.so.4, lib/libopenblas.so.0' -mx_deps = 'lib/libgfortran.so.4, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h' +mx_native_deps = 'lib/libgfortran.so.*, lib/libopenblas.so.0' +mx_deps = 'lib/libgfortran.so.*, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h' // library type // either static or dynamic - depending on how it links to its dependencies diff --git a/ci/docker/Dockerfile.build.centos7 b/ci/docker/Dockerfile.build.centos7 index adba465594d8..6ae6df7f15ec 100644 --- a/ci/docker/Dockerfile.build.centos7 +++ b/ci/docker/Dockerfile.build.centos7 @@ -53,6 +53,7 @@ RUN yum -y check-update || true && \ protobuf-devel \ # CentOS Software Collections https://www.softwarecollections.org devtoolset-7 \ + devtoolset-8 \ rh-python36 \ rh-maven35 \ # Libraries @@ -69,8 +70,8 @@ RUN yum -y check-update || true && \ libzstd-devel && \ yum clean all -# Make GCC7, Python 3.5 and Maven 3.3 Software Collections available by default -# during build and runtime of this container +# Make Python 3.6 and Maven 3.3 Software Collections available by default during +# the following build steps in this Dockerfile SHELL [ "/usr/bin/scl", "enable", "devtoolset-7", "rh-python36", "rh-maven35" ] # Install minimum required cmake version diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 0b5ae4a6a473..5445b5a698e3 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -111,7 +111,7 @@ build_dynamic_libmxnet() { gather_licenses cd /work/build - source /opt/rh/devtoolset-7/enable + source /opt/rh/devtoolset-8/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" if [[ ${mxnet_variant} = "cpu" ]]; then @@ -1278,7 +1278,7 @@ checkout() { build_static_libmxnet() { set -ex pushd . - source /opt/rh/devtoolset-7/enable + source /opt/rh/devtoolset-8/enable source /opt/rh/rh-python36/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" @@ -1303,7 +1303,7 @@ ci_package_pypi() { cd_package_pypi() { set -ex pushd . - source /opt/rh/devtoolset-7/enable + source /opt/rh/devtoolset-8/enable source /opt/rh/rh-python36/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" @@ -1347,7 +1347,7 @@ build_static_python_cpu() { set -ex pushd . export mxnet_variant=cpu - source /opt/rh/devtoolset-7/enable + source /opt/rh/devtoolset-8/enable source /opt/rh/rh-python36/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" @@ -1355,11 +1355,11 @@ build_static_python_cpu() { popd } -build_static_python_cu92() { +build_static_python_cu102() { set -ex pushd . - export mxnet_variant=cu92 - source /opt/rh/devtoolset-7/enable + export mxnet_variant=cu102 + source /opt/rh/devtoolset-8/enable source /opt/rh/rh-python36/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy index c5aea91c990c..9e20c086a0f8 100644 --- a/ci/jenkins/Jenkins_steps.groovy +++ b/ci/jenkins/Jenkins_steps.groovy @@ -37,7 +37,8 @@ mx_tensorrt_lib = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, buil mx_lib_cpp_examples = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, build/3rdparty/openmp/runtime/src/libomp.so, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so' mx_lib_cpp_examples_no_tvm_op = 'build/libmxnet.so, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, build/3rdparty/openmp/runtime/src/libomp.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so' mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, build/3rdparty/openmp/runtime/src/libomp.so' -mx_cd_lib = 'lib/libmxnet.so, licenses/*, lib/libgfortran.so.4, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h' +mx_cd_lib = 'lib/libmxnet.so, licenses/*, lib/libgfortran.so.*, lib/libopenblas.so.0, include/mkldnn/dnnl_version.h, include/mkldnn/dnnl_config.h' + // Python unittest for CPU // Python 3 @@ -634,7 +635,7 @@ def compile_static_python_gpu() { ws('workspace/ut-publish-python-gpu') { timeout(time: max_time, unit: 'MINUTES') { utils.init_git() - utils.docker_run('centos7_gpu_cu92', 'build_static_python_cu92') + utils.docker_run('centos7_gpu_cu102', 'build_static_python_cu102') } } } diff --git a/docs/static_site/src/pages/get_started/build_from_source.md b/docs/static_site/src/pages/get_started/build_from_source.md index a80a3d3ee40f..3bcfa2079681 100644 --- a/docs/static_site/src/pages/get_started/build_from_source.md +++ b/docs/static_site/src/pages/get_started/build_from_source.md @@ -74,13 +74,13 @@ sudo apt-get install -y build-essential git ninja-build ccache libopenblas-dev l sudo yum install epel-release centos-release-scl sudo yum install git make ninja-build automake autoconf libtool protobuf-compiler protobuf-devel \ atlas-devel openblas-devel lapack-devel opencv-devel openssl-devel zeromq-devel python3 \ - devtoolset-7 + devtoolset-8 source /opt/rh/devtoolset-7/enable ``` -Here `devtoolset-7` refers to the [Developer Toolset -7](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/) created by +Here `devtoolset-8` refers to the [Developer Toolset +8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/) created by Red Hat for developers working on CentOS or Red Hat Enterprise Linux platform -and providing the GNU Compiler Collection 7. +and providing the GNU Compiler Collection 9. ### macOS ```bash diff --git a/tools/dependencies/protobuf.sh b/tools/dependencies/protobuf.sh index 4b58a1cd31ff..7da4c2537b42 100755 --- a/tools/dependencies/protobuf.sh +++ b/tools/dependencies/protobuf.sh @@ -20,6 +20,11 @@ # This script builds the static library of protobuf along with protoc, that can be used as dependency of mxnet. set -ex PROTOBUF_VERSION=3.5.1 +if [[ $PLATFORM == 'darwin' ]]; then + DY_EXT="dylib" +else + DY_EXT="so" +fi LIBPROTOBUF="$DEPS_PATH/lib/libprotobuf.$DY_EXT" LIBPROTOC="$DEPS_PATH/lib/libprotoc.$DY_EXT" diff --git a/tools/pip/setup.py b/tools/pip/setup.py index 2aff243d3ed7..5395481960ab 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -151,9 +151,12 @@ def skip_markdown_comments(md): if os.path.exists(os.path.join(libdir, 'libgfortran.so.3')): shutil.copy(os.path.join(libdir, 'libgfortran.so.3'), mxdir) package_data['mxnet'].append('mxnet/libgfortran.so.3') - else: + elif os.path.exists(os.path.join(libdir, 'libgfortran.so.4')): shutil.copy(os.path.join(libdir, 'libgfortran.so.4'), mxdir) package_data['mxnet'].append('mxnet/libgfortran.so.4') + elif os.path.exists(os.path.join(libdir, 'libgfortran.so.5')): + shutil.copy(os.path.join(libdir, 'libgfortran.so.5'), mxdir) + package_data['mxnet'].append('mxnet/libgfortran.so.5') if os.path.exists(os.path.join(libdir, 'libopenblas.so.0')): shutil.copy(os.path.join(libdir, 'libopenblas.so.0'), mxdir) package_data['mxnet'].append('mxnet/libopenblas.so.0') From fdf7dcba5369b5961c56dd932f2776e49a96b6d1 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Tue, 29 Sep 2020 16:58:17 +0000 Subject: [PATCH 2/4] Include oneDNN gemm fix --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index 5ef631a030a6..5ce95efe6f5e 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit 5ef631a030a6f73131c77892041042805a06064f +Subproject commit 5ce95efe6f5e86cddbf704b637063cd8dc914125 From 90cfa1c47b911f44e44a83b05c150287a195e61a Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Thu, 1 Oct 2020 16:08:53 +0000 Subject: [PATCH 3/4] Update to oneDNN v1.6.4 --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index 5ce95efe6f5e..570ab9c2ea09 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit 5ce95efe6f5e86cddbf704b637063cd8dc914125 +Subproject commit 570ab9c2ea0915b048279438aebb063b8769149c From 2e3f4150735b8319bac80e08dba25d3d41c4b8c6 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Fri, 2 Oct 2020 13:41:37 +0000 Subject: [PATCH 4/4] Update mkldnn_format_tag_last --- tests/cpp/operator/mkldnn_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp/operator/mkldnn_test.cc b/tests/cpp/operator/mkldnn_test.cc index 2e34f7bdbbee..b3bd508b2009 100644 --- a/tests/cpp/operator/mkldnn_test.cc +++ b/tests/cpp/operator/mkldnn_test.cc @@ -100,7 +100,7 @@ static void VerifyDefMem(const mkldnn::memory &mem) { TEST(MKLDNN_UTIL_FUNC, MemFormat) { // Check whether the number of format is correct. - CHECK_EQ(mkldnn_format_tag_last, 205); + CHECK_EQ(mkldnn_format_tag_last, 219); CHECK_EQ(mkldnn_nchw, 5); CHECK_EQ(mkldnn_oihw, 5); }