-
Notifications
You must be signed in to change notification settings - Fork 74k
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
2.12.0: memory leak in TFLite's tflite::Interpreter::Invoke() #66736
Comments
I am able to reproduce this in the benchmark android_aarch64_benchmark_model of the tf nightly build |
@sushreebarsa can you take a look? |
@gestalone Could you please try to upgrade to the latest TF version as memory leak issues are often addressed in subsequent versions. Kindly let us know if it is appearing in the latest and try to explore if your stable delegate library supports alternative back-ends besides OpenCL? |
Hi @sushreebarsa, I was able to reproduce it with the benchmark 2.16 version. I tried the opengl backend of the gpu delegate, but unfortunately is not working. |
@sawantkumar, any help here? |
Hi @gestalone , Sure thing, let me replicate your issue . However gpu delegates today primarily use "openCL" as their backend instead of "openGL" . I will get back to you . |
Hi @sawantkumar! |
Hi @gestalone , I used "android_aarch64_benchmark_model" on pixel 6a to test a tflite model using the below command
I used android stuido pofiler to check the memory used by the "tflite benchmark activity " process and it didn't show any memory leaks . The memory usage spiked up to 130 MB when using the benchmark tool but it came back to normal once the benchmarking was complete. Can you please try out your code on a different phone and let me know if you are able to replicate this issue on a different phone. Also if possible , can you provide your tflite model for easier debugging for me. |
I was looking a bit and I found this: |
@sawantkumar Hi! Best you can close and thanks for all the help |
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
binary
TensorFlow version
2.12.0
Custom code
Yes
OS platform and distribution
Cross-build from 'Windows:x86_64' to 'Android:armv8'
Mobile device
Android with Snapdragon 820
Python version
No response
Bazel version
No response
GCC/compiler version
CXX compiler identification is Clang 14.0.7
CUDA/cuDNN version
no
GPU model and memory
Snapdragon 820 with Adreno 530
Current behavior?
Running the invoke for a tflite model using the gpu delegate, with opencl backend.
It goes fast and well, the problem is that exist a memory leak, that is increasing, not sure how to fix it. Not sure if it's an error on the opencl implementation, on the drivers of the adreno gpu or in the delegate implementation.
Standalone code to reproduce the issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: