xinyu-intel commented on issue #12724: simplify mac mkldnn build
URL: https://github.com/apache/incubator-mxnet/pull/12724#issuecomment-427581905
 
 
   Hi @azai91 , you can try to use llvm from `brew install llvm` instead of 
apple llvm built in xcode to enable OPENMP on both mxnet and mkldnn level. And 
I found this llvm also supports OPENCV well compared with `brew install gcc`. 
Details are as below:
   ```
   brew install llvm
   # .bash_profile
   export LIBRARY_PATH=/usr/local/Cellar/llvm/6.0.1/lib/
   # config.mk and mkldnn.mk
   CC=/usr/local/Cellar/llvm/6.0.1/bin/clang 
CXX=/usr/local/Cellar/llvm/6.0.1/bin/clang++
   ```
   And I get better performance on our local iMac Pro (Xeon W 8 cores with 
AVX-512):
   ```
   INFO:root:network: vgg-16
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 20.913986
   INFO:root:batch size 16, image/sec: 24.273071
   INFO:root:batch size 32, image/sec: 24.704907
   INFO:root:batch size 64, image/sec: 24.946080
   INFO:root:batch size 128, image/sec: 25.074148
   INFO:root:batch size 256, image/sec: 25.262900
   INFO:root:network: inception-v3
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 41.431404
   INFO:root:batch size 16, image/sec: 54.312317
   INFO:root:batch size 32, image/sec: 54.604119
   INFO:root:batch size 64, image/sec: 54.395680
   INFO:root:batch size 128, image/sec: 54.410785
   INFO:root:batch size 256, image/sec: 54.614424
   INFO:root:network: inception-v4
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 20.715221
   INFO:root:batch size 16, image/sec: 26.249734
   INFO:root:batch size 32, image/sec: 26.197659
   INFO:root:batch size 64, image/sec: 26.161530
   INFO:root:batch size 128, image/sec: 26.247461
   INFO:root:batch size 256, image/sec: 26.313875
   INFO:root:network: resnet-50
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 40.505148
   [23:07:34] src/operator/nn/mkldnn/mkldnn_base.cc:74: Allocate 51380224 bytes 
with malloc directly
   INFO:root:batch size 16, image/sec: 41.431191
   INFO:root:batch size 32, image/sec: 40.563484
   INFO:root:batch size 64, image/sec: 37.070624
   INFO:root:batch size 128, image/sec: 37.709096
   INFO:root:batch size 256, image/sec: 37.448483
   INFO:root:network: resnetv1-50
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 41.701090
   INFO:root:batch size 16, image/sec: 43.132788
   INFO:root:batch size 32, image/sec: 41.613291
   INFO:root:batch size 64, image/sec: 38.133290
   INFO:root:batch size 128, image/sec: 38.839577
   INFO:root:batch size 256, image/sec: 38.853521
   INFO:root:network: mobilenet
   INFO:root:device: cpu(0)
   INFO:root:batch size  1, image/sec: 200.916080
   INFO:root:batch size 16, image/sec: 287.614019
   INFO:root:batch size 32, image/sec: 277.838051
   INFO:root:batch size 64, image/sec: 274.474078
   INFO:root:batch size 128, image/sec: 273.622323
   INFO:root:batch size 256, image/sec: 273.445636
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to