diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-06-26 10:42:31 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-26 10:45:56 -0700 |
commit | a4476d5bfefb6605a42d77da4598d5a8125e638d (patch) | |
tree | 468b519245c797fda9bcbbbd9e832064b11e3663 | |
parent | 1fa8b4247a15079cb60da74a3c86ed5eef7f1b93 (diff) |
Switch tfprof to use proto3
PiperOrigin-RevId: 160163483
4 files changed, 54 insertions, 53 deletions
diff --git a/tensorflow/contrib/tfprof/python/tools/tfprof/internal/print_model_analysis_test.py b/tensorflow/contrib/tfprof/python/tools/tfprof/internal/print_model_analysis_test.py index 84a37e087b..9eaf74d7a1 100644 --- a/tensorflow/contrib/tfprof/python/tools/tfprof/internal/print_model_analysis_test.py +++ b/tensorflow/contrib/tfprof/python/tools/tfprof/internal/print_model_analysis_test.py @@ -77,6 +77,7 @@ class PrintModelAnalysisTest(test.TestCase): opts.min_params = TEST_OPTIONS['min_params'] opts.min_float_ops = TEST_OPTIONS['min_float_ops'] opts.order_by = TEST_OPTIONS['order_by'] + opts.step = -1 for p in TEST_OPTIONS['account_type_regexes']: opts.account_type_regexes.append(p) for p in TEST_OPTIONS['start_name_regexes']: diff --git a/tensorflow/tools/tfprof/tfprof_log.proto b/tensorflow/tools/tfprof/tfprof_log.proto index 5c47142e0a..0e0fb74aae 100644 --- a/tensorflow/tools/tfprof/tfprof_log.proto +++ b/tensorflow/tools/tfprof/tfprof_log.proto @@ -1,4 +1,4 @@ -syntax = "proto2"; +syntax = "proto3"; package tensorflow.tfprof; @@ -6,27 +6,27 @@ package tensorflow.tfprof; message CodeDef { repeated Trace traces = 1; message Trace { - optional string file = 1; - optional int32 lineno = 2; - optional string function = 3; - optional string line = 4; + string file = 1; + int32 lineno = 2; + string function = 3; + string line = 4; } } message OpLogEntry { // op name. - optional string name = 1; + string name = 1; // float_ops is filled by tfprof Python API when called. It requires the // op has RegisterStatistics defined. Currently, Conv2D, MatMul, etc, are // implemented. - optional int64 float_ops = 2; + int64 float_ops = 2; // User can define extra op type information for an op. This allows the user // to select a group of ops precisely using op_type as a key. repeated string types = 3; // Used to support tfprof "code" view. - optional CodeDef code_def = 4; + CodeDef code_def = 4; } message OpLog { repeated OpLogEntry log_entries = 1; -}
\ No newline at end of file +} diff --git a/tensorflow/tools/tfprof/tfprof_options.proto b/tensorflow/tools/tfprof/tfprof_options.proto index 47e1ff33ee..5882833039 100644 --- a/tensorflow/tools/tfprof/tfprof_options.proto +++ b/tensorflow/tools/tfprof/tfprof_options.proto @@ -1,28 +1,28 @@ -syntax = "proto2"; +syntax = "proto3"; package tensorflow.tfprof; // Refers to tfprof_options.h/cc for documentation. // Only used to pass tfprof options from Python to C++. message OptionsProto { - optional int64 max_depth = 1; - optional int64 min_bytes = 2; - optional int64 min_micros = 3; - optional int64 min_params = 4; - optional int64 min_float_ops = 5; - optional int64 min_occurrence = 17; - optional int64 step = 18 [default = -1]; + int64 max_depth = 1; + int64 min_bytes = 2; + int64 min_micros = 3; + int64 min_params = 4; + int64 min_float_ops = 5; + int64 min_occurrence = 17; + int64 step = 18; - optional string order_by = 7; + string order_by = 7; repeated string account_type_regexes = 8; repeated string start_name_regexes = 9; repeated string trim_name_regexes = 10; repeated string show_name_regexes = 11; repeated string hide_name_regexes = 12; - optional bool account_displayed_op_only = 13; + bool account_displayed_op_only = 13; repeated string select = 14; - optional string output = 15; - optional string dump_to_file = 16 [deprecated = true]; + string output = 15; + string dump_to_file = 16; } message AdvisorOptionsProto { diff --git a/tensorflow/tools/tfprof/tfprof_output.proto b/tensorflow/tools/tfprof/tfprof_output.proto index 3e024ae4e4..abf141f1e7 100644 --- a/tensorflow/tools/tfprof/tfprof_output.proto +++ b/tensorflow/tools/tfprof/tfprof_output.proto @@ -1,4 +1,4 @@ -syntax = "proto2"; +syntax = "proto3"; import "tensorflow/core/framework/tensor_shape.proto"; import "tensorflow/core/framework/types.proto"; @@ -6,7 +6,7 @@ import "tensorflow/core/framework/types.proto"; package tensorflow.tfprof; message TFProfTensorProto { - optional DataType dtype = 1; + DataType dtype = 1; // Flatten tensor in row-major. // Only one of the following array is set. repeated double value_double = 2; @@ -17,23 +17,23 @@ message TFProfTensorProto { // A node in TensorFlow graph. Used by scope/graph view. message TFGraphNodeProto { // op name. - optional string name = 1; + string name = 1; // tensor value restored from checkpoint. - optional TFProfTensorProto tensor_value = 15; + TFProfTensorProto tensor_value = 15; // op execution time. // A node can be defined once but run multiple times in tf.while_loop. // the times sum up all different runs. - optional int64 run_count = 21; - optional int64 exec_micros = 2; - optional int64 accelerator_exec_micros = 17; - optional int64 cpu_exec_micros = 18; + int64 run_count = 21; + int64 exec_micros = 2; + int64 accelerator_exec_micros = 17; + int64 cpu_exec_micros = 18; // Total requested bytes by the op. - optional int64 requested_bytes = 3; + int64 requested_bytes = 3; // Number of parameters if available. - optional int64 parameters = 4; + int64 parameters = 4; // Number of float operations. - optional int64 float_ops = 13; + int64 float_ops = 13; // Device the op is assigned to. // Since an op can fire multiple kernel calls, there can be multiple devices. repeated string devices = 10; @@ -42,15 +42,15 @@ message TFGraphNodeProto { // the node itself. The actual children depend on the data structure used. // In graph view, children are inputs recursively. // In scope view, children are nodes under the name scope. - optional int64 total_definition_count = 23; - optional int64 total_run_count = 22; - optional int64 total_exec_micros = 6; - optional int64 total_accelerator_exec_micros = 19; - optional int64 total_cpu_exec_micros = 20; + int64 total_definition_count = 23; + int64 total_run_count = 22; + int64 total_exec_micros = 6; + int64 total_accelerator_exec_micros = 19; + int64 total_cpu_exec_micros = 20; - optional int64 total_requested_bytes = 7; - optional int64 total_parameters = 8; - optional int64 total_float_ops = 14; + int64 total_requested_bytes = 7; + int64 total_parameters = 8; + int64 total_float_ops = 14; // shape information, if available. // TODO(xpan): Why is this repeated? @@ -72,29 +72,29 @@ message TFGraphNodeProto { // of the op (e.g. MatMul, Conv2D). message TFMultiGraphNodeProto { // Name of the node. - optional string name = 1; + string name = 1; // code execution time. - optional int64 exec_micros = 2; - optional int64 accelerator_exec_micros = 12; - optional int64 cpu_exec_micros = 13; + int64 exec_micros = 2; + int64 accelerator_exec_micros = 12; + int64 cpu_exec_micros = 13; // Total requested bytes by the code. - optional int64 requested_bytes = 3; + int64 requested_bytes = 3; // Number of parameters if available. - optional int64 parameters = 4; + int64 parameters = 4; // Number of float operations. - optional int64 float_ops = 5; + int64 float_ops = 5; // The following are the aggregated stats from descendants. // The actual descendants depend on the data structure used. - optional int64 total_exec_micros = 6; - optional int64 total_accelerator_exec_micros = 14; - optional int64 total_cpu_exec_micros = 15; + int64 total_exec_micros = 6; + int64 total_accelerator_exec_micros = 14; + int64 total_cpu_exec_micros = 15; - optional int64 total_requested_bytes = 7; - optional int64 total_parameters = 8; - optional int64 total_float_ops = 9; + int64 total_requested_bytes = 7; + int64 total_parameters = 8; + int64 total_float_ops = 9; // TensorFlow graph nodes contained by the TFMultiGraphNodeProto. repeated TFGraphNodeProto graph_nodes = 10; |