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: cyclic dependency error Tflite simple opaque delegate #65146

Closed
suyash-narain opened this issue Apr 5, 2024 · 4 comments
Closed

TFLite: cyclic dependency error Tflite simple opaque delegate #65146

suyash-narain opened this issue Apr 5, 2024 · 4 comments
Assignees
Labels
comp:lite TF Lite related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues

Comments

@suyash-narain
Copy link

suyash-narain commented Apr 5, 2024

I am using tf v2.14 and would like to build tflite opaque delegate such that its references are included in the tflite shared library libtensorflowlite.so

when i include simple_opaque_delegate build targets in the tflite BUILD file //tensorflow/lite/BUILD, I get the cyclic dependency error:

ERROR: /tensorflow/tensorflow/lite/BUILD:479:23: in cc_library rule //tensorflow/lite:framework_stable: cycle in dependency graph:
    //tensorflow/lite:libtensorflowlite.so (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
    //tensorflow/lite/kernels:builtin_ops_all_linked (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
.-> //tensorflow/lite:framework_stable (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite:cc_api_stable (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/delegates/external:external_delegate (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/delegates/utils:simple_opaque_delegate (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/c:c_api_experimental (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/c:c_api (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/core/c:c_api (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite:create_op_resolver_with_builtin_ops (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/core:create_op_resolver_with_builtin_ops (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/core/kernels:builtin_ops (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/kernels:builtin_op_kernels (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
|   //tensorflow/lite/kernels:variable_op_kernels (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
`-- //tensorflow/lite:framework_stable (adc6a2edc02c0f50690f56ac867f112f9172c147f91c4ef0c8b89d477f7c8720)
ERROR: analysis of target '//tensorflow/lite:libtensorflowlite.so' failed; build aborted

I add the build target below this line:

"//tensorflow/lite/c:common_internal",

adding it as a dep to build the tensorflowlite shared library //tensorflow/lite/delegates/utils:simple_opaque_delegate

how do i ensure simple_opaque_delegate is built and its symbols present in the tensorflowlite shared library?
If i replace simple_opaque_delegate with simple_delegate, i don't get this error though and shared library builds perfectly.
thanks

@Venkat6871 Venkat6871 added the comp:lite TF Lite related issues label Apr 10, 2024
@LakshmiKalaKadali
Copy link
Contributor

Hi @suyash-narain,
As per my knowledge, the error you are encountering is a classic cyclic dependency issue when building the TensorFlow Lite library. First try the following commands to resolve the cyclic dependency.
git submodule foreach git clean -dfx
git submodule update and
instead of including simple_opaque_delegate directly in libtensorflowlite.so, try to build it as a separate static library. This library can then be linked with applications that need the delegate functionality, without requiring it to be part of the core TensorFlow Lite library.
Have you tried with latest TF 2.16.1 stable version?. If not resolved with this, please help us with reproducible code to resolve the issue.
Thank You

@LakshmiKalaKadali LakshmiKalaKadali added stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues labels Apr 12, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Apr 20, 2024
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants