1syntax = "proto3"; 2 3import "tensorflow/core/framework/tensor_shape.proto"; 4import "tensorflow/core/framework/types.proto"; 5 6package tensorflow.tfprof; 7 8message TFProfTensorProto { 9 DataType dtype = 1; 10 // Flatten tensor in row-major. 11 // Only one of the following array is set. 12 repeated double value_double = 2; 13 repeated int64 value_int64 = 3; 14 repeated string value_str = 4; 15} 16 17// A node in TensorFlow graph. Used by scope/graph view. 18message GraphNodeProto { 19 // op name. 20 string name = 1; 21 // tensor value restored from checkpoint. 22 TFProfTensorProto tensor_value = 15; 23 // op execution time. 24 // A node can be defined once but run multiple times in tf.while_loop. 25 // the times sum up all different runs. 26 int64 run_count = 21; 27 int64 exec_micros = 2; 28 int64 accelerator_exec_micros = 17; 29 int64 cpu_exec_micros = 18; 30 31 // Total bytes requested by the op. 32 int64 requested_bytes = 3; 33 // Max bytes allocated and being used by the op at a point. 34 int64 peak_bytes = 24; 35 // Total bytes requested by the op and not released before end. 36 int64 residual_bytes = 25; 37 // Total bytes output by the op (not necessarily allocated by the op). 38 int64 output_bytes = 26; 39 40 // Number of parameters if available. 41 int64 parameters = 4; 42 // Number of float operations. 43 int64 float_ops = 13; 44 // Device the op is assigned to. 45 // Since an op can fire multiple kernel calls, there can be multiple devices. 46 repeated string devices = 10; 47 48 // The following are the aggregated stats from all *accounted* children and 49 // the node itself. The actual children depend on the data structure used. 50 // In graph view, children are inputs recursively. 51 // In scope view, children are nodes under the name scope. 52 int64 total_definition_count = 23; 53 int64 total_run_count = 22; 54 int64 total_exec_micros = 6; 55 int64 total_accelerator_exec_micros = 19; 56 int64 total_cpu_exec_micros = 20; 57 58 int64 total_requested_bytes = 7; 59 int64 total_peak_bytes = 27; 60 int64 total_residual_bytes = 28; 61 int64 total_output_bytes = 29; 62 63 int64 total_parameters = 8; 64 int64 total_float_ops = 14; 65 66 // shape information, if available. 67 // TODO(xpan): Why is this repeated? 68 repeated TensorShapeProto shapes = 11; 69 70 map<int32, TensorShapeProto> input_shapes = 16; 71 72 // Descendants of the graph. The actual descendants depend on the data 73 // structure used (scope, graph). 74 repeated GraphNodeProto children = 12; 75} 76 77// A node that groups multiple GraphNodeProto. 78// Depending on the 'view', the semantics of the TFmultiGraphNodeProto 79// is different: 80// code view: A node groups all TensorFlow graph nodes created by the 81// Python code. 82// op view: A node groups all TensorFlow graph nodes that are of type 83// of the op (e.g. MatMul, Conv2D). 84message MultiGraphNodeProto { 85 // Name of the node. 86 string name = 1; 87 88 // code execution time. 89 int64 exec_micros = 2; 90 int64 accelerator_exec_micros = 12; 91 int64 cpu_exec_micros = 13; 92 93 // Total requested bytes by the code. 94 int64 requested_bytes = 3; 95 // Max bytes allocated and being used by the op at a point. 96 int64 peak_bytes = 16; 97 // Total bytes requested by the op and not released before end. 98 int64 residual_bytes = 17; 99 // Total bytes output by the op (not necessarily allocated by the op). 100 int64 output_bytes = 18; 101 102 // Number of parameters if available. 103 int64 parameters = 4; 104 // Number of float operations. 105 int64 float_ops = 5; 106 107 // The following are the aggregated stats from descendants. 108 // The actual descendants depend on the data structure used. 109 int64 total_exec_micros = 6; 110 int64 total_accelerator_exec_micros = 14; 111 int64 total_cpu_exec_micros = 15; 112 113 int64 total_requested_bytes = 7; 114 int64 total_peak_bytes = 19; 115 int64 total_residual_bytes = 20; 116 int64 total_output_bytes = 21; 117 118 int64 total_parameters = 8; 119 int64 total_float_ops = 9; 120 121 // TensorFlow graph nodes contained by the MultiGraphNodeProto. 122 repeated GraphNodeProto graph_nodes = 10; 123 // Descendants of the node. The actual descendants depend on the data 124 // structure used. 125 repeated MultiGraphNodeProto children = 11; 126} 127 128message AdviceProto { 129 // checker name -> a list of reports from the checker. 130 map<string, Checker> checkers = 1; 131 message Checker { 132 repeated string reports = 2; 133 } 134} 135