Repository navigation
Closed
Description
I've built a custom tf wheel (OS: Ubuntu 20.10, commit tensorflow/tensorflow@b19ef9b) with --config=noaws --config=nogcp --config=nohdfs --config=nonccl ( basically no boringssl, curl stuff and no filesystem ). When I tried to import tf-io ( both nightly and 0.17 ), I got this error
Traceback (most recent call last):
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 95, in <module>
plugin_ops = _load_library("libtensorflow_io_plugins.so", "fs")
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 68, in _load_library
raise NotImplementedError(
NotImplementedError: unable to open file: libtensorflow_io_plugins.so, from paths: ['/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io_plugins.so']
caused by: ['/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io_plugins.so: undefined symbol: curl_easy_cleanup']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/__init__.py", line 17, in <module>
from tensorflow_io.core.python.api.v0 import * # pylint: disable=wildcard-import
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/api/v0/__init__.py", line 18, in <module>
from tensorflow_io.core.python.ops.io_dataset import IODataset
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 98, in <module>
core_ops = _load_library("libtensorflow_io.so")
File "/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 68, in _load_library
raise NotImplementedError(
NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so']
caused by: ['/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so: undefined symbol: _ZNK10tensorflow4data15DatasetOpKernel11TraceStringERKNS_15OpKernelContextEb']
I think there are some ODR violations. I think tensorflow are trying to use it own symbols or tensorflow_io accidentally calls the symbols from tensorflow ( so when there is a full wheel, we don't see any error ). Though I am not sure if I have to use that custom wheel to rebuild tensorflow-io or it should work with any wheel.
@yongtang Could you help me with this issue ? Thank you !
Metadata
Metadata
Assignees
Labels
No labels
Activity
vnghia commentedon Dec 21, 2020
When importing
0.16, it throws:vnghia commentedon Dec 21, 2020
Inside
/home/vovannghia2409/programming/.venvs/tf-mini/lib/python3.8/site-packages/tensorflow, I found a folderinclude/external/aws/, it there any chance thattensorflow_iouses these headers instead of its own ?yongtang commentedon Dec 21, 2020
@vnvo2409 Which version of the tensorflow are you using to build customized wheels? The tensorflow-io needs to match specific version of tensorflow for C++ API compatibility, i.e., tensorflow-io 0.16.0 matches TF 2.3.0 and tensorflow-io 0.17.0 matches TF 2.4.0 (for C++ API).
For
_ZN10tensorflow4data15DatasetOpKernel11TraceStringEPNS_15OpKernelContextEb, I am almost sure this is caused by C++ incompatibility so a version match should fix the issue.For curl_easy_cleanup I think this is caused by symbols leaked from tensorflow to tensorflow-io.
yongtang commentedon Dec 21, 2020
@vnvo2409 This is very much a concern. In the past we count on using the same version of third-party libraries to avoid issues. Apparently this is causing big problems when AWS C++ SDK does not match.
yongtang commentedon Dec 21, 2020
@vnvo2409 Some of the header files are capture in the following I believe.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/build_pip_package.sh
I will take a look and see if we could remove AWS from the header files in tensorflow.
vnghia commentedon Dec 21, 2020
I think it is Tensorflow 2.5. ( I build with master cause I have the cache already. If I switch into another commit, it will take me half a day. )
vnghia commentedon Dec 21, 2020
@yongtang
I think we could use
--config=noawsfor that thing. I think the right thing we should do right now is rebuildingtensorflow-iowith a Tensorflow wheel without filesystem stuff to see if it success or not.vnghia commentedon Dec 21, 2020
@yongtang
Related to this issue, If I build
libtensorflow_io_plugins.soand load it intotensorflowusingtf.experimental.register_filesystem_plugin, it throwswhich makes me think that it use the symbol from TensorFlow core instead of Tensorflow_io because we should not have any mismatch here.
vnghia commentedon Dec 21, 2020
@yongtang
If I use the customized wheel to rebuild
libtensorflow_io_plugins.so, the segfault goes away.yongtang commentedon Dec 21, 2020
@vnvo2409 I created a PR #1241 to remove tensorflow's AWS header file from exposing. Can you give it a try and see if that will resolve the issue without a custom tensorflow wheel?
vnghia commentedon Dec 22, 2020
@yongtang One more thought about it. As far as I understand,
libtensorflow_io_plugins.soshould work with all TensorFlow wheel. I think it is the ultimate goal of my GSoC project.But
tensorflow_ioworks only with specific TensorFlow wheel and we can't uselibtensorflow_io_plugins.sowithout importingtensorflow_io. Does it defeat the purpose of theC APIof the Modular Filesystem ?Is there a way we could separate the filesystems with
tensorflow_io? Maybe another pip package liketensorflow_filesystem?yongtang commentedon Dec 22, 2020
@vnvo2409 When
import tensorflow_io as tfiois called, onlylibtensorflow_io_plugins.sois loaded. Thelibtensorflow_io.sowill not be loaded until it is actually used. You can see PR #1208 for details.vnghia commentedon Dec 22, 2020
@yongtang Thank you! In my case, the loading of
libtensorflow_io_plugins.sofailed, so it fell back to the loading oflibtensorflow_io.so.vnghia commentedon Jun 6, 2021
Close since this is resolved by #1426.