Git Product home page Git Product logo

appcoreopc / qnnpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pytorch/qnnpack

0.0 2.0 0.0 200 KB

Quantized Neural Network PACKage - mobile-optimized implementation of quantized neural network operators

Home Page: https://code.fb.com/ml-applications/qnnpack-open-source-library-for-optimized-mobile-deep-learning

License: Other

CMake 2.08% C++ 28.96% Python 0.63% C 55.32% Shell 1.73% Assembly 11.28%

qnnpack's Introduction

QNNPACK

QNNPACK (Quantized Neural Networks PACKage) is a mobile-optimized library for low-precision high-performance neural network inference. QNNPACK provides implementation of convolutional, deconvolutional, and fully connected neural network operators on quantized 8-bit tensors.

QNNPACK is not intended to be directly used by machine learning researchers; instead it provides low-level performance primitives for high-level deep learning frameworks. As of today, QNNPACK is integrated in PyTorch 1.0 with Caffe2 graph representation.

Building

QNNPACK provides standard CMake-based build scripts.

Native compilation

Users are recommended to use scripts/build-local.sh script to build QNNPACK for the host machine.

Cross-compilation for Android

To cross-compile for Android, set $ANDROID_NDK environment variable (where $ANDROID_NDK is the path to Android NDK directorory, e.g. /opt/android-ndk-r15c) and use one of the scripts from the table below:

ABI Build script Restrictions
armeabi-v7a scripts/build-android-armv7.sh Requires CPU with ARM NEON
arm64-v8a scripts/build-android-arm64.sh
x86 scripts/build-android-x86.sh

Notes:

  • On armeabi-v7a qnnp_initialize will fail with qnnp_status_unsupported_hardware if the mobile CPU does not support ARM NEON. Don't set -DANDROID_ARM_NEON=1 for QNNPACK compilation as it can make qnnp_initialize crash on CPUs without ARM NEON.

Cross-compilation for iOS

To cross-compile for iOS, clone ios-cmake, and set $IOS_CMAKE_TOOLCHAIN_FILE environment variable (where $IOS_CMAKE_TOOLCHAIN_FILE is the path to ios.toolchain.cmake file in ios-cmake), and use one of the scripts from the table below:

Architecture Build script Notes
armv7 scripts/build-ios-armv7.sh iPhone 3GS/4/4S
armv7 scripts/build-ios-armv7s.sh iPhone 5 and newer
arm64 scripts/build-ios-arm64.sh iPhone 5S and newer
arm64e scripts/build-ios-arm64e.sh iPhone XS/XR
i386 scripts/build-ios-i386.sh iPhone Simulator (32-bit)
x86_64 scripts/build-ios-x86_64.sh iPhone Simulator (64-bit)

Acknowledgements

QNNPACK is developed by Marat Dukhan, Yiming Wu, Hao Lu, and Bert Maher. We thank Andrew Tulloch and Yangqing Jia for advice during the development of QNNPACK.

License

QNNPACK is BSD licensed, as found in the LICENSE file.

qnnpack's People

Contributors

harouwu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.