Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Upgrade for TensorFlow 2.5.0
  • Loading branch information
saudet authored and karllessard committed Jun 8, 2021
commit 23c1dee18c7fce19a6f86d025c88e103a578b475
34 changes: 32 additions & 2 deletions tensorflow-core/tensorflow-core-api/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ build --define open_source_build=true
test --define open_source_build=true

# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1
build --java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
build --host_java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
build --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain
build --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain

# Please note that MKL on MacOS or windows is still not supported.
# If you would like to use a local MKL instead of downloading, please set the
Expand Down Expand Up @@ -616,3 +616,33 @@ build:release_gpu_linux_cuda_10_1 --config=release_gpu_linux
build:release_gpu_linux_cuda_10_1 --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.1"
build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDA_VERSION="10"
build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDNN_VERSION="7"

# Address sanitizer
# CC=clang bazel build --config asan
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -g
build:asan --copt -O3
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address

# Memory sanitizer
# CC=clang bazel build --config msan
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DADDRESS_SANITIZER
build:msan --copt -g
build:msan --copt -O3
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory

# Undefined Behavior Sanitizer
# CC=clang bazel build --config ubsan
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -g
build:ubsan --copt -O3
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -lubsan
33 changes: 18 additions & 15 deletions tensorflow-core/tensorflow-core-api/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,31 @@ http_archive(
patch_args = ["-p1"],
patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"],
urls = [
"https://github.com/tensorflow/tensorflow/archive/v2.4.1.tar.gz",
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.5.0-rc1.tar.gz",
],
sha256 = "f681331f8fc0800883761c7709d13cda11942d4ad5ff9f44ad855e9dc78387e0",
strip_prefix = "tensorflow-2.4.1"
sha256 = "354e58a2883210575ae7deacc9ab4a7ce00a3c60315151c2efbb734255e73713",
strip_prefix = "tensorflow-2.5.0-rc1"
)

# START: Upstream TensorFlow dependencies
# TensorFlow build depends on these dependencies.
# Needs to be in-sync with TensorFlow sources.
http_archive(
name = "io_bazel_rules_closure",
sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13
],
)
# END: Upstream TensorFlow dependencies
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")

tf_workspace3()

load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace()
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")

tf_workspace2()

load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")

tf_workspace1()

load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")

tf_workspace0()
# END: Upstream TensorFlow dependencies

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
Expand Down
83 changes: 35 additions & 48 deletions tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/bfc_memory_map.proto 2021-02-08 09:43:41.885495355 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/bfc_memory_map.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/bfc_memory_map.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/bfc_memory_map.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/bfc_memory_map.proto 2021-04-27 10:18:43.910313526 +0900
@@ -3,6 +3,9 @@
package tensorflow;

Expand All @@ -11,9 +11,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/bfc_memory_map.proto tensorf

// Some of the data from AllocatorStats
message MemAllocatorStats {
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/data/experimental/snapshot.proto 2021-02-08 09:40:24.584065472 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/snapshot.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/snapshot.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/snapshot.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/snapshot.proto 2021-04-27 10:19:52.002448627 +0900
@@ -6,6 +6,10 @@
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
Expand All @@ -25,9 +25,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/data/experimental/snapshot.p
// Each SnapshotRecord represents one batch of pre-processed input data. A batch
// consists of a list of tensors that we encode as TensorProtos. This message
// doesn't store the structure of the batch.
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/device_properties.proto 2021-02-08 09:41:23.317918806 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/device_properties.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/device_properties.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/device_properties.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/device_properties.proto 2021-04-27 10:19:52.002448627 +0900
@@ -19,6 +19,8 @@

option cc_enable_arenas = true;
Expand All @@ -37,9 +37,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/device_properties.proto tens
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

message DeviceProperties {
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/saved_object_graph.proto 2021-02-08 09:41:50.066852012 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/saved_object_graph.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/saved_object_graph.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/saved_object_graph.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/saved_object_graph.proto 2021-04-27 10:19:52.003448629 +0900
@@ -11,6 +11,9 @@

option cc_enable_arenas = true;
Expand All @@ -50,9 +50,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/saved_object_graph.proto ten

// A SavedObjectGraph is part of object-based SavedModels in TF 2.0. It
// describes the directed graph of Python objects (or equivalent in other
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/struct.proto 2021-02-08 09:42:06.645810614 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/struct.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/struct.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/struct.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/struct.proto 2021-04-27 10:19:52.003448629 +0900
@@ -7,6 +7,9 @@
import "tensorflow/core/framework/types.proto";

Expand All @@ -63,9 +63,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/struct.proto tensorflow-2.4.

// `StructuredValue` represents a dynamically typed value representing various
// data structures that are inspired by Python data structures typically used in
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/trackable_object_graph.proto 2021-02-08 09:42:24.581760720 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/trackable_object_graph.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/trackable_object_graph.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/trackable_object_graph.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/trackable_object_graph.proto 2021-04-27 10:19:52.003448629 +0900
@@ -4,6 +4,9 @@

option cc_enable_arenas = true;
Expand All @@ -76,29 +76,18 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/trackable_object_graph.proto

// A TensorBundle addition which saves extra information about the objects which
// own variables, allowing for more robust checkpoint loading into modified
diff -ruN tensorflow-2.4.1/tensorflow/core/protobuf/transport_options.proto tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto
--- tensorflow-2.4.1/tensorflow/core/protobuf/transport_options.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/protobuf/transport_options.proto 2021-02-08 09:42:56.660650580 +0900
@@ -3,6 +3,7 @@
package tensorflow;

option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
+option java_package = "org.tensorflow.distruntime";

// Extra data needed on a non-RDMA RecvBufResponse.
message RecvBufRespExtra {
diff -ruN tensorflow-2.4.1/tensorflow/core/lib/core/error_codes.proto tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto
--- tensorflow-2.4.1/tensorflow/core/lib/core/error_codes.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/lib/core/error_codes.proto 2021-02-08 09:40:24.590065457 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/lib/core/error_codes.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/lib/core/error_codes.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/lib/core/error_codes.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/lib/core/error_codes.proto 2021-04-27 10:19:52.003448629 +0900
@@ -1,3 +1,5 @@
syntax = "proto3";

+option java_package = "org.tensorflow.framework";
+
import public "tensorflow/core/protobuf/error_codes.proto";
diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto
--- tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/profiler/protobuf/xplane.proto 2021-02-08 09:40:24.591065455 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/profiler/protobuf/xplane.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/profiler/protobuf/xplane.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/profiler/protobuf/xplane.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/profiler/protobuf/xplane.proto 2021-04-27 10:19:52.004448631 +0900
@@ -3,6 +3,9 @@
package tensorflow.profiler;

Expand All @@ -109,9 +98,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/protobuf/xplane.proto tensor

// A container of parallel XPlanes, generated by one or more profiling sources.
// Next ID: 5
diff -ruN tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto
--- tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/util/memmapped_file_system.proto 2021-02-08 09:40:24.592065452 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/util/memmapped_file_system.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/util/memmapped_file_system.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/util/memmapped_file_system.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/util/memmapped_file_system.proto 2021-04-27 10:19:52.004448631 +0900
@@ -17,6 +17,9 @@
package tensorflow;

Expand All @@ -122,9 +111,9 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/util/memmapped_file_system.proto tens

// A message that describes one region of memmapped file.
message MemmappedFileSystemDirectoryElement {
diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto
--- tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto 2021-01-21 09:25:54.000000000 +0900
+++ tensorflow-2.4.1-proto/tensorflow/core/profiler/profiler_options.proto 2021-02-08 09:40:24.593065450 +0900
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/profiler/profiler_options.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/profiler/profiler_options.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/profiler/profiler_options.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/profiler/profiler_options.proto 2021-04-27 10:19:52.004448631 +0900
@@ -1,6 +1,9 @@
syntax = "proto3";

Expand All @@ -135,16 +124,14 @@ diff -ruN tensorflow-2.4.1/tensorflow/core/profiler/profiler_options.proto tenso

// Next ID: 11
message ProfileOptions {

diff --git a/tensorflow/core/protobuf/data/experimental/service_config.proto b/tensorflow/core/protobuf/data/experimental/service_config.proto
index 3dcd2cd48d..ae2cfdd94f 100644
--- a/tensorflow/core/protobuf/data/experimental/service_config.proto
+++ b/tensorflow/core/protobuf/data/experimental/service_config.proto
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/protobuf/service_config.proto tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/service_config.proto
--- tensorflow-2.5.0-rc1/tensorflow/core/protobuf/service_config.proto 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-proto/tensorflow/core/protobuf/service_config.proto 2021-04-27 10:20:13.501491398 +0900
@@ -1,6 +1,7 @@
syntax = "proto3";

package tensorflow.data.experimental;
+option java_package = "org.tensorflow.data.experimental";

// Configuration for a tf.data service DispatchServer.
message DispatcherConfig {
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
index 55406a5686..35d1547dfb 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -33,7 +33,7 @@ load(
diff -ruN tensorflow-2.5.0-rc1/tensorflow/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/BUILD
--- tensorflow-2.5.0-rc1/tensorflow/BUILD 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/BUILD 2021-04-27 10:26:14.196211286 +0900
@@ -38,7 +38,7 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

package(
Expand All @@ -11,27 +10,26 @@ index 55406a5686..35d1547dfb 100644
licenses = ["notice"], # Apache 2.0
)

diff --ruN a/tensorflow/core/api_def/BUILD b/tensorflow/core/api_def/BUILD
--- a/tensorflow/core/api_def/BUILD 2020-03-26 18:19:19.000000000 -0400
+++ b/tensorflow/core/api_def/BUILD 2020-04-01 22:50:37.000000000 -0400
@@ -28,7 +28,7 @@ package(
filegroup(
diff -ruN tensorflow-2.5.0-rc1/tensorflow/core/api_def/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/core/api_def/BUILD
--- tensorflow-2.5.0-rc1/tensorflow/core/api_def/BUILD 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/core/api_def/BUILD 2021-04-27 10:29:38.712785268 +0900
@@ -29,7 +29,7 @@
alias(
name = "base_api_def",
srcs = glob(["base_api/*"]),
actual = "//tensorflow/core/api_def/base_api:base_api_def",
- visibility = ["//tensorflow:internal"],
+ visibility = ["//visibility:public"],
)

filegroup(
diff -ruN a/tensorflow/tools/api/lib/BUILD b/tensorflow/tools/api/lib/BUILD
--- a/tensorflow/tools/api/lib/BUILD 2020-03-26 18:19:19.000000000 -0400
+++ b/tensorflow/tools/api/lib/BUILD 2020-04-01 22:50:37.000000000 -0400
@@ -13,6 +13,7 @@
alias(
diff -ruN tensorflow-2.5.0-rc1/tensorflow/tools/api/lib/BUILD tensorflow-2.5.0-rc1-visibility/tensorflow/tools/api/lib/BUILD
--- tensorflow-2.5.0-rc1/tensorflow/tools/api/lib/BUILD 2021-04-13 01:43:40.000000000 +0900
+++ tensorflow-2.5.0-rc1-visibility/tensorflow/tools/api/lib/BUILD 2021-04-27 10:26:14.196211286 +0900
@@ -16,6 +16,7 @@
tf_proto_library(
name = "api_objects_proto",
srcs = ["api_objects.proto"],
+ visibility = ["//visibility:public"],
)

py_library(

Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ public void map(InfoMap infoMap) {
new Info("TFE_TensorHandle")
.pointerTypes("TFE_TensorHandle")
.base("org.tensorflow.internal.c_api.AbstractTFE_TensorHandle"))
.put(
new Info("SP_Stream")
.cast()
.pointerTypes("Pointer"))
.put(
new Info(
"TF_ShapeInferenceContextDimValueKnown",
Expand Down