Skip to content

Commit

Permalink
Updating tensorflow dependency to >=2.12,<3 and protobuf to `>=3.20…
Browse files Browse the repository at this point in the history
….3,<5`.

TF 2.12 updated their packaged protobuf C++ dependency to 3.21.9 making it incompatible with our packaged build in TFMD and s2t. Python's protobuf version 3.20.3 is the minimal version compatible with the new build and python 3.10. In general this protobuf bound lets TF dictate the version. This should fix our builds against released and nightly TF.

PiperOrigin-RevId: 522143653
  • Loading branch information
iindyk authored and tfx-copybara committed Apr 5, 2023
1 parent 967ba5d commit 49a7693
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

## Bug Fixes and Other Changes

* Depends on `tensorflow>=2.12.0,<2.13`.
* Depends on `protobuf>=3.20.3,<5`.

## Breaking Changes

## Deprecations
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ tf_configure(name = "local_config_tf")
# 3. Request the new archive to be mirrored on mirror.bazel.build for more
# reliable downloads.

_TENSORFLOW_GIT_COMMIT = "d5b57ca93e506df258271ea00fc29cf98383a374" # tf 2.11.0
_TENSORFLOW_ARCHIVE_SHA256 = "37abf3d45a34e11012ef60ee6dcd79e317384b62d319b6346cc2a94eb447e172"
_TENSORFLOW_GIT_COMMIT = "0db597d0d758aba578783b5bf46c889700a45085" # tf 2.12.0
_TENSORFLOW_ARCHIVE_SHA256 = "e97c242d13e386192e3a9f60fd674461b6595b02b3a2a48edd6fb11aeee7e038"

http_archive(
name = "org_tensorflow",
Expand Down
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SHARED_LIBRARY_DIR=${TF_LFLAGS:2}
SHARED_LIBRARY_NAME=$(echo $TF_LFLAGS | rev | cut -d":" -f1 | rev)
if ! [[ $TF_LFLAGS =~ .*:.* ]]; then
if [[ "$(uname)" == "Darwin" ]]; then
SHARED_LIBRARY_NAME="libtensorflow_framework.dylib"
SHARED_LIBRARY_NAME="libtensorflow_framework.2.dylib"
else
SHARED_LIBRARY_NAME="libtensorflow_framework.so"
fi
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def select_constraint(default, nightly=None, git_master=None):
# TODO(b/263060885): Remove the explicit numpy dependency once TF works
# with numpy>=1.24.
'numpy<1.24',
'protobuf>=3.13,<4',
'tensorflow>=2.11.0,<2.12',
'protobuf>=3.20.3,<5',
'tensorflow>=2.12,<3',
'tensorflow-metadata' + select_constraint(
default='>=1.13.0,<1.14.0',
nightly='>=1.14.0.dev',
Expand Down
2 changes: 1 addition & 1 deletion struct2tensor/struct2tensor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def s2t_proto_library_py(name, proto_library, srcs = [], deps = [], oss_deps = [
name = name,
srcs = srcs,
srcs_version = "PY3ONLY",
deps = ["@com_google_protobuf//:protobuf_python"] + oss_deps,
deps = ["@com_google_protobuf//:well_known_types_py_pb2"] + oss_deps,
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = visibility,
Expand Down
4 changes: 2 additions & 2 deletions struct2tensor/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def struct2tensor_workspace():
urls = ["https://github.com/apache/arrow/archive/%s.zip" % ARROW_COMMIT],
)

_TFMD_COMMIT_HASH = "e34b5df6d644f32f7a30b4a5c89680fdf7b82519" # 1.13.0
_TFMD_COMMIT_HASH = "ab1a22c7a1ad8485d52f660fbf285f6948f0f6b2" # 1.12.0 with updated protobuf
http_archive(
name = "com_github_tensorflow_metadata",
sha256 = "c3ef479c7b6d1e2300edf58591ba1ed9836b8088ba134dd4e9cb8b88ec887037",
sha256 = "6950a27c748c59bdac6cb5faa4215478a72f19897dee6ee6b67f5c749291f8b7",
strip_prefix = "metadata-%s" % _TFMD_COMMIT_HASH,
urls = [
"https://github.com/tensorflow/metadata/archive/%s.tar.gz" % _TFMD_COMMIT_HASH,
Expand Down

0 comments on commit 49a7693

Please sign in to comment.