Home

Awesome

<p align="center"><img src="https://maratyszcza.github.io/NNPACK/NNPACK.png" alt="NNPACK Logo" title="NNPACK"/></p>

NNPACK

BSD (2 clause) License Build Status

NNPACK is an acceleration package for neural network computations. NNPACK aims to provide high-performance implementations of convnet layers for multi-core CPUs.

NNPACK is not intended to be directly used by machine learning researchers; instead it provides low-level performance primitives leveraged in leading deep learning frameworks, such as PyTorch, Caffe2, MXNet, tiny-dnn, Caffe, Torch, and Darknet.

Platforms and requirements

EnvironmentArchitectureCPU requirements
Linuxx86-64AVX2 and 3-level cache hierarchy
LinuxARMNEON
LinuxARM64
macOSx86-64AVX2 and 3-level cache hierarchy
AndroidARMNEON
AndroidARM64
Androidx86
Androidx86-64
iOSARM
iOSARM64
EmscriptenAsm.js
EmscriptenWebAssembly

Features

Layers

Building

For most users, the recommended way to build NNPACK is through CMake:

mkdir build
cd build
cmake -G Ninja ..
ninja

Note: if ninja is not available on your system, configure without -G Ninja, and use make instead of ninja.

Building NNPACK - Using vcpkg

You can download and install NNPACK using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install NNPACK

The NNPACK port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Cross-compilation for Android

To cross-compile for Android, add extra configuration options for cmake: -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake (where $ANDROID_NDK is the path to Android NDK directorory, e.g. /opt/android-ndk-r15c) AND arguments from the table below

ABIExtra cmake argsRestrictions
armeabi-DANDROID_ABI=armeabi -DANDROID_TOOLCHAIN=gccRequires CPU with ARM NEON
armeabi-v7a-DANDROID_ABI=armeabi-v7a -DANDROID_TOOLCHAIN=gccRequires CPU with ARM NEON
arm64-v8a-DANDROID_ABI=arm64-v8a -DANDROID_TOOLCHAIN=clangRequires clang toolchain
x86-DANDROID_ABI=x86
x86_64-DANDROID_ABI=x86_64

Notes:

Ecosystem

Deep Learning Frameworks

Languages and Environments

Users

Acknowledgements

HPC Garage logo Georgia Tech College of Computing logo

The library is developed by Marat Dukhan of Georgia Tech with extensive advice from Nicolas Vasilache and Soumith Chintala of Facebook Artificial Intelligence Research. Andrew Tulloch of Facebook Artificial Intelligence Research contributed Caffe integration. We thank Andrew Lavin for fruitful discussions on Winograd transform-based implementations. NNPACK is a research project at Richard Vuduc's HPC Garage lab in the Georgia Institute of Technology, College of Computing, School of Computational Science and Engineering.

This material is based upon work supported by the U.S. National Science Foundation (NSF) Award Number 1339745. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of NSF.