You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/15 08:05:47 UTC

[GitHub] szha opened a new issue #8661: Turning on OpenMP option on OSX slowed things down

szha opened a new issue #8661: Turning on OpenMP option on OSX slowed things down
URL: https://github.com/apache/incubator-mxnet/issues/8661
 
 
   ## Description
   On Mac OSX, turning on OpenMP support is slower than not turning on OpenMP for Alexnet with dummy data.
   
   With OpenMP off, I obtained 9.2 samples/s throughput.
   With OpenMP on, I only obtained 7.5-8.3 samples/s throughput.
   
   ## Environment info (Required)
   
   ```
   ----------Python Info----------
   ('Version      :', '2.7.14')
   ('Compiler     :', 'GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)')
   ('Build        :', ('default', 'Sep 25 2017 09:54:19'))
   ('Arch         :', ('64bit', ''))
   ------------Pip Info-----------
   ('Version      :', '9.0.1')
   ('Directory    :', '/usr/local/lib/python2.7/site-packages/pip')
   ----------MXNet Info-----------
   ('Version      :', '0.12.1')
   ('Directory    :', '$DIR/mxnet/python/mxnet')
   ----------System Info----------
   ('Platform     :', 'Darwin-17.2.0-x86_64-i386-64bit')
   ('system       :', 'Darwin')
   ('node         :', 'acbc32d388cb.ant.amazon.com')
   ('release      :', '17.2.0')
   ('version      :', 'Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64')
   ----------Hardware Info----------
   ('machine      :', 'x86_64')
   ('processor    :', 'i386')
   machdep.cpu.brand_string: Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
   machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
   machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID SMAP RDSEED ADX IPT FPU_CSDS
   machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0747 sec, LOAD: 0.7048 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0589 sec, LOAD: 0.3591 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0601 sec, LOAD: 0.4477 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0617 sec, LOAD: 0.2036 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0005 sec, LOAD: 0.0989 sec.
   Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0628 sec, LOAD: 0.3036 sec.
   ```
   
   Package used (Python/R/Scala/Julia):
   Python
   
   ## Build info (Required if built from source)
   
   Compiler (gcc/clang/mingw/visual studio): clang
   
   MXNet commit hash: 399ac038
   With a patch f810b06d to enable openmp on mac
   
   Build config:
   Default config from f810b06d
   
   ## Minimum reproducible example
   ```bash
   # cd to mxnet source directory
   cd example/gluon
   python image_classification.py --model alexnet --dataset dummy --epochs 3 --batch-size 32 --log-interval 1
   ```
   The speed metric is the median of all the `samples/sec` values.
   
   ## Steps to reproduce
   
   ### To build on OSX with OpenMP support
   0. (install homebrew if not already installed)
   1. `brew install llvm`
   2. `git clone https://github.com/szha/mxnet -b omp_slow`
   3. `cd mxnet; make -j 4 CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++`
   
   ### To build on OSX with OpenMP support
   0. (install homebrew if not already installed)
   1. `brew install llvm`
   2. `git clone https://github.com/szha/mxnet -b omp_slow`
   3. edit `mxnet/make/config.mk` and change `USE_OPENMP` from `1` to `0`.
   4. `cd mxnet; make -j 4 CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++`
   
   ## What have you tried to solve it?
   
   1. Tune `OMP_NUM_THREADS`.
   2. Tune `MXNET_CPU_WORKER_NTHREADS`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services