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