From 78fa64f594f56073908474095d0386a4d803898f Mon Sep 17 00:00:00 2001 From: Riley Jones Date: Thu, 4 May 2023 17:55:51 +0000 Subject: [PATCH] update tensorflow protos --- tensorboard/compat/proto/BUILD | 7 +++ tensorboard/compat/proto/config.proto | 4 +- .../compat/proto/coordination_config.proto | 5 ++ tensorboard/compat/proto/graph.proto | 4 ++ .../compat/proto/graph_debug_info.proto | 52 +++++++++++++++++++ tensorboard/compat/proto/proto_test.py | 4 ++ tensorboard/compat/proto/struct.proto | 2 + 7 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 tensorboard/compat/proto/graph_debug_info.proto diff --git a/tensorboard/compat/proto/BUILD b/tensorboard/compat/proto/BUILD index ac9027ee455..512602a23a1 100644 --- a/tensorboard/compat/proto/BUILD +++ b/tensorboard/compat/proto/BUILD @@ -126,11 +126,17 @@ tb_proto_library( ], ) +tb_proto_library( + name = "graph_debug_info", + srcs = ["graph_debug_info.proto"], +) + tb_proto_library( name = "graph", srcs = ["graph.proto"], deps = [ ":function", + ":graph_debug_info", ":node_def", ":versions", ], @@ -326,6 +332,7 @@ tb_proto_library( ":full_type", ":function", ":graph", + ":graph_debug_info", ":histogram", ":meta_graph", ":node_def", diff --git a/tensorboard/compat/proto/config.proto b/tensorboard/compat/proto/config.proto index 6b97e1af738..4d165eb6139 100644 --- a/tensorboard/compat/proto/config.proto +++ b/tensorboard/compat/proto/config.proto @@ -691,7 +691,9 @@ message ConfigProto { // aims to negate its value. bool disable_optimize_for_static_graph = 24; - // Next: 25 + reserved 25; + + // Next: 26 } Experimental experimental = 16; diff --git a/tensorboard/compat/proto/coordination_config.proto b/tensorboard/compat/proto/coordination_config.proto index 4fff0565818..fef9673afdb 100644 --- a/tensorboard/compat/proto/coordination_config.proto +++ b/tensorboard/compat/proto/coordination_config.proto @@ -56,4 +56,9 @@ message CoordinationServiceConfig { // If empty, no jobs will be recoverable and every task failure will cause // error propagation to other tasks. repeated string recoverable_jobs = 9; + + // If a task restarts with a new incarnation, we may allow it to reconnect + // silently. This is useful when we know that a task can immediately resume + // work upon re-connecting to the service. + bool allow_new_incarnation_to_reconnect = 11; } diff --git a/tensorboard/compat/proto/graph.proto b/tensorboard/compat/proto/graph.proto index 88992ae6872..d19ae108b81 100644 --- a/tensorboard/compat/proto/graph.proto +++ b/tensorboard/compat/proto/graph.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package tensorboard; import "tensorboard/compat/proto/function.proto"; +import "tensorboard/compat/proto/graph_debug_info.proto"; import "tensorboard/compat/proto/node_def.proto"; import "tensorboard/compat/proto/versions.proto"; @@ -53,4 +54,7 @@ message GraphDef { // consumer does not start until all return values of the callee // function are ready. FunctionDefLibrary library = 2; + + // Stack traces for the nodes in this graph. + GraphDebugInfo debug_info = 5; } diff --git a/tensorboard/compat/proto/graph_debug_info.proto b/tensorboard/compat/proto/graph_debug_info.proto new file mode 100644 index 00000000000..f9dbdb4a707 --- /dev/null +++ b/tensorboard/compat/proto/graph_debug_info.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package tensorboard; + +option cc_enable_arenas = true; +option java_outer_classname = "GraphDebugInfoProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; +option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; + +message GraphDebugInfo { + // This represents a file/line location in the source code. + message FileLineCol { + // File name index, which can be used to retrieve the file name string from + // `files`. The value should be between 0 and (len(files)-1) + int32 file_index = 1; + + // Line number in the file. + int32 line = 2; + + // Col number in the file line. + int32 col = 3; + + // Name of function contains the file line. + string func = 4; + + // Source code contained in this file line. + string code = 5; + } + + // This represents a stack trace which is a ordered list of `FileLineCol`. + message StackTrace { + // Each line in the stack trace. + repeated FileLineCol file_line_cols = 1; + } + + // This stores all the source code file names and can be indexed by the + // `file_index`. + repeated string files = 1; + + // This maps a node name to a stack trace in the source code. + // The map key is a mangling of the containing function and op name with + // syntax: + // op.name '@' func_name + // For ops in the top-level graph, the func_name is the empty string. + // Note that op names are restricted to a small number of characters which + // exclude '@', making it impossible to collide keys of this form. Function + // names accept a much wider set of characters. + // It would be preferable to avoid mangling and use a tuple key of (op.name, + // func_name), but this is not supported with protocol buffers. + map traces = 2; +} diff --git a/tensorboard/compat/proto/proto_test.py b/tensorboard/compat/proto/proto_test.py index c3902efe04e..4c5de329039 100644 --- a/tensorboard/compat/proto/proto_test.py +++ b/tensorboard/compat/proto/proto_test.py @@ -66,6 +66,10 @@ "tensorflow.core.framework.function_pb2", "tensorboard.compat.proto.function_pb2", ), + ( + "tensorflow.core.framework.graph_debug_info_pb2", + "tensorboard.compat.proto.graph_debug_info_pb2", + ), ( "tensorflow.core.framework.graph_pb2", "tensorboard.compat.proto.graph_pb2", diff --git a/tensorboard/compat/proto/struct.proto b/tensorboard/compat/proto/struct.proto index 4262402708d..29898715fce 100644 --- a/tensorboard/compat/proto/struct.proto +++ b/tensorboard/compat/proto/struct.proto @@ -72,6 +72,8 @@ message StructuredValue { DictValue dict_value = 53; // Represents Python's namedtuple. NamedTupleValue named_tuple_value = 54; + // Represents a value for tf.Tensor. + tensorboard.TensorProto tensor_value = 55; } }