• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package tensorflow.data.model;
4
5option cc_enable_arenas = true;
6option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/model_go_proto";
7
8// Class of a node in the performance model.
9enum NodeClass {
10  UNKNOWN = 0;
11  INTERLEAVE_MANY = 1;
12  ASYNC_INTERLEAVE_MANY = 2;
13  KNOWN_RATIO = 3;
14  ASYNC_KNOWN_RATIO = 4;
15  UNKNOWN_RATIO = 5;
16}
17
18// Algorithm used for model autotuning optimization.
19enum AutotuneAlgorithm {
20  HILL_CLIMB = 0;
21  GRADIENT_DESCENT = 1;
22}
23
24// Protocol buffer representing the data used by the autotuning modeling
25// framework.
26message ModelProto {
27  // General representation of a node in the model.
28  message Node {
29    // Unique node ID.
30    int64 id = 1;
31
32    // Human-readable name of the node.
33    string name = 2;
34
35    // An indication whether autotuning is enabled for this node.
36    bool autotune = 3;
37
38    // The number of bytes stored in this node's buffer.
39    int64 buffered_bytes = 4;
40
41    // The number of elements stored in this node's buffer.
42    int64 buffered_elements = 5;
43
44    // The number of bytes consumed by the node.
45    int64 bytes_consumed = 6;
46
47    // The number of bytes produced by the node.
48    int64 bytes_produced = 7;
49
50    // The number of elements produced by the node.
51    int64 num_elements = 8;
52
53    // The aggregate processing time spent in this node.
54    int64 processing_time = 9;
55
56    // An indication whether this node records metrics about produced and
57    // consumed elements.
58    bool record_metrics = 10;
59
60    // Represents a node parameter.
61    message Parameter {
62      // Human-readable name of the parameter.
63      string name = 1;
64
65      // Identifies the model value of the parameter. This can be different from
66      // the actual value (e.g. during optimization search).
67      double value = 2;
68
69      // The actual value of the parameter.
70      double state_value = 3;
71
72      // Minimum value of the parameter.
73      double min = 4;
74
75      // Maximum value of the parameter.
76      double max = 5;
77
78      // Identifies whether the parameter should participate in autotuning.
79      bool tunable = 6;
80    }
81
82    // Parameters of this node.
83    repeated Parameter parameters = 11;
84
85    // Statistic of inputs processing time history.
86    double input_processing_time_sum = 12;
87    int64 input_processing_time_count = 13;
88
89    // IDs of inputs of this node.
90    repeated int64 inputs = 14;
91
92    // Class of this node.
93    NodeClass node_class = 15;
94
95    // Ratio of input to output elements. This is only used by KNOWN_RATIO and
96    // ASYNC_KNOWN_RATIO nodes.
97    double ratio = 16;
98
99    // Ratio identifies how many parallelism calls are introduced by one
100    // buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
101    double memory_ratio = 17;
102  }
103
104  // Map of node IDs to nodes of this model.
105  map<int64, Node> nodes = 1;
106
107  // ID of the output node of this model.
108  int64 output = 2;
109
110  // Counter for node IDs of this model.
111  int64 id_counter = 3;
112
113  // Indicates whether the modeling framework should collect resource usage,
114  // e.g. CPU, memory.
115  bool collect_resource_usage = 4;
116
117  // Contains parameters of the model autotuning optimization.
118  message OptimizationParams {
119    // Algorithm used for autotuning optimization.
120    AutotuneAlgorithm algorithm = 1;
121
122    // Number of available logical threads.
123    int64 cpu_budget = 2;
124
125    // Amount of available memory in bytes.
126    int64 ram_budget = 3;
127
128    // Time between two consecutive `GetNext` calls to the iterator represented
129    // by the output node.
130    double model_input_time = 4;
131  }
132
133  OptimizationParams optimization_params = 5;
134}
135