1syntax = "proto3";
2
3package tensorflow;
4
5import "tensorflow/core/framework/graph.proto";
6
7// Tensor Tracer Report proto gives information about the trace including:
8// - TensorTracerConfig: version, device, num replicas, trace mode.
9// - Graphdef, e.g., list of operations, tensors
10// - TracedTensorDef:
11//    * Name of the tensor
12//    * Tracepoint name if provided.
13//    * Index of the tensor in the compact cache if traced.
14//    * Explanation for why the tensor is traced or not.
15message TensorTracerReport {
16  TensorTracerConfig config = 1;
17
18  // Tensorflow graph.
19  tensorflow.GraphDef graphdef = 2;
20
21  // A map from tensor name to its TracedTensorDef.
22  map<string, TracedTensorDef> tensordef = 3;
23
24  // The fingerprint of the TensorTracerReport (fingerprint calculation excludes
25  // this field and graphdef).
26  string fingerprint = 4;
27
28  message TensorTracerConfig {
29    // Tensor tracer version, e.g. hostcall, outside compilation.
30    string version = 1;
31    // Traced device, CPU, TPU...
32    string device = 2;
33
34    // Trace mode, norm, summary, full-trace.
35    string trace_mode = 3;
36
37    // Number of cores, e.g. TPU cores, in the system.
38    int32 num_cores = 4;
39
40    // Number of hosts, e.g. compute nodes in the system.
41    int32 num_hosts = 5;
42
43    // Keep submode as string for backward compatibility.
44    string submode = 6;
45
46    // Keep num cores per host for backward compatibility.
47    int32 num_cores_per_host = 7;
48
49    // Id of the included cores, if a subset of cores are traced.
50    repeated int32 included_cores = 8;
51
52    // The names of the signatures corresponding to the cache indices.
53    repeated string signatures = 9;
54  }
55
56  message TracedTensorDef {
57    // Name of the tensor as appears in tf graph.
58    string name = 1;
59    // Cache index of the tensor. This may be different than topological index.
60    int32 cache_index = 2;
61    // If trace points are provided, corresponding tracepoint name of the
62    // tensor. Trace points are placed on the edges (tensors) in the tensorflow
63    // graph, and they force tensor tracer to trace the corresponding tensor.
64    // Tracepoints can be added using the programatic interface
65    // tensor_tracer.tensor_tracepoint(tensor, trace_point_name) function.
66    // This will add a trace point with the given trace_point_name for the given
67    // tensor. If a trace_point is provided for the tensor,
68    // trace_point name will be used for the rest of the analysis instead of
69    // tensor names. One can use trace_point_name's to compare two models with
70    // arbitrary tensor names by providing the same trace point name for the
71    // tensors that are comparable.
72    string trace_point_name = 3;
73    // Whether the tensor is traced or not.
74    bool is_traced = 4;
75    // Detailed explanation why the tensor is traced or not.
76    string explanation = 5;
77  }
78}
79