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

Problems with TFLite operator performance profiling #596

Open
pkgoogle opened this issue Jan 24, 2025 · 1 comment
Open

Problems with TFLite operator performance profiling #596

pkgoogle opened this issue Jan 24, 2025 · 1 comment
Assignees
Labels
status:awaiting user response awaiting user response status:need more data need more data

Comments

@pkgoogle
Copy link

Original Issue: tensorflow/tensorflow#83331
Original Author: @4570235

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

tf 2.16.1

Custom code

No

OS platform and distribution

No response

Mobile device

Android Google Pixel 6

Python version

No response

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I want to profile the operator performance of my custom tflite model in android phone 'Google Pixel 6'.
I have followed the tutorial measurement and built a very simple test program [source code]. However, I encounter some problems.

Firstly, when I tested the model 'mobilenetv1.tflite' from tflite example image_classification, if my program depends on the newest version of TFLite

implementation 'org.tensorflow:tensorflow-lite:2.16.1'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.4'

then the Android Studio CPU Profiler shows
image

I cannot see all the operators. After some testing, I figure out that the maximum version of TFLite that works is tensorflow-lite:2.12.0 with tensorflow-lite-support:0.4.0.

implementation 'org.tensorflow:tensorflow-lite:2.12.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.4.0'

Here's the result:
image

So, is this a bug? How can I trace operator performance with the newest version of TFLite?

Secondly, with tensorflow-lite:2.12.0 and tensorflow-lite-support:0.4.0 mentioned above, I tried to trace my custom model which is very similar to Qualcomm's 'quicksrnetsmall.tflite'. Let's take 'quicksrnetsmall.tflite' as an sample and the Profiler shows
image

I cannot see any operators. How can I fix it?

Standalone code to reproduce the issue

https://github.com/4570235/LiteRTStarter/blob/master/app/src/main/java/com/handleychen/litertstarter/Benchmark.java

Relevant log output

No response

@pkgoogle pkgoogle self-assigned this Jan 24, 2025
@pkgoogle
Copy link
Author

Hi @4570235, can you update to the LiteRT packages and see if this works or not? Thanks.

@pkgoogle pkgoogle added status:need more data need more data status:awaiting user response awaiting user response labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting user response awaiting user response status:need more data need more data
Projects
None yet
Development

No branches or pull requests

1 participant