-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
status:awaiting LiteRTerinformation is sufficient and the issue is escalatedinformation is sufficient and the issue is escalatedtype:bugBugBugtype:docs-bugFor documentation bugsFor documentation bugstype:flex-opsFor issues related to building flex-ops or dynamic reduction in LiteRT resource consumptionFor issues related to building flex-ops or dynamic reduction in LiteRT resource consumption
Description
See the link below:
https://ai.google.dev/edge/litert/build/reduce_binary_size.md#building_custom_c_shared_objects_2
I am using the select tf ops in my tflite model. The ops are "save" and "restore". For these two ops, I have to build the full version libtensorflowlite_flex.so, which size is toooo big (160M from version 2.14.1, and 208M from version 2.18.1).
I followed the instructions at the link above to customize the flex lib as following:
- mkdir tensorflow_src/tmp
- create a BUILD file with content below in folder tmp.
load("//tensorflow/lite/delegates/flex:build_def.bzl", "tflite_flex_shared_library")
tflite_flex_shared_library(
name = "tensorflowlite_flex",
models = [
"cic.tflite",
],
)
- Put my tflite model cic.tflite in folder tmp too
- bazel build -c opt --config=monolithic //tmp:tensorflowlite_flex
I tried both tensorflow v2.14.1 & 2.18.1, with both amd64 & arm64 gcc toolchain (gcc 12.4 & 13.3). The generated libtensorflowlite_flex.so size doesn't get affected.
What might be wrong?
Thanks!
Metadata
Metadata
Assignees
Labels
status:awaiting LiteRTerinformation is sufficient and the issue is escalatedinformation is sufficient and the issue is escalatedtype:bugBugBugtype:docs-bugFor documentation bugsFor documentation bugstype:flex-opsFor issues related to building flex-ops or dynamic reduction in LiteRT resource consumptionFor issues related to building flex-ops or dynamic reduction in LiteRT resource consumption