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

Commit

Permalink
Switch to GCC 8 for distribution build (#19185)
Browse files Browse the repository at this point in the history
* Switch to GCC 8 for distribution build

* Include oneDNN gemm fix

* Update to oneDNN v1.6.4

* Update mkldnn_format_tag_last
  • Loading branch information
leezu authored Oct 5, 2020
1 parent 58e3d7f commit 3c5beb3
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/mkldnn
Submodule mkldnn updated 53 files
+1 −1 CMakeLists.txt
+34 −24 doc/primitives/matmul.md
+35 −0 include/dnnl.hpp
+14 −0 include/dnnl_types.h
+6 −6 src/CMakeLists.txt
+14 −0 src/common/c_types_map.hpp
+14 −0 src/common/dnnl_debug_autogenerated.cpp
+39 −28 src/common/matmul.cpp
+20 −9 src/common/matmul_pd.hpp
+14 −0 src/common/memory_desc_wrapper.cpp
+14 −0 src/common/tag_traits.hpp
+41 −0 src/common/utils.hpp
+33 −7 src/common/verbose.cpp
+44 −5 src/cpu/gemm_convolution_utils.cpp
+1 −1 src/cpu/gemm_inner_product.cpp
+43 −15 src/cpu/gemm_inner_product_utils.cpp
+10 −5 src/cpu/gemm_inner_product_utils.hpp
+1 −1 src/cpu/gemm_x8s8s32x_inner_product.cpp
+32 −3 src/cpu/matmul/gemm_based_common.hpp
+42 −49 src/cpu/matmul/gemm_bf16_matmul.cpp
+2 −2 src/cpu/matmul/gemm_bf16_matmul.hpp
+40 −49 src/cpu/matmul/gemm_f32_matmul.cpp
+2 −2 src/cpu/matmul/gemm_f32_matmul.hpp
+52 −54 src/cpu/matmul/gemm_x8s8s32x_matmul.cpp
+2 −2 src/cpu/matmul/gemm_x8s8s32x_matmul.hpp
+78 −0 src/cpu/matmul/matmul_utils.hpp
+44 −31 src/cpu/matmul/ref_matmul.cpp
+7 −5 src/cpu/ref_convolution.cpp
+10 −7 src/cpu/rnn/ref_rnn.cpp
+3 −3 src/cpu/x64/gemm/f32/jit_avx512_core_gemm_smalln_tn_f32_kern.cpp
+29 −15 src/cpu/x64/gemm/gemv_driver.cpp
+1 −1 src/cpu/x64/gemm_bf16_inner_product.cpp
+17 −6 src/cpu/x64/jit_avx2_1x1_conv_kernel_f32.cpp
+58 −16 src/cpu/x64/jit_gemm_inner_product_utils.cpp
+2 −2 src/cpu/x64/jit_gemm_inner_product_utils.hpp
+2 −1 src/cpu/x64/jit_uni_1x1_conv_utils.hpp
+6 −0 tests/benchdnn/dnn_types.cpp
+14 −0 tests/benchdnn/dnnl_debug_autogenerated.cpp
+7 −3 tests/benchdnn/dnnl_memory.hpp
+32 −6 tests/benchdnn/doc/driver_matmul.md
+2 −2 tests/benchdnn/inputs/bnorm/set_topologies_gpu
+1 −0 tests/benchdnn/inputs/matmul/shapes_3d
+20 −0 tests/benchdnn/inputs/matmul/shapes_multidim
+4 −1 tests/benchdnn/inputs/matmul/test_matmul_all
+14 −0 tests/benchdnn/inputs/matmul/test_matmul_multidims
+14 −2 tests/benchdnn/matmul/bench_matmul.cpp
+114 −51 tests/benchdnn/matmul/matmul.cpp
+121 −28 tests/benchdnn/matmul/matmul.hpp
+95 −21 tests/benchdnn/matmul/matmul_aux.cpp
+16 −7 tests/benchdnn/matmul/ref_matmul.cpp
+11 −3 tests/gtests/test_ip_formats.cpp
+20 −0 tests/gtests/test_matmul.cpp
+8 −1 tests/gtests/test_reorder_formats.cpp
4 changes: 2 additions & 2 deletions cd/mxnet_lib/static/Jenkins_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions ci/docker/Dockerfile.build.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -1347,19 +1347,19 @@ 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"
./ci/publish/python/build.sh
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"
Expand Down
5 changes: 3 additions & 2 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/static_site/src/pages/get_started/build_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/operator/mkldnn_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 5 additions & 0 deletions tools/dependencies/protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion tools/pip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,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')
Expand Down

0 comments on commit 3c5beb3

Please sign in to comment.