1syntax = "proto3"; 2 3package tensorflow; 4 5import "tensorflow/core/framework/tensor_shape.proto"; 6import "tensorflow/core/framework/types.proto"; 7 8option cc_enable_arenas = true; 9option java_outer_classname = "CostGraphProtos"; 10option java_multiple_files = true; 11option java_package = "org.tensorflow.framework"; 12option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/cost_graph_go_proto"; 13 14message CostGraphDef { 15 message Node { 16 // The name of the node. Names are globally unique. 17 string name = 1; 18 19 // The device of the node. Can be empty if the node is mapped to the 20 // default partition or partitioning hasn't been run yet. 21 string device = 2; 22 23 // The id of the node. Node ids are only unique inside a partition. 24 int32 id = 3; 25 26 // Inputs of this node. They must be executed before this node can be 27 // executed. An input is a particular output of another node, specified 28 // by the node id and the output index. 29 message InputInfo { 30 int32 preceding_node = 1; 31 int32 preceding_port = 2; 32 } 33 repeated InputInfo input_info = 4; 34 35 // Outputs of this node. 36 message OutputInfo { 37 int64 size = 1; 38 // If >= 0, the output is an alias of an input. Note that an alias input 39 // may itself be an alias. The algorithm will therefore need to follow 40 // those pointers. 41 int64 alias_input_port = 2; 42 TensorShapeProto shape = 3; 43 DataType dtype = 4; 44 } 45 repeated OutputInfo output_info = 5; 46 47 // Temporary memory used by this node. 48 int64 temporary_memory_size = 6; 49 50 // Persistent memory used by this node. 51 int64 persistent_memory_size = 12; 52 53 int64 host_temp_memory_size = 10 [deprecated = true]; 54 int64 device_temp_memory_size = 11 [deprecated = true]; 55 int64 device_persistent_memory_size = 16 [deprecated = true]; 56 57 // Estimate of the computational cost of this node, in microseconds. 58 int64 compute_cost = 9; 59 60 // Analytical estimate of the computational cost of this node, in 61 // microseconds. 62 int64 compute_time = 14; 63 64 // Analytical estimate of the memory access cost of this node, in 65 // microseconds. 66 int64 memory_time = 15; 67 68 // If true, the output is permanent: it can't be discarded, because this 69 // node is part of the "final output". Nodes may depend on final nodes. 70 bool is_final = 7; 71 72 // Ids of the control inputs for this node. 73 repeated int32 control_input = 8; 74 75 // Are the costs inaccurate? 76 bool inaccurate = 17; 77 } 78 repeated Node node = 1; 79 80 // Total cost of this graph, typically used for balancing decisions. 81 message AggregatedCost { 82 // Aggregated cost value. 83 float cost = 1; 84 85 // Aggregated cost dimension (e.g. 'memory', 'compute', 'network'). 86 string dimension = 2; 87 } 88 repeated AggregatedCost cost = 2; 89} 90