From fc245dc3e6f4e5fd8323fdb39418a9117ac48c45 Mon Sep 17 00:00:00 2001 From: chenxiny Date: Fri, 1 Nov 2019 10:44:59 +0800 Subject: [PATCH 1/3] add mxnet mkldnn cmake instruction --- .../performance/backend/mkldnn/mkldnn_readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md index 7c19fbb97931..e8c67992798f 100644 --- a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md +++ b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md @@ -61,7 +61,15 @@ cd incubator-mxnet make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel ``` -If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. +If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. To achieve better performance, the Intel OMP and llvm OMP is recommended as below instruction. Otherwise, default GOMP will be used and you may get the sub-optimal performance. + +``` +mkdir build && cd build +cmake -DUSE_CUDA=OFF -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. +make -j $(nproc) +``` + +

MacOS

From 3fa30741241ecceaa3d5eb662b89dc84355f9c57 Mon Sep 17 00:00:00 2001 From: chenxiny Date: Fri, 1 Nov 2019 11:14:29 +0800 Subject: [PATCH 2/3] imporve doc --- .../performance/backend/mkldnn/mkldnn_readme.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md index e8c67992798f..27b8271b7bbe 100644 --- a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md +++ b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md @@ -57,19 +57,24 @@ cd incubator-mxnet ### Build MXNet with MKL-DNN -``` -make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel -``` - -If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. To achieve better performance, the Intel OMP and llvm OMP is recommended as below instruction. Otherwise, default GOMP will be used and you may get the sub-optimal performance. +To achieve better performance, the Intel OMP and llvm OMP are recommended as below instruction. Otherwise, default GOMP will be used and you may get the sub-optimal performance. If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. ``` +# build with llvm OMP and Intel MKL/openblas mkdir build && cd build -cmake -DUSE_CUDA=OFF -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. +cmake -DUSE_CUDA=OFF -DUSE_MKL_IF_AVAILABLE=ON -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. make -j $(nproc) ``` +``` +# build with Intel MKL and Intel OMP +make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel +``` +``` +# build with openblas and GOMP(sub-optimal performance) +make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=openblas +```

MacOS

From 72acfb36bd6c4499a159b89f008cc1de0e282a03 Mon Sep 17 00:00:00 2001 From: chenxiny Date: Fri, 1 Nov 2019 13:55:33 +0800 Subject: [PATCH 3/3] OMP->OpenMP --- .../tutorials/performance/backend/mkldnn/mkldnn_readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md index 27b8271b7bbe..c66fd2e8e642 100644 --- a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md +++ b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md @@ -57,22 +57,22 @@ cd incubator-mxnet ### Build MXNet with MKL-DNN -To achieve better performance, the Intel OMP and llvm OMP are recommended as below instruction. Otherwise, default GOMP will be used and you may get the sub-optimal performance. If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. +To achieve better performance, the Intel OpenMP and llvm OpenMP are recommended as below instruction. Otherwise, default GNU OpenMP will be used and you may get the sub-optimal performance. If you don't have the full [MKL](https://software.intel.com/en-us/intel-mkl) library installation, you might use OpenBLAS as the blas library, by setting USE_BLAS=openblas. ``` -# build with llvm OMP and Intel MKL/openblas +# build with llvm OpenMP and Intel MKL/openblas mkdir build && cd build cmake -DUSE_CUDA=OFF -DUSE_MKL_IF_AVAILABLE=ON -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. make -j $(nproc) ``` ``` -# build with Intel MKL and Intel OMP +# build with Intel MKL and Intel OpenMP make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel ``` ``` -# build with openblas and GOMP(sub-optimal performance) +# build with openblas and GNU OpenMP(sub-optimal performance) make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=openblas ```