1/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 3Licensed under the Apache License, Version 2.0 (the "License"); 4you may not use this file except in compliance with the License. 5You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9Unless required by applicable law or agreed to in writing, software 10distributed under the License is distributed on an "AS IS" BASIS, 11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12See the License for the specific language governing permissions and 13limitations under the License. 14==============================================================================*/ 15 16syntax = "proto3"; 17 18package tensorflow; 19option cc_enable_arenas = true; 20 21import "tensorflow/core/framework/tensor.proto"; 22import "tensorflow/core/framework/tensor_shape.proto"; 23import "tensorflow/core/framework/types.proto"; 24import "tensorflow/core/framework/attr_value.proto"; 25import "tensorflow/core/protobuf/device_properties.proto"; 26 27// Description of the session when an op is run. 28message SessionInfo { 29 int64 intra_op_parallelism = 1; 30} 31 32// Description of an operation as well as the parameters expected to impact its 33// performance. 34message OpInfo { 35 // The operation name. There may be custom parameters in attrs. 36 string op = 1; 37 38 // Custom parameters impacting the behavior of the op. 39 map<string, AttrValue> attr = 2; 40 41 // Input data types, shapes and values if known. 42 message TensorProperties { 43 DataType dtype = 1; 44 TensorShapeProto shape = 2; 45 TensorProto value = 3; 46 }; 47 repeated TensorProperties inputs = 3; 48 49 // Optional description of the op outputs 50 repeated TensorProperties outputs = 5; 51 52 // Device on which the operation is run. 53 DeviceProperties device = 4; 54 55 // Information about the session configs. 56 SessionInfo session_info = 6; 57} 58 59message NormalDistribution { 60 double mu = 1; 61 double sigma = 2; 62} 63 64message LogNormalDistribution { 65 double mu = 1; 66 double sigma = 2; 67} 68 69// Performance data for tensorflow operations 70message OpPerformance { 71 // The op 72 OpInfo op = 1; 73 74 // Information about the session configs. 75 SessionInfo session_info = 12 [deprecated = true]; 76 77 // The node name (optional). Makes it easier to associate the performance data 78 // with a specific graph node. 79 string node = 5; 80 81 // Temporary memory used by this node (in bytes). 82 int64 temporary_memory_size = 2; 83 84 // Time it takes to run the op (in nanoseconds). 85 int64 compute_cost = 3; 86 87 // Analytical compute cost (in nanoseconds). 88 int64 compute_time = 6; 89 90 // Analytical memory access cost (in nanoseconds). 91 int64 memory_time = 7; 92 93 // Percentage of theoretical compute performance. 94 double compute_efficiency = 4; 95 96 // Percentage of theoretical memory performance. 97 double memory_efficiency = 8; 98 99 // Expected execution time, modeled using one of 2 possible distributions. 100 oneof execution_time { 101 NormalDistribution execution_time_normal = 10; 102 LogNormalDistribution execution_time_log_normal = 11; 103 }; 104 105 // Memory usage data for a tensorflow operation. 106 message OpMemory { 107 // The output information may have memory usage and output shapes. 108 repeated int64 output_memory = 1; 109 110 // Temp and persistent memory allocated by this node. 111 int64 temp_memory = 2; 112 int64 persistent_memory = 4; 113 114 int64 device_temp_memory = 3 [deprecated = true]; 115 int64 device_persistent_memory = 5 [deprecated = true]; 116 } 117 OpMemory op_memory = 9; 118} 119 120// A collection of OpPerformance data points. 121message OpPerformanceList { 122 repeated OpPerformance op_performance = 1; 123} 124