tensorflow / tensorflow/text

The build system could use some :heart:

Open
#717 4 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

Ok so I just built TFT from source and found some potential issues.


The currently recommended run_build.sh casually runs a configure.sh script, that could be run manually beforehand similar to how the main TF code does is with ./configure. Maybe it would be nice to change the recommended way of building TFT to something like the snippet below?

./configure
bazel build [--config=option] //tensorflow_text/tools/pip_package:build_pip_package

I feel like that would take away some of the complexity of the build process but I may be wrong here oO.


There are currently open pull requests open (#680 and #505) fixing the bazel version. Without these PRs merged the repo will not build via bazelisk (or a bazel other than than 3.7.2, probably).


  • Many of the kernels will not build because of a missing @com_google_absl//absl/container:flat_hash_map dependency. The fix is either adding it to all failing kernels manually or adding it to the tf_cc_library rule, e.g. in oss_deps and removing it from //tensorflow_text_core/kernels:sentencepiece_kernels

Edit: Sent a PR changing this: #718


Installing the resulting pip_package does not work with TF built against head. That TF has version 2.7.0 and will trigger uninstallation of the custom version and will install TF 2.6.0. An undocumented workaround would be

IS_NIGHTLY=nightly ./bazel-bin/oss_scripts/pip_package/build_pip_package .

but even then the tft.__version__ is 2.6.0 (while the tf version is 2.7.0 on custom builds). Probably takes some work to change this behaviour though 😞 .


Before sending a PR I would like to know whether anyone else had the same issues, or if the above mentioned problems do not occur generally, in which case the problem would lie with my own setup.


As a sidenote: Are all the # tf:lib tensorflow dep lines in the BUILD files still required? It seems to me that some preprocessor would put something there, but I could not find such a parser anywhere and the build ran fine when I randomly removed those lines in random places 🤣

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

Review run_build.sh, configure.sh, the referenced BUILD files, and oss_scripts/pip_package/build_pip_package. Reproduce the Bazel, missing flat_hash_map, and TensorFlow version issues before separating them into actionable changes; compare with PR #718 and the other referenced pull requests. Done requires a confirmed scope and passing build and package-install checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.