[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201886287
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+```
+
+2. Copy file `3rdparty/mkldnn/config_template.vcxproj` to incubator-mxnet root.
+
+3. Start a Visual Studio command prompt.
+
+4. Use [CMake](https://cmake.org/) to create a Visual Studio solution in 
```./build``` or some other directory. Make sure to specify the architecture in 
the 
+[CMake](https://cmake.org/) command:
+```
+mkdir build
+cd build
+cmake -G 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201884754
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
 
 Review comment:
   I'll add this.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201884744
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
 
 Review comment:
   I'll add this.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201884410
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
 
 Review comment:
   Don't you see this means if your os is Darwin, you will not enable openmp 
even if you USE_OPENMP=1? If possible, i need check gcc version (whether apple 
clang or gnu-gcc) here. Any good suggestions? @szha @zheng-da 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201883931
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,302 @@
+# Build/Install MXNet with MKL-DNN
+
+Building MXNet with [Intel MKL-DNN](https://github.com/intel/mkl-dnn) will 
gain better performance when using Intel Xeon CPUs for training and inference. 
The improvement of performance can be seen in this 
[page](https://mxnet.incubator.apache.org/faq/perf.html#intel-cpu). Below are 
instructions for linux, MacOS and Windows platform.
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+sudo apt-get update
+sudo apt-get install -y build-essential git
+sudo apt-get install -y libopenblas-dev liblapack-dev
+sudo apt-get install -y libopencv-dev
+sudo apt-get install -y graphviz
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
 
 Review comment:
   why pip? This is just a instruction for building with mkldnn or MKL blas 
from source.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201883671
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,302 @@
+# Build/Install MXNet with MKL-DNN
+
+Building MXNet with [Intel MKL-DNN](https://github.com/intel/mkl-dnn) will 
gain better performance when using Intel Xeon CPUs for training and inference. 
The improvement of performance can be seen in this 
[page](https://mxnet.incubator.apache.org/faq/perf.html#intel-cpu). Below are 
instructions for linux, MacOS and Windows platform.
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+sudo apt-get update
+sudo apt-get install -y build-essential git
+sudo apt-get install -y libopenblas-dev liblapack-dev
+sudo apt-get install -y libopencv-dev
+sudo apt-get install -y graphviz
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
 
 Review comment:
   why pip? This is just a instruction for building with mkldnn or MKL blas 
from source.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201883671
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,302 @@
+# Build/Install MXNet with MKL-DNN
+
+Building MXNet with [Intel MKL-DNN](https://github.com/intel/mkl-dnn) will 
gain better performance when using Intel Xeon CPUs for training and inference. 
The improvement of performance can be seen in this 
[page](https://mxnet.incubator.apache.org/faq/perf.html#intel-cpu). Below are 
instructions for linux, MacOS and Windows platform.
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+sudo apt-get update
+sudo apt-get install -y build-essential git
+sudo apt-get install -y libopenblas-dev liblapack-dev
+sudo apt-get install -y libopencv-dev
+sudo apt-get install -y graphviz
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
 
 Review comment:
   why pip? This is just a instruction for building with mkldnn or MKL blas 
from source.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201593799
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,292 @@
+# Build/Install MXNet with MKL-DNN
+
+Building MXNet with [Intel MKL-DNN](https://github.com/intel/mkl-dnn) will 
gain better performance when using Intel Xeon CPUs for training and inference. 
The improvement of performance can be seen in this 
[page](https://mxnet.incubator.apache.org/faq/perf.html#intel-cpu). Below are 
instructions for linux, MacOS and Windows platform.
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+sudo apt-get update
+sudo apt-get install -y build-essential git
+sudo apt-get install -y libopenblas-dev liblapack-dev
+sudo apt-get install -y libopencv-dev
+sudo apt-get install -y graphviz
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+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 full [MKL](https://software.intel.com/en-us/intel-mkl) 
library installed, you can use OpenBLAS by setting `USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify the 
Makefile in MXNet root dictionary:
 
 Review comment:
   seems doesn't work.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-07-11 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r201579794
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,292 @@
+# Build/Install MXNet with MKL-DNN
+
+Building MXNet with [Intel MKL-DNN](https://github.com/intel/mkl-dnn) will 
gain better performance when using Intel Xeon CPUs for training and inference. 
The improvement of performance can be seen in this 
[page](https://mxnet.incubator.apache.org/faq/perf.html#intel-cpu). Below are 
instructions for linux, MacOS and Windows platform.
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+sudo apt-get update
+sudo apt-get install -y build-essential git
+sudo apt-get install -y libopenblas-dev liblapack-dev
+sudo apt-get install -y libopencv-dev
+sudo apt-get install -y graphviz
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+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 full [MKL](https://software.intel.com/en-us/intel-mkl) 
library installed, you can use OpenBLAS by setting `USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify the 
Makefile in MXNet root dictionary:
 
 Review comment:
   ok


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-27 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r198691850
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
 
 Review comment:
   please review the latest commit


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632936
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
 
 Review comment:
   https://github.com/apache/incubator-mxnet/blob/master/Makefile


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632964
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
 
 Review comment:
   https://github.com/apache/incubator-mxnet/blob/master/prepare_mkldnn.sh


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632864
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+```
+
+2. Copy file `3rdparty/mkldnn/config_template.vcxproj` to incubator-mxnet root.
+
+3. Start a Visual Studio command prompt.
+
+4. Use [CMake](https://cmake.org/) to create a Visual Studio solution in 
```./build``` or some other directory. Make sure to specify the architecture in 
the 
+[CMake](https://cmake.org/) command:
+```
+mkdir build
+cd build
+cmake -G 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632833
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
 
 Review comment:
   del


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632758
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+```
+
+2. Copy file `3rdparty/mkldnn/config_template.vcxproj` to incubator-mxnet root.
+
+3. Start a Visual Studio command prompt.
+
+4. Use [CMake](https://cmake.org/) to create a Visual Studio solution in 
```./build``` or some other directory. Make sure to specify the architecture in 
the 
+[CMake](https://cmake.org/) command:
+```
+mkdir build
+cd build
+cmake -G 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632577
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+```
+
+2. Copy file `3rdparty/mkldnn/config_template.vcxproj` to incubator-mxnet root.
+
+3. Start a Visual Studio command prompt.
+
+4. Use [CMake](https://cmake.org/) to create a Visual Studio solution in 
```./build``` or some other directory. Make sure to specify the architecture in 
the 
+[CMake](https://cmake.org/) command:
+```
+mkdir build
+cd build
+cmake -G 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632571
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
 
 Review comment:
   added


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196632249
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+```
+
+2. Copy file `3rdparty/mkldnn/config_template.vcxproj` to incubator-mxnet root.
+
+3. Start a Visual Studio command prompt.
+
+4. Use [CMake](https://cmake.org/) to create a Visual Studio solution in 
```./build``` or some other directory. Make sure to specify the architecture in 
the 
+[CMake](https://cmake.org/) command:
+```
+mkdir build
+cd build
+cmake -G 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196631836
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
+4. Unzip the OpenCV package.
+5. Set the environment variable ```OpenCV_DIR``` to point to the ```OpenCV 
build directory``` (```C:\opencv\build\x64\vc14``` for example). Also, you need 
to add the OpenCV bin directory (```C:\opencv\build\x64\vc14\bin``` for 
example) to the ``PATH`` variable.
+6. If you have Intel Math Kernel Library (MKL) installed, set ```MKL_ROOT``` 
to point to ```MKL``` directory that contains the ```include``` and ```lib```. 
If you want to use MKL blas, you should set ```-DUSE_BLAS=mkl``` when cmake. 
Typically, you can find the directory in
+```C:\Program Files 
(x86)\IntelSWTools\compilers_and_libraries_2018\windows\mkl```.
+7. If you don't have the Intel Math Kernel Library (MKL) installed, download 
and install 
[OpenBLAS](http://sourceforge.net/projects/openblas/files/v0.2.14/). Note that 
you should also download ```mingw64.dll.zip`` along with openBLAS and add them 
to PATH.
+8. Set the environment variable ```OpenBLAS_HOME``` to point to the 
```OpenBLAS``` directory that contains the ```include``` and ```lib``` 
directories. Typically, you can find the directory in ```C:\Program files 
(x86)\OpenBLAS\```. 
+
+After you have installed all of the required dependencies, build the MXNet 
source code:
+
+1. Download the MXNet source code from 
[GitHub](https://github.com/apache/incubator-mxnet). Don't forget to pull the 
submodules:
 
 Review comment:
   keep consistent with 
https://mxnet.incubator.apache.org/install/windows_setup.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache 

[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196630931
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
+3. Download and install 
[OpenCV](http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/opencv-3.0.0.exe/download).
 
 Review comment:
   keep consistent with 
https://mxnet.incubator.apache.org/install/windows_setup.html
   Feel free to check if v2 work for your self:)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196630871
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) CC=gcc-4.9 CXX=g++-4.9 USE_OPENCV=0 USE_OPENMP=1 
USE_MKLDNN=1 USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+We recommend to build and install MXNet yourself using [Microsoft Visual 
Studio 2015](https://www.visualstudio.com/vs/older-downloads/), or you can also 
try experimentally the latest [Microsoft Visual Studio 
2017](https://www.visualstudio.com/downloads/).
+
+**Visual Studio 2015**
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
+2. Download and Install [CMake](https://cmake.org/) if it is not already 
installed.
 
 Review comment:
   keep consistent with 
https://mxnet.incubator.apache.org/install/windows_setup.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196630743
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
 
 Review comment:
   keep consistent with 
https://mxnet.incubator.apache.org/install/windows_setup.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196630760
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
 
 Review comment:
   keep consistent with 
https://mxnet.incubator.apache.org/install/windows_setup.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196630743
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,287 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
 
 Review comment:
   keep consistent with https://mxnet.incubator.apache.org/install/index.html


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-19 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196374224
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) USE_OPENCV=0 USE_OPENMP=1 USE_MKLDNN=1 
USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 
 Review comment:
   I've checked building with VS2017 without any issues. Could you take a 
review and can we merge if not any questions? Thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-18 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196275484
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) USE_OPENCV=0 USE_OPENMP=1 USE_MKLDNN=1 
USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 
 Review comment:
   MKL-DNN officially supports VS2015 and I don't know whether VS2017 works. 
I'd like to ask MKL-DNN team and try it later because i'm suffering from cpu 
int8 now. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-06-18 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r196266758
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
 
 Review comment:
   typo, 'set mac complier to gcc49', I've add them to the make command.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-05-30 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r191974393
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) USE_OPENCV=0 USE_OPENMP=1 USE_MKLDNN=1 
USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 
 Review comment:
   To use VS2017, flease follow this 
[link](https://github.com/apache/incubator-mxnet/blob/ecdff56170c4bb2b54af5ed765b7f826e4f95e26/docs/install/index.md)
 to modify VC++ and change the version of the Visual studio 2017 to v14.11 
before building. VS2015 is prefered. Thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xinyu-intel commented on a change in pull request #11049: Add linux and macos MKLDNN Building Instruction

2018-05-30 Thread GitBox
xinyu-intel commented on a change in pull request #11049: Add linux and macos 
MKLDNN Building Instruction
URL: https://github.com/apache/incubator-mxnet/pull/11049#discussion_r191974393
 
 

 ##
 File path: MKLDNN_README.md
 ##
 @@ -0,0 +1,229 @@
+# Build/Install MXNet with MKL-DNN
+
+Contents
+
+* [1. Linux](#1)
+* [2. MacOS](#2)
+* [3. Windows](#3)
+* [4. Verify MXNet with python](#4)
+* [5. Enable MKL BLAS](#5)
+
+Linux
+
+### Prerequisites
+
+```
+apt-get update && apt-get install -y build-essential git libopencv-dev curl 
gcc libopenblas-dev python python-pip python-dev python-opencv graphviz 
python-scipy python-sklearn
+```
+
+### Clone MXNet sources
+
+```
+git clone --recursive https://github.com/apache/incubator-mxnet.git
+cd incubator-mxnet
+git submodule update --recursive --init
+```
+
+### 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 full MKL library installed, you can use OpenBLAS by setting 
`USE_BLAS=openblas`.
+
+MacOS
+
+### Prerequisites
+
+Install the dependencies, required for MXNet, with the following commands:
+
+- [Homebrew](https://brew.sh/)
+- gcc (clang in macOS does not support OpenMP)
+- OpenCV (for computer vision operations)
+
+```
+# Paste this command in Mac terminal to install Homebrew
+/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+# install dependency
+brew update
+brew install pkg-config
+brew install graphviz
+brew tap homebrew/core
+brew install opencv
+brew tap homebrew/versions
+brew install gcc49
+brew link gcc49
+```
+
+### Enable OpenMP for MacOS
+
+If you want to enable OpenMP for better performance, you should modify these 
two files:
+
+1. Makefile L138:
+
+```
+ifeq ($(USE_OPENMP), 1)
+# ifneq ($(UNAME_S), Darwin)
+CFLAGS += -fopenmp
+# endif
+endif
+```
+
+2. prepare_mkldnn.sh L96:
+
+```
+CC=gcc-4.9 CXX=g++-4.9 cmake $MKLDNN_ROOTDIR 
-DCMAKE_INSTALL_PREFIX=$MKLDNN_INSTALLDIR -B$MKLDNN_BUILDDIR 
-DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF >&2
+```
+
+### Build MXNet with MKL-DNN
+
+```
+make -j $(sysctl -n hw.ncpu) USE_OPENCV=0 USE_OPENMP=1 USE_MKLDNN=1 
USE_BLAS=apple USE_PROFILER=1
+```
+
+*Note: Temporarily disable OPENCV.*
+
+Windows
+
+To build and install MXNet yourself, you need the following dependencies. 
Install the required dependencies:
+
+1. If [Microsoft Visual Studio 
2015](https://www.visualstudio.com/vs/older-downloads/) is not already 
installed, download and install it. You can download and install the free 
community edition.
 
 Review comment:
   To use VS2017, please follow this 
[link](https://github.com/apache/incubator-mxnet/blob/ecdff56170c4bb2b54af5ed765b7f826e4f95e26/docs/install/index.md)
 to modify VC++ and change the version of the Visual studio 2017 to v14.11 
before building. VS2015 is prefered. Thanks!


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services