Skip to content

Commit 5210ce3

Browse files
authored
update protos to match TF 2.11 and pin the CI version to TF 2.11 (#6029)
* Motivation for features / changes This PR syncs the Tensorboard Protos to match the Tensorflow 2.11 release candidate. The required a change in our update script which is also in our master branch. This also pins the TF version in the CI to 2.11.
1 parent a53e9ef commit 5210ce3

File tree

15 files changed

+204
-59
lines changed

15 files changed

+204
-59
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
BUILDTOOLS_VERSION: '3.0.0'
2828
BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
2929
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'
30-
TENSORFLOW_VERSION: 'tf-nightly'
30+
TENSORFLOW_VERSION: 'tensorflow==2.11.0rc2'
3131

3232
jobs:
3333
build:

tensorboard/compat/proto/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ tb_proto_library(
134134
],
135135
)
136136

137+
tb_proto_library(
138+
name = "histogram",
139+
srcs = ["histogram.proto"],
140+
)
141+
137142
tb_proto_library(
138143
name = "meta_graph",
139144
srcs = ["meta_graph.proto"],
@@ -186,6 +191,11 @@ tb_proto_library(
186191
],
187192
)
188193

194+
tb_proto_library(
195+
name = "rpc_options",
196+
srcs = ["rpc_options.proto"],
197+
)
198+
189199
tb_proto_library(
190200
name = "saved_object_graph",
191201
srcs = ["saved_object_graph.proto"],
@@ -227,6 +237,7 @@ tb_proto_library(
227237
name = "summary",
228238
srcs = ["summary.proto"],
229239
deps = [
240+
":histogram",
230241
":tensor",
231242
],
232243
)
@@ -310,11 +321,13 @@ tb_proto_library(
310321
":full_type",
311322
":function",
312323
":graph",
324+
":histogram",
313325
":meta_graph",
314326
":node_def",
315327
":op_def",
316328
":resource_handle",
317329
":rewriter_config",
330+
":rpc_options",
318331
":saved_object_graph",
319332
":saver",
320333
":step_stats",

tensorboard/compat/proto/config.proto

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ message GPUOptions {
123123
// created with the default. If this field has values set, then the size
124124
// of this must match with the above memory_limit_mb.
125125
repeated int32 priority = 2;
126+
127+
// Virtual Device ordinal number determines the device ID of the device.
128+
// A Virtual device with a lower ordinal number always receives the a
129+
// smaller device id. The phyiscal device id and location in the
130+
// virtual device list is used to break ties.
131+
repeated int32 device_ordinal = 3;
126132
}
127133

128134
// The multi virtual device settings. If empty (not set), it will create
@@ -132,15 +138,30 @@ message GPUOptions {
132138
// "visible_device_list" filtering if it is set), and the string represented
133139
// device names (e.g. /device:GPU:<id>) will refer to the virtual
134140
// devices and have the <id> field assigned sequentially starting from 0,
135-
// according to the order they appear in this list and the "memory_limit"
136-
// list inside each element. For example,
141+
// according to the order of the virtual devices determined by
142+
// device_ordinal and the location in the virtual device list.
143+
//
144+
// For example,
137145
// visible_device_list = "1,0"
138146
// virtual_devices { memory_limit: 1GB memory_limit: 2GB }
139-
// virtual_devices {}
140-
// will create three virtual devices as:
147+
// virtual_devices { memory_limit: 3GB memory_limit: 4GB }
148+
// will create 4 virtual devices as:
141149
// /device:GPU:0 -> visible GPU 1 with 1GB memory
142150
// /device:GPU:1 -> visible GPU 1 with 2GB memory
143-
// /device:GPU:2 -> visible GPU 0 with all available memory
151+
// /device:GPU:2 -> visible GPU 0 with 3GB memory
152+
// /device:GPU:3 -> visible GPU 0 with 4GB memory
153+
//
154+
// but
155+
// visible_device_list = "1,0"
156+
// virtual_devices { memory_limit: 1GB memory_limit: 2GB
157+
// device_ordinal: 10 device_ordinal: 20}
158+
// virtual_devices { memory_limit: 3GB memory_limit: 4GB
159+
// device_ordinal: 10 device_ordinal: 20}
160+
// will create 4 virtual devices as:
161+
// /device:GPU:0 -> visible GPU 1 with 1GB memory (ordinal 10)
162+
// /device:GPU:1 -> visible GPU 0 with 3GB memory (ordinal 10)
163+
// /device:GPU:2 -> visible GPU 1 with 2GB memory (ordinal 20)
164+
// /device:GPU:3 -> visible GPU 0 with 4GB memory (ordinal 20)
144165
//
145166
// NOTE:
146167
// 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
@@ -798,6 +819,9 @@ message RunMetadata {
798819
// level idea of what the built graph looks like (since the various graph
799820
// optimization passes might change the structure of the graph significantly).
800821
repeated FunctionGraphs function_graphs = 4;
822+
823+
// Metadata about the session.
824+
SessionMetadata session_metadata = 5;
801825
}
802826

803827
// Defines a connection between two tensors in a `GraphDef`.

tensorboard/compat/proto/coordination_config.proto

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ package tensorboard;
44

55
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
66

7+
// Represents a job type and the number of tasks under this job.
8+
// For example, ("worker", 20) implies that there will be 20 worker tasks.
9+
message CoordinatedJob {
10+
string name = 1;
11+
int32 num_tasks = 2;
12+
}
13+
714
// Coordination service configuration parameters.
815
// The system picks appropriate values for fields that are not set.
916
message CoordinationServiceConfig {
@@ -29,9 +36,9 @@ message CoordinationServiceConfig {
2936
// recording the state change and the agent stopping heartbeats.
3037
int64 heartbeat_timeout_in_ms = 5;
3138

32-
// The list of jobs that partipate in the coordination service. If empty, all
33-
// jobs will be included in the coordination service by default.
34-
repeated string coordinated_jobs = 6;
39+
// The list of `CoordinatedJob`s that will register in coordination service.
40+
reserved 6;
41+
repeated CoordinatedJob coordinated_job_list = 10;
3542

3643
// Denotes how long to wait for all coordination agents to reach the barriers
3744
// (after the first shutdown request) before disconnecting together. If
@@ -43,4 +50,10 @@ message CoordinationServiceConfig {
4350
// find out about the disconnecte agent via stale heartbeats. Used for
4451
// testing.
4552
bool agent_destruction_without_shutdown = 8;
53+
54+
// The list of jobs which are recoverable. If a task in this list fails,
55+
// it will not propagate error to other tasks.
56+
// If empty, no jobs will be recoverable and every task failure will cause
57+
// error propagation to other tasks.
58+
repeated string recoverable_jobs = 9;
4659
}

tensorboard/compat/proto/full_type.proto

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ enum FullTypeId {
174174
// TFT_LITERAL[TFT_INT32]{1} is the compile-time constant 1.
175175
TFT_LITERAL = 1003;
176176

177+
// Encoding types describe a value of a certain type, encoded as a different
178+
// type.
179+
//
180+
// Parametrization:
181+
// TFT_ENCODED[<encoded type>, <encoding type>]
182+
// * <encoded type> may be any type
183+
// * <encoding type> may be any type
184+
//
185+
// Examples:
186+
// TFT_ENCODING[TFT_INT32, TFT_STRING] is an integer encoded as string.
187+
TFT_ENCODED = 1004;
188+
177189
// Type attributes. These always appear in the parametrization of a type,
178190
// never alone. For example, there is no such thing as a "bool" TensorFlow
179191
// object (for now).
@@ -217,7 +229,7 @@ enum FullTypeId {
217229
// is expressed using TFT_PRODUCT.
218230
//
219231
//
220-
// Parametrization: TFT_ARRAY[<element type>].
232+
// Parametrization: TFT_DATASET[<element type>].
221233
// * <element type> may be a concrete type or a type symbol. It represents
222234
// the data type of the elements produced by the dataset.
223235
//
@@ -235,6 +247,15 @@ enum FullTypeId {
235247
// Parametrization: TFT_RAGGED[<element_type>].
236248
TFT_RAGGED = 10103;
237249

250+
// Iterators created by tf.data ops and APIs. Very similar to Datasets, except
251+
// they are mutable.
252+
//
253+
//
254+
// Parametrization: TFT_ITERATOR[<element type>].
255+
// * <element type> may be a concrete type or a type symbol. It represents
256+
// the data type of the elements produced by the dataset.
257+
TFT_ITERATOR = 10104;
258+
238259
// A mutex lock tensor, produced by tf.raw_ops.MutexLock.
239260
// Unlike strict execution models, where ownership of a lock is denoted by
240261
// "running after the lock has been acquired", in non-strict mode, lock
@@ -265,7 +286,7 @@ message FullTypeDef {
265286

266287
repeated FullTypeDef args = 2;
267288

268-
// Literal values of this type object, if the the type admits one.
289+
// Literal values of this type object, if the type admits one.
269290
// For example, a type variable admits a string attribute - its name.
270291
// Shape-related types may admit int attributes - their static shape values.
271292
// Fields for more data types to be added as needed.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
syntax = "proto3";
2+
3+
package tensorboard;
4+
5+
option cc_enable_arenas = true;
6+
option java_multiple_files = true;
7+
option java_package = "org.tensorflow.framework";
8+
option go_package = "github.com/google/tsl/tsl/go/core/protobuf/summary_go_proto";
9+
10+
// Serialization format for histogram module in
11+
// tsl/lib/histogram/histogram.h
12+
message HistogramProto {
13+
double min = 1;
14+
double max = 2;
15+
double num = 3;
16+
double sum = 4;
17+
double sum_squares = 5;
18+
19+
// Parallel arrays encoding the bucket boundaries and the bucket values.
20+
// bucket(i) is the count for the bucket i. The range for
21+
// a bucket is:
22+
// i == 0: -DBL_MAX .. bucket_limit(0)
23+
// i != 0: bucket_limit(i-1) .. bucket_limit(i)
24+
repeated double bucket_limit = 6 [packed = true];
25+
repeated double bucket = 7 [packed = true];
26+
}

tensorboard/compat/proto/meta_graph.proto

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ option java_multiple_files = true;
1717
option java_package = "org.tensorflow.framework";
1818
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
1919

20-
// NOTE: This protocol buffer is evolving, and will go through revisions in the
21-
// coming months.
22-
//
2320
// Protocol buffer containing the following which are necessary to restart
2421
// training, run inference. It can be used to serialize/de-serialize memory
2522
// objects necessary for running computation in a graph when crossing the

tensorboard/compat/proto/proto_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
("tensorflow/core/profiler/", "tensorboard/compat/proto/"),
151151
("tensorflow/python/framework/", "tensorboard/compat/proto/"),
152152
("tensorflow/core/util/", "tensorboard/compat/proto/"),
153+
("tensorflow/tsl/protobuf/", "tensorboard/compat/proto/"),
153154
('package: "tensorflow.tfprof"', 'package: "tensorboard"'),
154155
('package: "tensorflow"', 'package: "tensorboard"'),
155156
('type_name: ".tensorflow.tfprof', 'type_name: ".tensorboard'),

tensorboard/compat/proto/rewriter_config.proto

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,17 @@ message RewriterConfig {
107107
// Note that this can change the numerical stability of the graph and may
108108
// require the use of loss scaling to maintain model convergence.
109109
Toggle auto_mixed_precision = 23;
110-
// Optimize data types for MKL (default is OFF).
110+
// Optimize data types for oneDNN (default is OFF).
111111
// This will try to use bfloat16 on CPUs, which is faster.
112112
// Note that this can change the numerical stability of the graph.
113+
// Note: this is deprecated.
114+
// It is replaced by auto_mixed_precision_onednn_bfloat16
113115
Toggle auto_mixed_precision_mkl = 25;
116+
// Optimize data types for oneDNN (default is OFF).
117+
// This will try to use bfloat16 on CPUs, which is faster.
118+
// Note that this can change the numerical stability of the graph.
119+
// Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
120+
Toggle auto_mixed_precision_onednn_bfloat16 = 31;
114121
// Emulate a model using data type float16 on CPU (default is OFF).
115122
// This will try to emulate the float16 inputs and outputs of an operator
116123
// on CPU to have better correlation with float16 on GPU; however the
@@ -121,6 +128,8 @@ message RewriterConfig {
121128
bool disable_meta_optimizer = 19;
122129
// Optimizers registered by plugin (default is ON)
123130
Toggle use_plugin_optimizers = 28;
131+
// Conditional code motion (default is ON).
132+
Toggle experimental_conditional_code_motion = 30;
124133

125134
// Controls how many times we run the optimizers in meta optimizer (default
126135
// is once).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
syntax = "proto3";
2+
3+
package tensorboard;
4+
5+
option go_package = "github.com/google/tsl/tsl/go/protobuf/for_core_protos_go_proto";
6+
7+
// RPC options for distributed runtime.
8+
message RPCOptions {
9+
// If true, always use RPC to contact the session target.
10+
//
11+
// If false (the default option), TensorFlow may use an optimized
12+
// transport for client-master communication that avoids the RPC
13+
// stack. This option is primarily for used testing the RPC stack.
14+
bool use_rpc_for_inprocess_master = 1;
15+
16+
// The compression algorithm to be used. One of "deflate", "gzip".
17+
string compression_algorithm = 2;
18+
19+
// If compression_algorithm is set, the compression level to be used.
20+
// From 0 (no compression), up to 3.
21+
int32 compression_level = 3;
22+
23+
// Setting cache_rpc_response to true will enable sender side caching of
24+
// response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
25+
// requests . This is only necessary when the network fabric is experiencing a
26+
// significant error rate. Without it we'll fail a step on an network error,
27+
// while with it we'll be able to complete long steps (like complex
28+
// initializations) in the face of some network errors during RecvTensor.
29+
bool cache_rpc_response = 4;
30+
31+
// Disables TCP connection sharing when opening a new RPC channel.
32+
bool disable_session_connection_sharing = 5;
33+
34+
// Setting num_channels_per_target > 0 allows uses of multiple channels to
35+
// communicate to the same target. This can be used to improve the aggregate
36+
// throughput on high speed links (e.g 100G) where single connection is not
37+
// sufficient to maximize link utilization. Note that a single RPC only goes
38+
// on a single channel, this only helps in situations where there are multiple
39+
// transfers to the same target overlapping in time.
40+
int32 num_channels_per_target = 6;
41+
}

tensorboard/compat/proto/summary.proto

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ syntax = "proto3";
22

33
package tensorboard;
44

5+
import public "tensorboard/compat/proto/histogram.proto";
6+
57
import "tensorboard/compat/proto/tensor.proto";
68

79
option cc_enable_arenas = true;
@@ -17,24 +19,6 @@ message SummaryDescription {
1719
string type_hint = 1;
1820
}
1921

20-
// Serialization format for histogram module in
21-
// core/lib/histogram/histogram.h
22-
message HistogramProto {
23-
double min = 1;
24-
double max = 2;
25-
double num = 3;
26-
double sum = 4;
27-
double sum_squares = 5;
28-
29-
// Parallel arrays encoding the bucket boundaries and the bucket values.
30-
// bucket(i) is the count for the bucket i. The range for
31-
// a bucket is:
32-
// i == 0: -DBL_MAX .. bucket_limit(0)
33-
// i != 0: bucket_limit(i-1) .. bucket_limit(i)
34-
repeated double bucket_limit = 6 [packed = true];
35-
repeated double bucket = 7 [packed = true];
36-
}
37-
3822
// A SummaryMetadata encapsulates information on which plugins are able to make
3923
// use of a certain summary value.
4024
message SummaryMetadata {

tensorboard/compat/proto/types.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ enum DataType {
7575
// https://www.tensorflow.org/code/tensorboard/compat/proto/types.cc,
7676
// https://www.tensorflow.org/code/tensorboard/compat/proto/dtypes.py,
7777
// https://www.tensorflow.org/code/tensorboard/compat/proto/function.py)
78+
79+
// Represents a serialized tf.dtypes.Dtype
80+
message SerializedDType {
81+
DataType datatype = 1;
82+
}

tensorboard/compat/proto/update.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ rsync --existing "$1"/tensorflow/core/protobuf/*.proto tensorboard/compat/proto/
2626
rsync --existing "$1"/tensorflow/core/profiler/*.proto tensorboard/compat/proto/
2727
rsync --existing "$1"/tensorflow/core/util/*.proto tensorboard/compat/proto/
2828
rsync --existing "$1"/tensorflow/python/framework/*.proto tensorboard/compat/proto/
29+
if [ -d $1"/tensorflow/tsl/protobuf" ] # This directory first appears in TF 2.11
30+
then
31+
rsync --existing "$1"/tensorflow/tsl/protobuf/*.proto tensorboard/compat/proto/
32+
fi
2933

3034
# Rewrite file paths and package names and disable LINT checks.
3135
find tensorboard/compat/proto/ -type f -name '*.proto' -exec perl -pi \
@@ -34,6 +38,7 @@ find tensorboard/compat/proto/ -type f -name '*.proto' -exec perl -pi \
3438
-e 's|tensorflow/core/profiler|tensorboard/compat/proto|g;' \
3539
-e 's|tensorflow/core/util|tensorboard/compat/proto|g;' \
3640
-e 's|tensorflow/python/framework|tensorboard/compat/proto|g;' \
41+
-e 's|tensorflow/tsl/protobuf|tensorboard/compat/proto|g;' \
3742
-e 's|package tensorflow.tfprof;|package tensorboard;|g;' \
3843
-e 's|package tensorflow;|package tensorboard;|g;' \
3944
-e 's|tensorflow\.DataType|tensorboard.DataType|g;' \
@@ -60,9 +65,9 @@ find tensorboard/compat/proto/ -type f -name '*.proto' -exec perl -pi \
6065
printf 'tb_proto_library(\n'
6166
printf ' name = "%s",\n' "${f%.proto}"
6267
printf ' srcs = ["%s"],\n' "$f"
63-
if grep -q '^import "tensorboard/' "$f"; then
68+
if grep -q '^import\( public\)* "tensorboard/' "$f"; then
6469
printf ' deps = [\n'
65-
grep '^import "tensorboard/' "$f" | sort |
70+
grep '^import\( public\)* "tensorboard/' "$f" | sort |
6671
sed -e 's#.*compat/proto/\([^.]*\).*# ":\1",#'
6772
printf ' ],\n'
6873
fi
515 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)