Stable-Diffusion-Android
Stable-Diffusion-Android copied to clipboard
NNAPI doesn't work on Pixel 6a and maybe other Google Tensor devices?
Describe the bug When attempting to use NNAPI on at least my device (Pixel 6a) it fails run the model on the target device for whatever reason. I suspect this is due to the Tensor chips found in Pixel devices, it's a obviously rare and unusual CPU/TPU (based on Samsung Exynos apparently but with a cut down TPU added) so probably due to that I would imagine. Could be wrong though because as the app suggests it's a experimental feature on a already experimental backend might be unrelated to the TPU
To Reproduce Steps to reproduce the behavior:
- Get Pixel 6a or perhaps any device with Tensor CPU?
- Enable local Stable Diffusion
- See that it works fine without NNAPI
- Enable NNAPI
- Try to generate image
- See error
Expected behavior It is able to load the model and hopefully be much faster in theory
Screenshots
Smartphone (please complete the following information):
- OS: Android 13 with July 5, 2023 security patch running CalyxOS 4.11.3 (shouldn't matter as Google photos smart eraser under CalyxOS works which was made for the hardware)
- Version 0.5.0
Just got a bare metal Pixel 7 Pro running Graphene OS Android 13 - same for me. I assume the main reason for this is that model I decided to use for Local Diffusion is not optimized to run on NNAPI.
Next steps to try will be removing CPU_DISABLED flag for NNAPI, if it won't work there is a need to build a model that runs well on NNAPI.
Also can be possibly connected to issue with onnxruntime : https://github.com/microsoft/onnxruntime/issues/12793
It working on my Pixel7, android14, app ver.0.5.2-dev. works with 384x512, but crashes with 512x512
I am unable to test if this has been fixed on my device due to https://github.com/ShiftHackZ/Stable-Diffusion-Android/issues/100
i can confirm NNAPI works on the galaxy fold 4.
Still a issue unfortunately
I am starting to think it might be a white list or black list issue, not sure though
Is any progress being made on this? I'm having the same problem on a Pixel 8 running GrapheneOS
I'm also experiencing this on Pixel 9 Pro XL with Tensor G4