1/* Copyright 2019 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; 19 20import "tensorflow/core/protobuf/config.proto"; 21 22// Summarizes the results of auto-clustering a TensorFlow graph. 23// 24// Next ID: 5 25message XlaAutoClusteringSummary { 26 // Represents a single element in a histogram of ops ("op" as in "TensorFlow 27 // operation"). 28 // 29 // Next ID: 3 30 message OpAndCount { 31 // The TensorFlow operation (like MatMult, Add etc.) 32 string op = 1; 33 34 // The number of times this occurs. 35 int32 count = 2; 36 } 37 38 // Describes a single XLA cluster. 39 // 40 // Next ID: 4 41 message Cluster { 42 string name = 1; 43 44 // The number of nodes in the cluster. 45 int32 size = 2; 46 47 // A histogram of the TF operations in this cluster. 48 repeated OpAndCount op_histogram = 3; 49 }; 50 51 // The number of nodes in the graph that are not inside an XLA cluster. 52 int32 unclustered_node_count = 1; 53 54 // The number of nodes in the graph that are in an XLA cluster. 55 int32 clustered_node_count = 2; 56 57 // All of the XLA clusters in the TF graph. 58 repeated Cluster clusters = 3; 59 60 // A histogram of the TF operations that were not clustered. 61 repeated OpAndCount unclustered_op_histogram = 4; 62} 63 64// Listeners listening for auto clustering events get messages of this type. 65// 66// Next ID: 4 67message XlaAutoClusteringActivity { 68 // The value of GlobalJitLevel, as determined by `GetGlobalJitLevelForGraph`. 69 // This determines if global auto-clustering is enabled. 70 OptimizerOptions.GlobalJitLevel global_jit_level = 1; 71 72 // Whether --tf_xla_cpu_global_jit is enabled in TF_XLA_FLAGS. 73 bool cpu_global_jit_enabled = 2; 74 75 XlaAutoClusteringSummary summary = 3; 76} 77 78// Listeners listening for JIT compilation events get messages of this type. 79// Each instance of XlaJitCompilationActivity corresponds to a single 80// compilation of a single XLA cluster. E.g. if a graph has two clusters, A and 81// B, and A is compiled 5 times and B is compiled 2 times then we will generate 82// 7 instances of XlaJitCompilationActivity. 83// 84// Next ID: 5 85message XlaJitCompilationActivity { 86 string cluster_name = 1; 87 88 // The number of time this cluster has been compiled. 89 int32 compile_count = 2; 90 91 // Microseconds spent in the individual compilation being reported. 92 int64 compile_time_us = 3; 93 94 // Total microseconds spent in (re-)compiling this cluster so far. 95 int64 cumulative_compile_time_us = 4; 96} 97 98// LINT.IfChange 99// 100// Used for logging situations seen in Tensorflow models being optimized that 101// are known to not perform well with XLA. 102// 103// Next ID: 3 104message XlaOptimizationRemark { 105 // Next ID: 6 106 enum Warning { 107 NONE = 0; 108 INACCURATE_OPERATION = 1; 109 SLOW_OPERATION = 2; 110 UNIMPLEMENTED_OPERATION = 3; 111 SLOW_IMAGE_RESIZE_DIMENSIONS = 4; 112 MEGAMORPHIC_FUNCTION = 5; 113 } 114 115 Warning warning = 1; 116 117 // Information such as which node was the problem. 118 string debug_information = 2; 119} 120// LINT.ThenChange(https://www.tensorflow.org/code/tensorflow/compiler/jit/xla_activity_listener.h) 121