Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tflite Neuron delegate fails to apply NNAPI delegate on MT6893 #12

Open
adarsh044 opened this issue Mar 9, 2023 · 7 comments
Open

Tflite Neuron delegate fails to apply NNAPI delegate on MT6893 #12

adarsh044 opened this issue Mar 9, 2023 · 7 comments

Comments

@adarsh044
Copy link

I am trying to run a tflite SR model (few convolution layers & casting layer) on the MT6893 using an Android app with NeuronDelegate ,added as AAR dependency.

I declared the Neurondelegate class like this :

`public NeuronDelegate neuronDelegate;
neuronDelegate = new NeuronDelegate();

......

new Interpreter.Options().addDelegate(neuronDelegate).setNumThreads(4))
`

I get the following logs :
`
I neuron error: Neuron adapter API exists: 0
I Found interface mtk-dsp (version = ACCELERATOR_APUSYS)
I Found interface mtk-gpu (version = ACCELERATOR_APUSYS)
I Found interface mtk-mdla (version = ACCELERATOR_APUSYS)
I Found interface mtk-neuron (version = ACCELERATOR_APUSYS)
I Created TensorFlow Lite delegate for NNAPI.
Internal error: Failed to apply delegate: NN API returned error ANEURALNETWORKS_BAD_DATA at line 4483 while completing NNAPI compilation.

`
So Error here is :

  1. Failed to apply delegate: NN API returned error ANEURALNETWORKS_BAD_DATA at line 4483 while completing NNAPI compilation.
  2. I neuron error: Neuron adapter API exists: 0

What could be the error here : Is there something wrong with the declaration , if not what could be the error here. ?

Regards
Adarsh

@freedomtan
Copy link
Collaborator

I neuron error: Neuron adapter API exists: 0 means the Neuron Delegate could not find necessary underlying libraries, so it falls back to NNAPI (calling NNAPI delegate for you). Probably because your Android is not updated?

For the NN API error: it's returned by NNAPI runtime. You can find the clue in the AOSP NNAPI runtime source code.

@adarsh044
Copy link
Author

Hi @freedomtan

I : neuron error: Neuron adapter API exists: 0 still persists after updating Android . Current android verison : 12, updated to latest patch.
I am thinking is the AI processor integrated in with the Dimensity 1200-AI not accessible or does not support the Tflite Neuron delegate.

@freedomtan
Copy link
Collaborator

Hi @freedomtan

I : neuron error: Neuron adapter API exists: 0 still persists after updating Android . Current android verison : 12, updated to latest patch. I am thinking is the AI processor integrated in with the Dimensity 1200-AI not accessible or does not support the Tflite Neuron delegate.

Sorry to hear that. I don't have any Dimensity 1200 phone. Something must be wrong. I have an old Dimesity 1000 device, running Android 10, on my desk, latest Neuron delegate still works on it.

Does CLI program, e.g., benchmark_model_plus_neuron_delegate, work?

@adarsh044
Copy link
Author

Hi @freedomtan

Thanks for the response.

I am able to run my app on the Dimensity 9000+.
I would like to close the issue.

Before that I have a couple of questions:
1.Are there any documentation on the delegate, which contain info about what operations does the delegate support, what sort of inputs can be processed by the delegate like : int8 , float32 etc.
2. Is there any way to access the nueropilot documentation, I have written mail to register but not getting any response.

Regards
Adarsh

@freedomtan
Copy link
Collaborator

Hi @freedomtan

Thanks for the response.

I am able to run my app on the Dimensity 9000+. I would like to close the issue.

Before that I have a couple of questions: 1.Are there any documentation on the delegate, which contain info about what operations does the delegate support, what sort of inputs can be processed by the delegate like : int8 , float32 etc. 2. Is there any way to access the nueropilot documentation, I have written mail to register but not getting any response.

Regards Adarsh

  1. basically, Neuron Delegate supports a superset of NNAPI delegate. @code0910: do we have documentation on what are supported?
  2. for NeuroPilot, please contact [email protected]

@adarsh044
Copy link
Author

adarsh044 commented Mar 23, 2023

Hi @freedomtan

Thanks for the response.

  1. I was asking for the documentation on which ops are supported as I am trying to run super resolution model on the neuron . It has a tensorflow cast layer to convert to uint8 , which seems is not supported by the delegate. @code0910 It would be helpful if could confirm , if there are any documentation.
  2. Also does the neuron delegate support fp16 operations?

Regards
Adarsh

@adarsh044
Copy link
Author

Hi @freedomtan

Any updates on the documentation?

Regards
Adarsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants