Skip to content

Commit

Permalink
feat: Upgrade TensorFlow protobuf dependency to 3.21.9 (4.21.9 for Py…
Browse files Browse the repository at this point in the history
…thon)

PiperOrigin-RevId: 505264303
  • Loading branch information
vam-google authored and tensorflower-gardener committed Jan 28, 2023
1 parent 3c5bccd commit 84f4092
Show file tree
Hide file tree
Showing 18 changed files with 2,168 additions and 344 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Expand Up @@ -557,8 +557,8 @@ build:rbe_linux_py3_base --python_path="/usr/local/bin/python3.9"
build:rbe_linux_py3_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"

build:rbe_win --config=rbe
build:rbe_win --crosstool_top="//tensorflow/tools/toolchains/win/tf_win_01112023:toolchain"
build:rbe_win --extra_toolchains="//tensorflow/tools/toolchains/win/tf_win_01112023:cc-toolchain-x64_windows"
build:rbe_win --crosstool_top="//tensorflow/tools/toolchains/win/tf_win_01232023:toolchain"
build:rbe_win --extra_toolchains="//tensorflow/tools/toolchains/win/tf_win_01232023:cc-toolchain-x64_windows"
build:rbe_win --extra_execution_platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
build:rbe_win --host_platform="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
build:rbe_win --platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
Expand Down
1 change: 1 addition & 0 deletions tensorflow/opensource_only.files
Expand Up @@ -169,6 +169,7 @@ tensorflow/tools/toolchains/win/bazel_211/BUILD:
tensorflow/tools/toolchains/win/tf_win_01072022/BUILD:
tensorflow/tools/toolchains/win/tf_win_01112023/BUILD:
tensorflow/tools/toolchains/win/tf_win_01122022/BUILD:
tensorflow/tools/toolchains/win/tf_win_01232023/BUILD:
tensorflow/tools/toolchains/win/tf_win_01242022/BUILD:
tensorflow/tools/toolchains/win/tf_win_01252022/BUILD:
tensorflow/tools/toolchains/win/tf_win_02042022/BUILD:
Expand Down
15 changes: 8 additions & 7 deletions tensorflow/python/grappler/BUILD
@@ -1,6 +1,6 @@
load("//tensorflow:tensorflow.default.bzl", "cuda_py_test", "get_compatible_with_cloud", "tf_py_test", "tf_pybind_cc_library_wrapper", "tf_python_pybind_extension")
load("//tensorflow/core/platform:build_config.bzl", "tf_protos_grappler")
load("//tensorflow:tensorflow.bzl", "VERSION", "if_not_windows", "tf_python_pybind_static_deps")
load("//tensorflow:tensorflow.bzl", "if_not_windows")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
Expand Down Expand Up @@ -249,12 +249,13 @@ tf_python_pybind_extension(
"//tensorflow/core/grappler/optimizers:pywrap_required_hdrs",
"//tensorflow/core/grappler/verifiers:pywrap_required_hdrs",
],
dynamic_deps = ["//tensorflow/python:_pywrap_tensorflow_internal.so"] + select({
"//tensorflow:macos": ["//tensorflow:libtensorflow_framework.%s.dylib" % VERSION],
"//conditions:default": ["//tensorflow:libtensorflow_framework.so.%s" % VERSION],
"//tensorflow:windows": [],
}),
static_deps = tf_python_pybind_static_deps(),
# This fails Windows builds. Please check b/266870200 for details.
# dynamic_deps = ["//tensorflow/python:_pywrap_tensorflow_internal.so"] + select({
# "//tensorflow:macos": ["//tensorflow:libtensorflow_framework.%s.dylib" % VERSION],
# "//conditions:default": ["//tensorflow:libtensorflow_framework.so.%s" % VERSION],
# "//tensorflow:windows": [],
# }),
# static_deps = tf_python_pybind_static_deps(),
deps = [
"//tensorflow/core:framework_headers_lib",
"//tensorflow/core:lib_headers_for_pybind",
Expand Down
15 changes: 8 additions & 7 deletions tensorflow/python/saved_model/BUILD
Expand Up @@ -3,7 +3,7 @@

load("//tensorflow:strict.default.bzl", "py_strict_library")
load("//tensorflow:tensorflow.default.bzl", "cuda_py_test", "tf_py_test", "tf_pybind_cc_library_wrapper", "tf_python_pybind_extension")
load("//tensorflow:tensorflow.bzl", "VERSION", "if_google", "tf_python_pybind_static_deps")
load("//tensorflow:tensorflow.bzl", "if_google")

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
Expand Down Expand Up @@ -741,13 +741,14 @@ tf_python_pybind_extension(
"pywrap_saved_model_fingerprinting.h",
"pywrap_saved_model_metrics.h",
],
dynamic_deps = ["//tensorflow/python:_pywrap_tensorflow_internal.so"] + select({
"//tensorflow:macos": ["//tensorflow:libtensorflow_framework.%s.dylib" % VERSION],
"//conditions:default": ["//tensorflow:libtensorflow_framework.so.%s" % VERSION],
"//tensorflow:windows": [],
}),
# This fails Windows builds. Please check b/266870200 for details.
# dynamic_deps = ["//tensorflow/python:_pywrap_tensorflow_internal.so"] + select({
# "//tensorflow:macos": ["//tensorflow:libtensorflow_framework.%s.dylib" % VERSION],
# "//conditions:default": ["//tensorflow:libtensorflow_framework.so.%s" % VERSION],
# "//tensorflow:windows": [],
# }),
# static_deps = tf_python_pybind_static_deps(),
features = ["-layering_check"],
static_deps = tf_python_pybind_static_deps(),
visibility = ["//tensorflow/python/training:__subpackages__"],
deps = [
":pywrap_saved_model_headers",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/ci_build/release/requirements_common.txt
Expand Up @@ -11,7 +11,7 @@ h5py ~= 3.8.0 # Earliest version for Python 3.11
numpy ~= 1.22.0; python_version < '3.11'
numpy ~= 1.23.2; python_version >= '3.11' # Earliest version for Python 3.11
opt_einsum ~= 3.3.0
protobuf ~= 3.19.3 # NOTE: Earliest version for Python 3.10
protobuf ~= 3.20.3 # NOTE: Earliest version for Python 3.10
six ~= 1.16.0
termcolor ~= 2.1.1
typing_extensions ~= 3.10.0.0
Expand Down
12 changes: 9 additions & 3 deletions tensorflow/tools/def_file_filter/def_file_filter.py.tpl
Expand Up @@ -288,15 +288,21 @@ def main():
def_fp.write("\t ?NewSession@tensorflow@@YAPEAVSession@1@AEBUSessionOptions@1@@Z\n")
def_fp.write("\t ??1SavedModelBundleInterface@tensorflow@@UEAA@XZ\n")
def_fp.write("\t ?MaybeSavedModelDirectory@tensorflow@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z\n")
def_fp.write("\t ?_TensorShapeProto_default_instance_@tensorflow@@3VTensorShapeProtoDefaultTypeInternal@1@A\n")
def_fp.write("\t ?_GraphDef_default_instance_@tensorflow@@3VGraphDefDefaultTypeInternal@1@A\n")
def_fp.write("\t ??_7HistogramProto@tensorflow@@6B@\n")
def_fp.write("\t ??_7ConfigProto@tensorflow@@6B@\n") # for _pywrap_tfe
def_fp.write("\t ??_7CoordinatedTask@tensorflow@@6B@\n") # for _pywrap_tfe
def_fp.write("\t ??0CoordinatedTask@tensorflow@@QEAA@XZ\n") # for _pywrap_tfe
def_fp.write("\t ?InternalSwap@CoordinatedTask@tensorflow@@AEAAXPEAV12@@Z\n") # for _pywrap_tfe
def_fp.write("\t ?kSeed@MixingHashState@hash_internal@lts_20220623@absl@@0QEBXEB\n") # for _pywrap_tfcompile
def_fp.write("\t ?kEmptyGroup@container_internal@lts_20220623@absl@@3QBW4ctrl_t@123@B\n") # for _pywrap_tfcompile
def_fp.write("\t ??_7GraphDef@tensorflow@@6B@\n")
def_fp.write("\t ??_7DeviceProperties@tensorflow@@6B@\n")
def_fp.write("\t ??_7MetaGraphDef@tensorflow@@6B@\n")
def_fp.write("\t ??_7SavedModel@tensorflow@@6B@\n")
def_fp.write("\t ??0CoordinatedTask@tensorflow@@QEAA@XZ\n") # for _pywrap_tfe
def_fp.write("\t ?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z\n") # _pywrap_tfe
def_fp.write("\t ??1CoordinatedTask@tensorflow@@UEAA@XZ\n") # for _pywrap_tfe
def_fp.write("\t ?CopyFrom@CoordinatedTask@tensorflow@@QEAAXAEBV12@@Z\n") # for _pywrap_tfe
def_fp.write("\t ??0CoordinatedTask@tensorflow@@IEAA@PEAVArena@protobuf@google@@_N@Z\n") # for _pywrap_tfe

# Each symbols returned by undname matches the same position in candidates.
# We compare on undname but use the decorated name from candidates.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/pip_package/setup.py
Expand Up @@ -104,7 +104,7 @@ def standard_or_nightly(standard, nightly):
# See also: https://github.com/protocolbuffers/protobuf/issues/9954
# See also: https://github.com/tensorflow/tensorflow/issues/56077
# This is a temporary patch for now, to patch previous TF releases.
'protobuf >= 3.9.2, < 3.20',
'protobuf>=3.20.3,<5.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5',
'setuptools',
'six >= 1.12.0',
'termcolor >= 1.1.0',
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/toolchains/win/BUILD
Expand Up @@ -17,7 +17,7 @@ platform(
remote_execution_properties = """
properties:{
name: "container-image"
value: "docker://gcr.io/tensorflow-testing/tf-win2019-rbe@sha256:768fbd44022f6f4e3f76701bf2fc623f514ce9fe1a5796ea9533d2ac3e0474de"
value: "docker://gcr.io/tensorflow-testing/tf-win2019-rbe@sha256:6840d4ea7db934541cc36ef0ca10fb6703b28bd49f762d22768d6d5728969d03"
}
properties:{
name: "OSFamily"
Expand Down

0 comments on commit 84f4092

Please sign in to comment.