tensorflow / tensorflow/text

Hide unnecessary symbols exposed in tensorflow_text/python/ops/*.so

Open
#786 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.3k
Forks
379
Avg merge
3h 30m
Merged PRs (30d)
8

Description

In order to run inference on some of the TF models that uses TF-text ops we need preload the custom ops from TensorFlow-Text in our C++ application.

Unfortunately, these .sos expose all their underlying symbols out. This is especially problematic for regex_spilt_ops.so. This shared library exposes re2 symbols that conflicts with our application which uses libre2-dev package. These conflicts lead to manifestation of weird behaviors our application.

Proposed Solution:
Hide all the symbols except for what are needed by TF for the custom ops. This is done with ldscript which is a standard practice for shared library.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the shared libraries under tensorflow_text/python/ops/*.so, especially regex_spilt_ops.so, are built and how the existing build handles linker options. Add an ldscript-based symbol export restriction for the TensorFlow custom ops, then verify that unrelated re2 symbols are no longer exposed while the custom ops remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tensorflow
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.