1*89c4ff92SAndroid Build Coastguard Worker<br> 2*89c4ff92SAndroid Build Coastguard Worker<div align="center"> 3*89c4ff92SAndroid Build Coastguard Worker <img src="Arm_NN_horizontal_blue.png" class="center" alt="Arm NN Logo" width="300"/> 4*89c4ff92SAndroid Build Coastguard Worker</div> 5*89c4ff92SAndroid Build Coastguard Worker 6*89c4ff92SAndroid Build Coastguard Worker* [Quick Start Guides](#quick-start-guides) 7*89c4ff92SAndroid Build Coastguard Worker* [Pre-Built Binaries](#pre-built-binaries) 8*89c4ff92SAndroid Build Coastguard Worker* [Software Overview](#software-overview) 9*89c4ff92SAndroid Build Coastguard Worker* [Get Involved](#get-involved) 10*89c4ff92SAndroid Build Coastguard Worker* [Contributions](#contributions) 11*89c4ff92SAndroid Build Coastguard Worker* [Disclaimer](#disclaimer) 12*89c4ff92SAndroid Build Coastguard Worker* [License](#license) 13*89c4ff92SAndroid Build Coastguard Worker* [Third-Party](#third-party) 14*89c4ff92SAndroid Build Coastguard Worker* [Build Flags](#build-flags) 15*89c4ff92SAndroid Build Coastguard Worker 16*89c4ff92SAndroid Build Coastguard Worker# Arm NN 17*89c4ff92SAndroid Build Coastguard Worker 18*89c4ff92SAndroid Build Coastguard Worker**Arm NN** is the **most performant** machine learning (ML) inference engine for Android and Linux, accelerating ML 19*89c4ff92SAndroid Build Coastguard Workeron **Arm Cortex-A CPUs and Arm Mali GPUs**. This ML inference engine is an open source SDK which bridges the gap 20*89c4ff92SAndroid Build Coastguard Workerbetween existing neural network frameworks and power-efficient Arm IP. 21*89c4ff92SAndroid Build Coastguard Worker 22*89c4ff92SAndroid Build Coastguard WorkerArm NN outperforms generic ML libraries due to **Arm architecture-specific optimizations** (e.g. SVE2) by utilizing 23*89c4ff92SAndroid Build Coastguard Worker**[Arm Compute Library (ACL)](https://github.com/ARM-software/ComputeLibrary/)**. To target Arm Ethos-N NPUs, Arm NN 24*89c4ff92SAndroid Build Coastguard Workerutilizes the [Ethos-N NPU Driver](https://github.com/ARM-software/ethos-n-driver-stack). For Arm Cortex-M acceleration, 25*89c4ff92SAndroid Build Coastguard Workerplease see [CMSIS-NN](https://github.com/ARM-software/CMSIS_5). 26*89c4ff92SAndroid Build Coastguard Worker 27*89c4ff92SAndroid Build Coastguard WorkerArm NN is written using portable **C++14** and built using [CMake](https://cmake.org/) - enabling builds for a wide 28*89c4ff92SAndroid Build Coastguard Workervariety of target platforms, from a wide variety of host environments. **Python** developers can interface with Arm NN 29*89c4ff92SAndroid Build Coastguard Workerthrough the use of our **Arm NN TF Lite Delegate**. 30*89c4ff92SAndroid Build Coastguard Worker 31*89c4ff92SAndroid Build Coastguard Worker 32*89c4ff92SAndroid Build Coastguard Worker## Quick Start Guides 33*89c4ff92SAndroid Build Coastguard Worker**The Arm NN TF Lite Delegate provides the widest ML operator support in Arm NN** and is an easy way to accelerate 34*89c4ff92SAndroid Build Coastguard Workeryour ML model. To start using the TF Lite Delegate, first download the **[Pre-Built Binaries](#pre-built-binaries)** for 35*89c4ff92SAndroid Build Coastguard Workerthe latest release of Arm NN. Using a Python interpreter, you can load your TF Lite model into the Arm NN TF Lite 36*89c4ff92SAndroid Build Coastguard WorkerDelegate and run accelerated inference. Please see this 37*89c4ff92SAndroid Build Coastguard Worker**[Quick Start Guide](delegate/DelegateQuickStartGuide.md)** on GitHub or this more comprehensive 38*89c4ff92SAndroid Build Coastguard Worker**[Arm Developer Guide](https://developer.arm.com/documentation/102561/latest/)** for information on how to accelerate 39*89c4ff92SAndroid Build Coastguard Workeryour TF Lite model using the Arm NN TF Lite Delegate. 40*89c4ff92SAndroid Build Coastguard Worker 41*89c4ff92SAndroid Build Coastguard WorkerThe fastest way to integrate Arm NN into an **Android app** is by using our **Arm NN AAR (Android Archive) file with 42*89c4ff92SAndroid Build Coastguard WorkerAndroid Studio**. The AAR file nicely packages up the Arm NN TF Lite Delegate, Arm NN itself and ACL; ready to be 43*89c4ff92SAndroid Build Coastguard Workerintegrated into your Android ML application. Using the AAR allows you to benefit from the **vast operator support** of 44*89c4ff92SAndroid Build Coastguard Workerthe Arm NN TF Lite Delegate. We held an **[Arm AI Tech Talk](https://www.youtube.com/watch?v=Zu4v0nqq2FA)** on how to 45*89c4ff92SAndroid Build Coastguard Workeraccelerate an ML Image Segmentation app in 5 minutes using this AAR file. To download the Arm NN AAR file, please see the 46*89c4ff92SAndroid Build Coastguard Worker**[Pre-Built Binaries](#pre-built-binaries)** section below. 47*89c4ff92SAndroid Build Coastguard Worker 48*89c4ff92SAndroid Build Coastguard WorkerWe also provide Debian packages for Arm NN, which are a quick way to start using Arm NN and the TF Lite Parser 49*89c4ff92SAndroid Build Coastguard Worker(albeit with less ML operator support than the TF Lite Delegate). There is an installation guide available 50*89c4ff92SAndroid Build Coastguard Worker[here](InstallationViaAptRepository.md) which provides instructions on how to install the Arm NN Core and the TF Lite 51*89c4ff92SAndroid Build Coastguard WorkerParser for Ubuntu 20.04. 52*89c4ff92SAndroid Build Coastguard Worker 53*89c4ff92SAndroid Build Coastguard WorkerTo build Arm NN from scratch, we provide the **[Arm NN Build Tool](build-tool/README.md)**. This tool consists of 54*89c4ff92SAndroid Build Coastguard Worker**parameterized bash scripts** accompanied by a **Dockerfile** for building Arm NN and its dependencies, including 55*89c4ff92SAndroid Build Coastguard Worker**[Arm Compute Library (ACL)](https://github.com/ARM-software/ComputeLibrary/)**. This tool replaces/supersedes the 56*89c4ff92SAndroid Build Coastguard Workermajority of the existing Arm NN build guides as a user-friendly way to build Arm NN. The main benefit of building 57*89c4ff92SAndroid Build Coastguard WorkerArm NN from scratch is the ability to **exactly choose which components to build, targeted for your ML project**.<br> 58*89c4ff92SAndroid Build Coastguard Worker 59*89c4ff92SAndroid Build Coastguard Worker 60*89c4ff92SAndroid Build Coastguard Worker## Pre-Built Binaries 61*89c4ff92SAndroid Build Coastguard Worker 62*89c4ff92SAndroid Build Coastguard Worker| Operating System | Architecture-specific Release Archive (Download) | 63*89c4ff92SAndroid Build Coastguard Worker|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 64*89c4ff92SAndroid Build Coastguard Worker| Android (AAR) | [](https://github.com/ARM-software/armnn/releases/download/v23.02/armnn_delegate_jni-23.02.aar) | 65*89c4ff92SAndroid Build Coastguard Worker| Android 10 "Q/Quince Tart" (API level 29) | [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-29-arm64-v8.2-a.tar.gz) [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-29-arm64-v8a.tar.gz) | 66*89c4ff92SAndroid Build Coastguard Worker| Android 11 "R/Red Velvet Cake" (API level 30) | [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-30-arm64-v8.2-a.tar.gz) [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-30-arm64-v8a.tar.gz) | 67*89c4ff92SAndroid Build Coastguard Worker| Android 12 "S/Snow Cone" (API level 31) | [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-31-arm64-v8.2-a.tar.gz) [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-31-arm64-v8a.tar.gz) | 68*89c4ff92SAndroid Build Coastguard Worker| Android 13 "T/Tiramisu" (API level 32) | [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-32-arm64-v8.2-a.tar.gz) [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-android-32-arm64-v8a.tar.gz) | 69*89c4ff92SAndroid Build Coastguard Worker| Linux | [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-linux-aarch64.tar.gz) [](https://github.com/ARM-software/armnn/releases/download/v23.02/ArmNN-linux-x86_64.tar.gz) | 70*89c4ff92SAndroid Build Coastguard Worker 71*89c4ff92SAndroid Build Coastguard Worker 72*89c4ff92SAndroid Build Coastguard Worker## Software Overview 73*89c4ff92SAndroid Build Coastguard WorkerThe Arm NN SDK supports ML models in **TensorFlow Lite** (TF Lite) and **ONNX** formats. 74*89c4ff92SAndroid Build Coastguard Worker 75*89c4ff92SAndroid Build Coastguard Worker**Arm NN's TF Lite Delegate** accelerates TF Lite models through **Python or C++ APIs**. Supported TF Lite operators 76*89c4ff92SAndroid Build Coastguard Workerare accelerated by Arm NN and any unsupported operators are delegated (fallback) to the reference TF Lite runtime - 77*89c4ff92SAndroid Build Coastguard Workerensuring extensive ML operator support. **The recommended way to use Arm NN is to 78*89c4ff92SAndroid Build Coastguard Worker[convert your model to TF Lite format](https://www.tensorflow.org/lite/convert) and use the TF Lite Delegate.** Please 79*89c4ff92SAndroid Build Coastguard Workerrefer to the [Quick Start Guides](#quick-start-guides) for more information on how to use the TF Lite Delegate. 80*89c4ff92SAndroid Build Coastguard Worker 81*89c4ff92SAndroid Build Coastguard WorkerArm NN also provides **TF Lite and ONNX parsers** which are C++ libraries for integrating TF Lite or ONNX models 82*89c4ff92SAndroid Build Coastguard Workerinto your ML application. Please note that these parsers do not provide extensive ML operator coverage as compared 83*89c4ff92SAndroid Build Coastguard Workerto the Arm NN TF Lite Delegate. 84*89c4ff92SAndroid Build Coastguard Worker 85*89c4ff92SAndroid Build Coastguard Worker**Android** ML application developers have a number of options for using Arm NN: 86*89c4ff92SAndroid Build Coastguard Worker* Use our Arm NN AAR (Android Archive) file with **Android Studio** as described in the 87*89c4ff92SAndroid Build Coastguard Worker[Quick Start Guides](#quick-start-guides) section 88*89c4ff92SAndroid Build Coastguard Worker* Download and use our [Pre-Built Binaries](#pre-built-binaries) for the Android platform 89*89c4ff92SAndroid Build Coastguard Worker* Build Arm NN from scratch with the Android NDK using this [GitHub guide](BuildGuideAndroidNDK.md) 90*89c4ff92SAndroid Build Coastguard Worker 91*89c4ff92SAndroid Build Coastguard WorkerArm also provides an [Android-NN-Driver](https://github.com/ARM-software/android-nn-driver) which implements a 92*89c4ff92SAndroid Build Coastguard Workerhardware abstraction layer (HAL) for the Android NNAPI. When the Android NN Driver is integrated on an Android device, 93*89c4ff92SAndroid Build Coastguard WorkerML models used in Android applications will automatically be accelerated by Arm NN. 94*89c4ff92SAndroid Build Coastguard Worker 95*89c4ff92SAndroid Build Coastguard WorkerFor more information about the Arm NN components, please refer to our 96*89c4ff92SAndroid Build Coastguard Worker[documentation](https://github.com/ARM-software/armnn/wiki/Documentation). 97*89c4ff92SAndroid Build Coastguard Worker 98*89c4ff92SAndroid Build Coastguard WorkerArm NN is a key component of the [machine learning platform](https://mlplatform.org/), which is part of the 99*89c4ff92SAndroid Build Coastguard Worker[Linaro Machine Intelligence Initiative](https://www.linaro.org/news/linaro-announces-launch-of-machine-intelligence-initiative/). 100*89c4ff92SAndroid Build Coastguard Worker 101*89c4ff92SAndroid Build Coastguard WorkerFor FAQs and troubleshooting advice, see the [FAQ](docs/FAQ.md) or take a look at previous 102*89c4ff92SAndroid Build Coastguard Worker[GitHub Issues](https://github.com/ARM-software/armnn/issues). 103*89c4ff92SAndroid Build Coastguard Worker 104*89c4ff92SAndroid Build Coastguard Worker 105*89c4ff92SAndroid Build Coastguard Worker## Get Involved 106*89c4ff92SAndroid Build Coastguard WorkerThe best way to get involved is by using our software. If you need help or encounter an issue, please raise it as a 107*89c4ff92SAndroid Build Coastguard Worker[GitHub Issue](https://github.com/ARM-software/armnn/issues). Feel free to have a look at any of our open issues too. 108*89c4ff92SAndroid Build Coastguard WorkerWe also welcome feedback on our documentation. 109*89c4ff92SAndroid Build Coastguard Worker 110*89c4ff92SAndroid Build Coastguard WorkerFeature requests without a volunteer to implement them are closed, but have the 'Help wanted' label, these can be 111*89c4ff92SAndroid Build Coastguard Workerfound [here](https://github.com/ARM-software/armnn/issues?q=is%3Aissue+label%3A%22Help+wanted%22+). 112*89c4ff92SAndroid Build Coastguard WorkerOnce you find a suitable Issue, feel free to re-open it and add a comment, so that Arm NN engineers know you are 113*89c4ff92SAndroid Build Coastguard Workerworking on it and can help. 114*89c4ff92SAndroid Build Coastguard Worker 115*89c4ff92SAndroid Build Coastguard WorkerWhen the feature is implemented the 'Help wanted' label will be removed. 116*89c4ff92SAndroid Build Coastguard Worker 117*89c4ff92SAndroid Build Coastguard Worker 118*89c4ff92SAndroid Build Coastguard Worker## Contributions 119*89c4ff92SAndroid Build Coastguard WorkerThe Arm NN project welcomes contributions. For more details on contributing to Arm NN please see the 120*89c4ff92SAndroid Build Coastguard Worker[Contributing page](https://mlplatform.org/contributing/) on the [MLPlatform.org](https://mlplatform.org/) website, 121*89c4ff92SAndroid Build Coastguard Workeror see the [Contributor Guide](CONTRIBUTING.md). 122*89c4ff92SAndroid Build Coastguard Worker 123*89c4ff92SAndroid Build Coastguard WorkerParticularly if you'd like to implement your own backend next to our CPU, GPU and NPU backends there are guides for 124*89c4ff92SAndroid Build Coastguard Workerbackend development: [Backend development guide](src/backends/README.md), 125*89c4ff92SAndroid Build Coastguard Worker[Dynamic backend development guide](src/dynamic/README.md). 126*89c4ff92SAndroid Build Coastguard Worker 127*89c4ff92SAndroid Build Coastguard Worker 128*89c4ff92SAndroid Build Coastguard Worker## Disclaimer 129*89c4ff92SAndroid Build Coastguard WorkerThe armnn/tests directory contains tests used during Arm NN development. Many of them depend on third-party IP, model 130*89c4ff92SAndroid Build Coastguard Workerprotobufs and image files not distributed with Arm NN. The dependencies for some tests are available freely on 131*89c4ff92SAndroid Build Coastguard Workerthe Internet, for those who wish to experiment, but they won't run out of the box. 132*89c4ff92SAndroid Build Coastguard Worker 133*89c4ff92SAndroid Build Coastguard Worker 134*89c4ff92SAndroid Build Coastguard Worker## License 135*89c4ff92SAndroid Build Coastguard WorkerArm NN is provided under the [MIT](https://spdx.org/licenses/MIT.html) license. 136*89c4ff92SAndroid Build Coastguard WorkerSee [LICENSE](LICENSE) for more information. Contributions to this project are accepted under the same license. 137*89c4ff92SAndroid Build Coastguard Worker 138*89c4ff92SAndroid Build Coastguard WorkerIndividual files contain the following tag instead of the full license text. 139*89c4ff92SAndroid Build Coastguard Worker 140*89c4ff92SAndroid Build Coastguard Worker SPDX-License-Identifier: MIT 141*89c4ff92SAndroid Build Coastguard Worker 142*89c4ff92SAndroid Build Coastguard WorkerThis enables machine processing of license information based on the SPDX License Identifiers that are available 143*89c4ff92SAndroid Build Coastguard Workerhere: http://spdx.org/licenses/ 144*89c4ff92SAndroid Build Coastguard Worker 145*89c4ff92SAndroid Build Coastguard Worker 146*89c4ff92SAndroid Build Coastguard Worker## Inclusive language commitment 147*89c4ff92SAndroid Build Coastguard WorkerArm NN conforms to Arm's inclusive language policy and, to the best of our knowledge, does not contain any non-inclusive language. 148*89c4ff92SAndroid Build Coastguard Worker 149*89c4ff92SAndroid Build Coastguard WorkerIf you find something that concerns you, please email [email protected] 150*89c4ff92SAndroid Build Coastguard Worker 151*89c4ff92SAndroid Build Coastguard Worker 152*89c4ff92SAndroid Build Coastguard Worker## Third-party 153*89c4ff92SAndroid Build Coastguard WorkerThird party tools used by Arm NN: 154*89c4ff92SAndroid Build Coastguard Worker 155*89c4ff92SAndroid Build Coastguard Worker| Tool | License (SPDX ID) | Description | Version | Provenience 156*89c4ff92SAndroid Build Coastguard Worker|----------------|-------------------|------------------------------------------------------------------|-------------|------------------- 157*89c4ff92SAndroid Build Coastguard Worker| cxxopts | MIT | A lightweight C++ option parser library | SHA 12e496da3d486b87fa9df43edea65232ed852510 | https://github.com/jarro2783/cxxopts 158*89c4ff92SAndroid Build Coastguard Worker| doctest | MIT | Header-only C++ testing framework | 2.4.6 | https://github.com/onqtam/doctest 159*89c4ff92SAndroid Build Coastguard Worker| fmt | MIT | {fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams. | 7.0.1 | https://github.com/fmtlib/fmt 160*89c4ff92SAndroid Build Coastguard Worker| ghc | MIT | A header-only single-file std::filesystem compatible helper library | 1.3.2 | https://github.com/gulrak/filesystem 161*89c4ff92SAndroid Build Coastguard Worker| half | MIT | IEEE 754 conformant 16-bit half-precision floating point library | 1.12.0 | http://half.sourceforge.net 162*89c4ff92SAndroid Build Coastguard Worker| mapbox/variant | BSD | A header-only alternative to 'boost::variant' | 1.1.3 | https://github.com/mapbox/variant 163*89c4ff92SAndroid Build Coastguard Worker| stb | MIT | Image loader, resize and writer | 2.16 | https://github.com/nothings/stb 164*89c4ff92SAndroid Build Coastguard Worker 165*89c4ff92SAndroid Build Coastguard Worker 166*89c4ff92SAndroid Build Coastguard Worker## Build Flags 167*89c4ff92SAndroid Build Coastguard WorkerArm NN uses the following security related build flags in their code: 168*89c4ff92SAndroid Build Coastguard Worker 169*89c4ff92SAndroid Build Coastguard Worker| Build flags | 170*89c4ff92SAndroid Build Coastguard Worker|---------------------| 171*89c4ff92SAndroid Build Coastguard Worker| -Wall | 172*89c4ff92SAndroid Build Coastguard Worker| -Wextra | 173*89c4ff92SAndroid Build Coastguard Worker| -Wold-style-cast | 174*89c4ff92SAndroid Build Coastguard Worker| -Wno-missing-braces | 175*89c4ff92SAndroid Build Coastguard Worker| -Wconversion | 176*89c4ff92SAndroid Build Coastguard Worker| -Wsign-conversion | 177*89c4ff92SAndroid Build Coastguard Worker| -Werror | 178