Skip to content

Commit df448ad

Browse files
authored
Chore: Update protos to match latest TF proto's (#6010)
* Motivation for features / changes This PR updates our proto files to match the latest Tensorflow protos. For posterity these protos were synced to Tensorflow at commit 20d085686bb99daefa930205e8ec69a99dae306d. Which was commited on November 1st 2022. * Technical description of changes These updates were done by running the tensorboard/compat/proto/update.sh script. The update to that file was to fix a little bug in the changes made in #5997
1 parent 3cad6d6 commit df448ad

File tree

13 files changed

+202
-102
lines changed

13 files changed

+202
-102
lines changed

tensorboard/compat/proto/BUILD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ tb_proto_library(
6868
":debug",
6969
":graph",
7070
":rewriter_config",
71+
":rpc_options",
7172
":step_stats",
7273
],
7374
)
@@ -134,6 +135,11 @@ tb_proto_library(
134135
],
135136
)
136137

138+
tb_proto_library(
139+
name = "histogram",
140+
srcs = ["histogram.proto"],
141+
)
142+
137143
tb_proto_library(
138144
name = "meta_graph",
139145
srcs = ["meta_graph.proto"],
@@ -186,6 +192,11 @@ tb_proto_library(
186192
],
187193
)
188194

195+
tb_proto_library(
196+
name = "rpc_options",
197+
srcs = ["rpc_options.proto"],
198+
)
199+
189200
tb_proto_library(
190201
name = "saved_object_graph",
191202
srcs = ["saved_object_graph.proto"],
@@ -227,6 +238,7 @@ tb_proto_library(
227238
name = "summary",
228239
srcs = ["summary.proto"],
229240
deps = [
241+
":histogram",
230242
":tensor",
231243
],
232244
)
@@ -310,11 +322,13 @@ tb_proto_library(
310322
":full_type",
311323
":function",
312324
":graph",
325+
":histogram",
313326
":meta_graph",
314327
":node_def",
315328
":op_def",
316329
":resource_handle",
317330
":rewriter_config",
331+
":rpc_options",
318332
":saved_object_graph",
319333
":saver",
320334
":step_stats",

tensorboard/compat/proto/config.proto

Lines changed: 34 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import "tensorboard/compat/proto/cost_graph.proto";
66
import "tensorboard/compat/proto/graph.proto";
77
import "tensorboard/compat/proto/step_stats.proto";
88
import "tensorboard/compat/proto/cluster.proto";
9-
import "tensorboard/compat/proto/coordination_config.proto";
109
import "tensorboard/compat/proto/debug.proto";
1110
import "tensorboard/compat/proto/rewriter_config.proto";
11+
import "tensorboard/compat/proto/rpc_options.proto";
12+
import "tensorboard/compat/proto/coordination_config.proto";
1213

1314
option cc_enable_arenas = true;
1415
option java_outer_classname = "ConfigProtos";
@@ -123,6 +124,12 @@ message GPUOptions {
123124
// created with the default. If this field has values set, then the size
124125
// of this must match with the above memory_limit_mb.
125126
repeated int32 priority = 2;
127+
128+
// Virtual Device ordinal number determines the device ID of the device.
129+
// A Virtual device with a lower ordinal number always receives the a
130+
// smaller device id. The phyiscal device id and location in the
131+
// virtual device list is used to break ties.
132+
repeated int32 device_ordinal = 3;
126133
}
127134

128135
// The multi virtual device settings. If empty (not set), it will create
@@ -132,15 +139,30 @@ message GPUOptions {
132139
// "visible_device_list" filtering if it is set), and the string represented
133140
// device names (e.g. /device:GPU:<id>) will refer to the virtual
134141
// 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,
142+
// according to the order of the virtual devices determined by
143+
// device_ordinal and the location in the virtual device list.
144+
//
145+
// For example,
137146
// visible_device_list = "1,0"
138147
// virtual_devices { memory_limit: 1GB memory_limit: 2GB }
139-
// virtual_devices {}
140-
// will create three virtual devices as:
148+
// virtual_devices { memory_limit: 3GB memory_limit: 4GB }
149+
// will create 4 virtual devices as:
141150
// /device:GPU:0 -> visible GPU 1 with 1GB memory
142151
// /device:GPU:1 -> visible GPU 1 with 2GB memory
143-
// /device:GPU:2 -> visible GPU 0 with all available memory
152+
// /device:GPU:2 -> visible GPU 0 with 3GB memory
153+
// /device:GPU:3 -> visible GPU 0 with 4GB memory
154+
//
155+
// but
156+
// visible_device_list = "1,0"
157+
// virtual_devices { memory_limit: 1GB memory_limit: 2GB
158+
// device_ordinal: 10 device_ordinal: 20}
159+
// virtual_devices { memory_limit: 3GB memory_limit: 4GB
160+
// device_ordinal: 10 device_ordinal: 20}
161+
// will create 4 virtual devices as:
162+
// /device:GPU:0 -> visible GPU 1 with 1GB memory (ordinal 10)
163+
// /device:GPU:1 -> visible GPU 0 with 3GB memory (ordinal 10)
164+
// /device:GPU:2 -> visible GPU 1 with 2GB memory (ordinal 20)
165+
// /device:GPU:3 -> visible GPU 0 with 4GB memory (ordinal 20)
144166
//
145167
// NOTE:
146168
// 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
@@ -355,41 +377,6 @@ message ThreadPoolOptionProto {
355377
string global_name = 2;
356378
}
357379

358-
message RPCOptions {
359-
// If true, always use RPC to contact the session target.
360-
//
361-
// If false (the default option), TensorFlow may use an optimized
362-
// transport for client-master communication that avoids the RPC
363-
// stack. This option is primarily for used testing the RPC stack.
364-
bool use_rpc_for_inprocess_master = 1;
365-
366-
// The compression algorithm to be used. One of "deflate", "gzip".
367-
string compression_algorithm = 2;
368-
369-
// If compression_algorithm is set, the compression level to be used.
370-
// From 0 (no compression), up to 3.
371-
int32 compression_level = 3;
372-
373-
// Setting cache_rpc_response to true will enable sender side caching of
374-
// response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
375-
// requests . This is only necessary when the network fabric is experiencing a
376-
// significant error rate. Without it we'll fail a step on an network error,
377-
// while with it we'll be able to complete long steps (like complex
378-
// initializations) in the face of some network errors during RecvTensor.
379-
bool cache_rpc_response = 4;
380-
381-
// Disables TCP connection sharing when opening a new RPC channel.
382-
bool disable_session_connection_sharing = 5;
383-
384-
// Setting num_channels_per_target > 0 allows uses of multiple channels to
385-
// communicate to the same target. This can be used to improve the aggregate
386-
// throughput on high speed links (e.g 100G) where single connection is not
387-
// sufficient to maximize link utilization. Note that a single RPC only goes
388-
// on a single channel, this only helps in situations where there are multiple
389-
// transfers to the same target overlapping in time.
390-
int32 num_channels_per_target = 6;
391-
}
392-
393380
// Metadata about the session.
394381
//
395382
// This can be used by the runtime and the Ops for debugging, monitoring, etc.
@@ -606,13 +593,10 @@ message ConfigProto {
606593
// Session::Extend() may not be supported.
607594
bool optimize_for_static_graph = 12;
608595

609-
// This field will eventually be deprecated and replaced by
610-
// mlir_bridge_rollout (b/166038521).
611-
//
612-
// Whether to enable the MLIR-based TF->XLA bridge.
596+
// Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
597+
// to true. Default value or false is ignored. Use mlir_bridge_rollout for
598+
// finer control.
613599
//
614-
// This is a replacement to the existing bridge, and not ready for
615-
// production usage yet.
616600
// If this option is set to true when a session is created, MLIR is used to
617601
// perform the set of graph transformations to put the graph in a form that
618602
// can be executed with delegation of some computations to an accelerator.
@@ -644,9 +628,6 @@ message ConfigProto {
644628
// to process the TF graph.
645629
MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED = 4;
646630
}
647-
// This field is underdevelopment, for now use enable_mlir_bridge
648-
// (b/166038521).
649-
//
650631
// Whether to enable the MLIR-based TF->XLA bridge.
651632
MlirBridgeRollout mlir_bridge_rollout = 17;
652633

@@ -798,6 +779,9 @@ message RunMetadata {
798779
// level idea of what the built graph looks like (since the various graph
799780
// optimization passes might change the structure of the graph significantly).
800781
repeated FunctionGraphs function_graphs = 4;
782+
783+
// Metadata about the session.
784+
SessionMetadata session_metadata = 5;
801785
}
802786

803787
// 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/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+
}

0 commit comments

Comments
 (0)