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
adjust abseil version to be compatible between cmake tensorflowlite and bazel #50597
adjust abseil version to be compatible between cmake tensorflowlite and bazel #50597
Conversation
We don't accept new change for 2.5 branch except cherry-picks. Could you check if the cherry-pick of 8348b34 resolves the issue? |
I've cloned TF from scratch, switch on git cherry-pick 8348b348ac509c70a8730416be773781ddd6e2ed After that file
git describe --tags
20210324.0
git describe --tags
20200923.3 i.e. unfortunately it will still lead to mismatched symbols. Just in case I've compiled libs for usage of metal delegate bia bazel and build tensorflowlite itself via cmake. During compilation I've got unresolved symbols: Undefined symbols for architecture arm64:
"absl::lts_2020_09_23::UnknownError(absl::lts_2020_09_23::string_view)", referenced from:
tflite::gpu::metal::(anonymous namespace)::AllocateTensorMemory(id<MTLDevice>, tflite::gpu::StrongShape<(tflite::gpu::Layout)12> const&, tflite::gpu::TensorDescriptor const&, void const*, id<MTLBuffer> __autoreleasing*, id<MTLTexture> __autoreleasing*) in libmetal_spatial_tensor.a(metal_spatial_tensor.o) find tf_cherry_pick/_deps/ -iname '*.a' -exec nm -A {} \; | grep UnknownError
tf_cherry_pick/_deps//libabsl_status.a:status.cc.o: 0000000000002dc4 T __ZN4absl12lts_2021032412UnknownErrorENS0_11string_viewE and tensorflowlite itself contains symbols from abseil nm tf_cherry_pick/libtensorflow-lite.a | grep 20210324 | grep UnknownError
U __ZN4absl12lts_2021032412UnknownErrorENS0_11string_viewE |
We can merge this but only when we do a patch release on TF 2.5 |
Linking Bazel generated binary with CMake looks strange a use-case. |
Thats a good question! Bazel was a new beast for our team so we have started with old(?) good(?) cmake. Along the way, specifically when we try to adopt delegates, we realise that not all artefacts are buildable by it,
ps Thats probably offtopic here, but I would be more then happy to see how to |
At the moment version of libabseil library defined in bazel and cmake scripts are different:
Bazel will add those namespace prefix
lts_2020_09_23
and cmake this onelts_2020_02_25
.In case you compile tensorflowlite library via cmake and build remaining libraries for tensorflow lite using bazel (for example
libmetal-delegate
) you can't use link them later as you will get unresolved symbols:Unresolved symbol:
But, for libraries compiled by cmake (and used in tf lite):
nm ./tensorflow/lite/tf_build/_deps/abseil-cpp-build/absl/status/libabsl_status.a | grep UnknownError 0000000000003110 T __ZN4absl14lts_2020_02_2512UnknownErrorENS0_11string_viewE
absl::lts_2020_09_23::UnknownError(absl::lts_2020_09_23::string_view
vs
absl::lts_2020_02_25::UnknownError string_view