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

USE_NNPACK build flag not honored. #15974

Open
unrelatedlabs opened this issue Aug 22, 2019 · 4 comments
Open

USE_NNPACK build flag not honored. #15974

unrelatedlabs opened this issue Aug 22, 2019 · 4 comments
Labels
Build v1.x Targeting v1.x branch

Comments

@unrelatedlabs
Copy link

Description

USE_NNPACK build flag not honored.

git clone --recursive https://github.com/apache/incubator-mxnet.git --branch 1.5.0 mxnet
mkdir -p mxnet/build
cd mxnet/build

cmake -GNinja -DVERBOSE=1  -DUSE_NNPACK=1 \
 -DADD_LDFLAGS="-L${NNPACK}/build/ -lnnpack -lpthreadpool"  \
 -DADD_CFLAGS="-I${NNPACK}/include/ -I${NNPACK}/deps/pthreadpool/include/" \
 -DUSE_BLAS=openblas \
 -DUSE_OPENCV=1 \
 -DUSE_CUDA=0 \
 -USE_MKLDNN=0 \
 ..

I get

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ADD_CFLAGS
    ADD_LDFLAGS
    USE_NNPACK
    VERBOSE

Environment info (Required)

Architecture:        armv7l
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       39 bits physical, 48 bits virtual
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           8
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Stepping:            13
CPU MHz:             2400.000
BogoMIPS:            4800.00
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            16384K
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht pbe syscall nx pdpe1gb lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq dtes64 ds_cpl ssse3 sdbg fma cx16 xtpr pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch kaiser fsgsbase bmi1 hle avx2 bmi2 erms rtm xsaveopt arat
----------Python Info----------
Version      : 3.7.3
Compiler     : GCC 8.3.0
Build        : ('default', 'Apr  3 2019 05:39:12')
Arch         : ('32bit', 'ELF')
------------Pip Info-----------
Version      : 19.2.2
Directory    : /usr/local/lib/python3.7/dist-packages/pip
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
Platform     : Linux-4.9.184-linuxkit-armv7l-with-debian-10.0
system       : Linux
node         : 2007a277dc67
release      : 4.9.184-linuxkit
version      : #1 SMP Tue Jul 2 22:58:16 UTC 2019
----------Hardware Info----------
machine      : armv7l
processor    : 
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0494 sec, LOAD: 0.8141 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0411 sec, LOAD: 0.2910 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0434 sec, LOAD: 0.2042 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0334 sec, LOAD: 0.2438 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0324 sec, LOAD: 0.5857 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0043 sec, LOAD: 0.3265 sec.

Package used (Python/R/Scala/Julia):
Python 3.7

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio):
gcc version 8.3.0 (Debian 8.3.0-6)

MXNet commit hash:
75a9e18

Build config:

cmake -GNinja -DVERBOSE=1  -DUSE_NNPACK=1 \
 -DADD_LDFLAGS="-L${NNPACK}/build/ -lnnpack -lpthreadpool"  \
 -DADD_CFLAGS="-I${NNPACK}/include/ -I${NNPACK}/deps/pthreadpool/include/" \
 -DUSE_BLAS=openblas \
 -DUSE_OPENCV=1 \
 -DUSE_CUDA=0 \
 -USE_MKLDNN=0 \
 ..

Error Message:

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CROSSCOMPILING FALSE
-- CMAKE_HOST_SYSTEM_PROCESSOR armv7l
-- CMAKE_SYSTEM_PROCESSOR armv7l
-- CMAKE_SYSTEM_NAME Linux
-- Performing Test SUPPORT_CXX11
-- Performing Test SUPPORT_CXX11 - Success
-- Performing Test SUPPORT_CXX0X
-- Performing Test SUPPORT_CXX0X - Success
-- Performing Test SUPPORT_MSSE3
-- Performing Test SUPPORT_MSSE3 - Failed
-- Performing Test SUPPORT_MSSE2
-- Performing Test SUPPORT_MSSE2 - Failed
-- Determining F16C support
-- Performing Test COMPILER_SUPPORT_MF16C
-- Performing Test COMPILER_SUPPORT_MF16C - Failed
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
-- Found OpenCV: /usr/local (found version "4.1.1") found components: core highgui imgproc imgcodecs
-- OpenCV 4.1.1 found (/usr/local/lib/cmake/opencv4)
-- OpenCV_LIBS=opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
USE_LAPACK is ON
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
CMake Warning at 3rdparty/googletest/googletest/CMakeLists.txt:47 (project):
VERSION keyword not followed by a value or was followed by a value that
expanded to nothing.

-- Found PythonInterp: /usr/bin/python (found version "3.7.3")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found GTest: gtest
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- /mxnet/3rdparty/dmlc-core/cmake/build_config.h.in -> /mxnet/3rdparty/dmlc-core/include/dmlc/build_config.h
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

ADD_CFLAGS
ADD_LDFLAGS
USE_NNPACK
VERBOSE

-- Build files have been written to: /mxnet/build

Minimum reproducible example

Just building from source

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Build

@leleamol
Copy link
Contributor

@mxnet-label-bot add [Build]

@cyrusbehr
Copy link

Any updates on this issue @marcoabreu (it has been nearly 6 months). I am experiencing the same problem - although I am first exporting the library paths:

export YOUR_NNPACK_INSTALL_PATH=/home/nchafni/Cyrus/libs/NNPACK
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$YOUR_NNPACK_INSTALL_PATH/lib
export CFLAGS="-I/home/nchafni/Cyrus/libs/NNPACK/include/ -I/home/nchafni/Cyrus/libs/NNPACK/third-party/pthreadpool/include/"

cmake -DUSE_CPP_PACKAGE=1 -DUSE_NNPACK=1 -DUSE_CUDA=0 -DUSE_MKLDNN=1 -DUSE_LAPACK=0 -DUSE_OPENCV=0 -DUSE_OPENMP=0 ..

cmake output:

...
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    USE_NNPACK

How are people currently building with NNPACK??

@apkuhar
Copy link

apkuhar commented Jan 9, 2020

I managed to build an older version of mxnet with nnpack, but it was a couple of times slower than the binary build ob 1.5.1 on raspberry pi 4. Running a resnet50 based model. So might make no sense to try to build with nnpack anymore.

mxnet was also 2-3 times faster than tensorflow on the same model architecture on rpi4.

@szha szha added the v1.x Targeting v1.x branch label Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Build v1.x Targeting v1.x branch
Projects
None yet
Development

No branches or pull requests

7 participants