IVGCVSW-2166 Update NnapiSupport.txt for the new AndroidNN 1.1 operations.

Change-Id: Ic402c0ee003b55cc0f14f4bb4a3a17a87558fb04
1 file changed
tree: dc0207f147dd0ec05ed73c167392bfdb5774d418
  1. 1.0/
  2. 1.1/
  3. test/
  4. .gitignore
  5. Android.bp
  6. android.hardware.neuralnetworks@1.0-service-armnn.rc
  7. android.hardware.neuralnetworks@1.1-service-armnn.rc
  8. Android.mk
  9. ArmnnDevice.cpp
  10. ArmnnDevice.hpp
  11. ArmnnDriver.hpp
  12. ArmnnDriverImpl.cpp
  13. ArmnnDriverImpl.hpp
  14. ArmnnPreparedModel.cpp
  15. ArmnnPreparedModel.hpp
  16. ConversionUtils.cpp
  17. ConversionUtils.hpp
  18. DriverOptions.cpp
  19. DriverOptions.hpp
  20. LICENSE
  21. ModelToINetworkConverter.cpp
  22. ModelToINetworkConverter.hpp
  23. NnapiSupport.txt
  24. README.md
  25. RequestThread.cpp
  26. RequestThread.hpp
  27. service.cpp
  28. setup.sh
  29. SystemPropertiesUtils.hpp
  30. Utils.cpp
  31. Utils.hpp
README.md

ArmNN Android Neural Networks driver

This directory contains the ArmNN driver for the Android Neural Networks API, implementing the android.hardware.neuralnetworks@1.0 HAL and android.hardware.neuralnetworks@1.1 HAL.

For more information about supported operations and configurations, see NnapiSupport.txt

Integration guide

Prerequisites

  1. Android source tree for Android O MR1 or later, in the directory <ANDROID_ROOT>
  2. Mali OpenCL driver integrated into the Android source tree

Procedure

  1. Place this source directory at <ANDROID_ROOT>/vendor/arm/android-nn-driver
  2. Run setup.sh
  3. Update the Android build environment to add the ArmNN driver. This ensures that the driver service is built and copied to the system/vendor/bin/hw directory in the Android image. To update the build environment, add to the contents of the variable PRODUCT_PACKAGES within the device-specific makefile that is located in the <ANDROID_ROOT>/device/<manufacturer>/<product> directory. This file is normally called device.mk:

For Android O or Android P, using NN API version (1.0), the following should be added to device.mk:

For Android P, a new version of the NN API is available (1.1), thus the following should be added to device.mk instead:

  1. Build Android as normal, i.e. run make in <ANDROID_ROOT>
  2. To confirm that the ArmNN driver has been built, check for driver service executable at

For example, if the ArmNN driver has been built with the NN API 1.0, check for the following file:

Please Note: Android O is only compatible with NN API version 1.0.

Testing

  1. Run the ArmNN driver service executable in the background. The following examples assume that the 1.0 version of the driver is being used:
  1. Run some code that exercises the Android Neural Networks API, for example Android's NeuralNetworksTest unit tests (note this is an optional component that must be built).
  1. To confirm that the ArmNN driver is being used to service the Android Neural Networks API requests, check for messages in logcat with the ArmnnDriver tag.

Using the GPU tuner

The GPU tuner is a feature of the Compute Library that finds optimum values for GPU acceleration tuning parameters. The recommended way of using it with ArmNN is to generate the tuning data during development of the Android image for a device, and use it in read-only mode during normal operation:

  1. Run the ArmNN driver service executable in tuning mode. The path to the tuning data must be writable by the service. The following examples assume that the 1.0 version of the driver is being used:
  1. Run a representative set of Android NNAPI testing loads. In this mode of operation, each NNAPI workload will be slow the first time it is executed, as the tuning parameters are being selected. Subsequent executions will use the tuning data which has been generated.
  2. Stop the service.
  3. Deploy the tuned parameters file to a location readable by the ArmNN driver service (for example, to a location within /vendor/etc).
  4. During normal operation, pass the location of the tuning data to the driver service (this would normally be done by passing arguments via Android init in the service .rc definition):

License

The android-nn-driver is provided under the MIT license. See LICENSE for more information. Contributions to this project are accepted under the same license.

Individual files contain the following tag instead of the full license text.

SPDX-License-Identifier: MIT

This enables machine processing of license information based on the SPDX License Identifiers that are available here: http://spdx.org/licenses/