Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
The NNAPI Runtime module is a shared library that sits between an app and
backend drivers. The Android Neural Networks API
(NNAPI)
is an Android C API designed for running computationally intensive operations
for machine learning on mobile devices and enables hardware-accelerated
inference operations on Android devices. This module is updatable, meaning it
can receive updates to functionality outside of the normal Android release
cycle.
The benefits of modularizing the NNAPI Runtime include the following.
End users get improved consistency and compatibility.
Platform developers can patch bugs in the NNAPI runtime, improve NNAPI runtime
interaction with drivers, and deploy new features that improve NNAPI
capabilities, stability, performance, and health.
App developers get improved app compatibility and performance with updated CPU
kernels.
Module boundary
For Android 12 and higher, the NNAPI HAL revision
uses AIDL instead of HIDL.
For Android 11 and lower, the NNAPI Runtime module
boundary is platform/frameworks/ml/nn:libneuralnetworks.so.
Module format
The NNAPI Runtime module (com.android.neuralnetworks) is in
APEX format and is available for devices
running Android 11 or higher.
To verify the functionality of the NNAPI Runtime module, use the Android
Compatibility Test Suite (CTS) and Vendor Test Suite (VTS) tests.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-12 UTC."],[],[],null,["# NNAPI Runtime\n\n| **Deprecated:** Starting in Android 15, the\n| [NNAPI (NDK API)](https://developer.android.com/ndk/guides/neuralnetworks) is deprecated. The Neural Networks HAL interface\n| continues to be supported.\n|\n| For more information, see the\n| [NNAPI Migration Guide](https://developer.android.com/ndk/guides/neuralnetworks/migration-guide).\n\nThe NNAPI Runtime module is a shared library that sits between an app and\nbackend drivers. The [Android Neural Networks API\n(NNAPI)](https://developer.android.com/ndk/guides/neuralnetworks/)\nis an Android C API designed for running computationally intensive operations\nfor machine learning on mobile devices and enables hardware-accelerated\ninference operations on Android devices. This module is updatable, meaning it\ncan receive updates to functionality outside of the normal Android release\ncycle.\n\nThe benefits of modularizing the NNAPI Runtime include the following.\n\n- End users get improved consistency and compatibility.\n\n- Platform developers can patch bugs in the NNAPI runtime, improve NNAPI runtime\n interaction with drivers, and deploy new features that improve NNAPI\n capabilities, stability, performance, and health.\n\n- App developers get improved app compatibility and performance with updated CPU\n kernels.\n\nModule boundary\n---------------\n\nFor Android 12 and higher, the NNAPI HAL revision\nuses AIDL instead of HIDL.\n\nFor Android 11 and lower, the NNAPI Runtime module\nboundary is `platform/frameworks/ml/nn:libneuralnetworks.so`.\n\nModule format\n-------------\n\nThe NNAPI Runtime module (`com.android.neuralnetworks`) is in\n[APEX](/docs/core/ota/apex) format and is available for devices\nrunning Android 11 or higher.\n\nModule dependencies\n-------------------\n\nThis NNAPI Runtime module depends on the [NNAPI\nHAL](/docs/core/interaction/neural-networks#nnhal) and\n[AHardwareBuffer](/docs/core/interaction/neural-networks/memory-pools#ahardwarebuffer).\n\nTesting\n-------\n\nTo verify the functionality of the NNAPI Runtime module, use the Android\nCompatibility Test Suite (CTS) and Vendor Test Suite (VTS) tests."]]