Code Monkey home page Code Monkey logo

Comments (5)

MatthewARM avatar MatthewARM commented on July 19, 2024

I think for non-Android, using a direct delegate is quite a bit simpler to set up than getting NNNAPI and the NN HAL driver service to work.

Using the direct delegate will also work on older Android devices where NNAPI is not present, or an old version, so it can have advantages even on Android. Especially for third-party applications which are not in control of which versions of NN HAL drivers have been installed.

What advantages do you see NNAPI having over using a direct delegate?

from android-nn-driver.

ek9852 avatar ek9852 commented on July 19, 2024

1.) We don't need to modify the application to use nnapi. e.g.
I can just download tensorflow lite prebuilt benchmark tool to test the performance without any application code changes.

2.) We don't need a NN HAL driver service on non-Andoird.
All need is android-nn-driver to generate a libneuralnetworks.so for dlopen by the tensorflow lite.
tensorflow lite already support native linux nnapi.

3.) I don't think the setup will be harder when using nnapi instead of direct delegate. We nly need to build and install ibneuralnetworks.so to /usr/lib, the tensorflow lite will dlopen it if it is found automatiacally.

4.) There are still unimplemented layers/support in android-nn-driver and direct delegate.
The andoirdd-nn-drvier implementation seems to be more completed though.
Right now , if the layer cannot be run in the GPU, it will fallback to CPU, and a single model can be break down into multiple parts . The model can still be run, but will end up with poor performance due to latency and transfer of data between gpu/cpu for those cpu fallback layers. I think we should focus the development time on implementation those un-implementation layer first. Right now I am doing a benchmark using direct delegate , but the performance is poor for models with unimplemented accel layers. Those are the models I am currently testing with:
https://ai-benchmark.com/tests.html

5.) For older Android support , application can call or use armnn directly.

from android-nn-driver.

ek9852 avatar ek9852 commented on July 19, 2024

There is nothing wrong have a direct delegate and an nnapi backend for nnapi deleage.
But we need to maintain 2 different codebase, and leave the user confuse about which one to use. I just want to have a positive discussion here only.

There are something need to be done for android-nn-driver to build for pure linux.
since pure linux don't have libneuralnetwork_common, we need to write/copy those api ANeuralNetworksModel_ from libneuralnetwork_common for pure linux implementation.
Also need a wrapper for android logging mechanism in pure linux environment.

from android-nn-driver.

ek9852 avatar ek9852 commented on July 19, 2024

@MatthewARM FYI Google already have out of Android (chrome os support for nnapi) which should be able to use in pure linux directly.
https://chromium.googlesource.com/chromiumos/platform2/+/master/nnapi

from android-nn-driver.

MatthewARM avatar MatthewARM commented on July 19, 2024

While I agree that NNAPI could be made to work on (non-Android) Linux, it doesn't seem to be a supported or promoted option within the NNAPI project, for example I've not seen any official guides on how to set it up.

So for the moment the path of least resistance for the Arm NN project is to have an NNAPI driver for Android system integrators, and a TensorFlow Lite delegate for other kinds of deployment.

from android-nn-driver.

Related Issues (20)

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.