• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow;
4option cc_enable_arenas = true;
5option java_outer_classname = "StepStatsProtos";
6option java_multiple_files = true;
7option java_package = "org.tensorflow.framework";
8option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
9import "tensorflow/core/framework/allocation_description.proto";
10import "tensorflow/core/framework/tensor_description.proto";
11
12// An allocation/de-allocation operation performed by the allocator.
13message AllocationRecord {
14  // The timestamp of the operation.
15  int64 alloc_micros = 1;
16  // Number of bytes allocated, or de-allocated if negative.
17  int64 alloc_bytes = 2;
18}
19
20message AllocatorMemoryUsed {
21  string allocator_name = 1;
22  // These are per-node allocator memory stats.
23  int64 total_bytes = 2;
24  int64 peak_bytes = 3;
25  // The bytes that are not deallocated.
26  int64 live_bytes = 4;
27  // The allocation and deallocation timeline.
28  repeated AllocationRecord allocation_records = 6;
29
30  // These are snapshots of the overall allocator memory stats.
31  // The number of live bytes currently allocated by the allocator.
32  int64 allocator_bytes_in_use = 5;
33}
34
35// Output sizes recorded for a single execution of a graph node.
36message NodeOutput {
37  int32 slot = 1;
38  TensorDescription tensor_description = 3;
39};
40
41// For memory tracking.
42message MemoryStats {
43  int64 temp_memory_size = 1;
44  int64 persistent_memory_size = 3;
45  repeated int64 persistent_tensor_alloc_ids = 5;
46
47  int64 device_temp_memory_size = 2 [deprecated = true];
48  int64 device_persistent_memory_size = 4 [deprecated = true];
49  repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true];
50}
51
52// Time/size stats recorded for a single execution of a graph node.
53message NodeExecStats {
54  // TODO(tucker): Use some more compact form of node identity than
55  // the full string name.  Either all processes should agree on a
56  // global id (cost_id?) for each node, or we should use a hash of
57  // the name.
58  string node_name = 1;
59  int64 all_start_micros = 2;
60  int64 op_start_rel_micros = 3;
61  int64 op_end_rel_micros = 4;
62  int64 all_end_rel_micros = 5;
63  repeated AllocatorMemoryUsed memory = 6;
64  repeated NodeOutput output = 7;
65  string timeline_label = 8;
66  int64 scheduled_micros = 9;
67  uint32 thread_id = 10;
68  repeated AllocationDescription referenced_tensor = 11;
69  MemoryStats memory_stats = 12;
70  int64 all_start_nanos = 13;
71  int64 op_start_rel_nanos = 14;
72  int64 op_end_rel_nanos = 15;
73  int64 all_end_rel_nanos = 16;
74  int64 scheduled_nanos = 17;
75};
76
77message DeviceStepStats {
78  string device = 1;
79  repeated NodeExecStats node_stats = 2;
80  // Its key is thread id.
81  map<uint32, string> thread_names = 3;
82}
83
84message StepStats {
85  repeated DeviceStepStats dev_stats = 1;
86};
87