@@ -2,6 +2,8 @@ syntax = "proto3";
2
2
3
3
package tensorflow.data ;
4
4
5
+ option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_options_go_proto" ;
6
+
5
7
// Represents the type of auto-sharding we enable.
6
8
enum AutoShardPolicy {
7
9
// AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
@@ -23,6 +25,27 @@ enum AutoShardPolicy {
23
25
OFF = -1;
24
26
}
25
27
28
+ // next: 4
29
+ message AutotuneOptions {
30
+ // Whether to automatically tune performance knobs.
31
+ oneof optional_enabled {
32
+ bool enabled = 1 ;
33
+ }
34
+ // When autotuning is enabled (through autotune), determines the CPU budget to
35
+ // use. Values greater than the number of schedulable CPU cores are allowed
36
+ // but may result in CPU contention.
37
+ oneof optional_cpu_budget {
38
+ int32 cpu_budget = 2 ;
39
+ }
40
+ // When autotuning is enabled (through autotune), determines the RAM budget to
41
+ // use. Values greater than the available RAM in bytes may result in OOM. If
42
+ // 0, defaults to half of the available RAM in bytes.
43
+ oneof optional_ram_budget {
44
+ int64 ram_budget = 3 ;
45
+ }
46
+ }
47
+
48
+ // next: 3
26
49
message DistributeOptions {
27
50
AutoShardPolicy auto_shard_policy = 1 ;
28
51
// The number of devices attached to this input pipeline.
@@ -31,59 +54,25 @@ message DistributeOptions {
31
54
}
32
55
}
33
56
34
- message MapVectorization {
35
- // Whether to vectorize map transformations.
36
- oneof optional_enabled {
37
- bool enabled = 1 ;
38
- }
39
- // Whether to use ChooseFastestBranchDataset with this transformation. If
40
- // True, the pipeline picks between the vectorized and original segment at
41
- // runtime based on their iterations speed.
42
- oneof optional_use_choose_fastest {
43
- bool use_choose_fastest = 2 ;
44
- }
45
- }
46
-
57
+ // next: 18
47
58
message OptimizationOptions {
48
59
// Whether to apply default graph optimizations. If False, only graph
49
60
// optimizations that have been explicitly enabled will be applied.
50
61
oneof optional_apply_default_optimizations {
51
62
bool apply_default_optimizations = 1 ;
52
63
}
53
- // Whether to automatically tune performance knobs.
54
- oneof optional_autotune {
55
- bool autotune = 2 ;
56
- }
57
- // When autotuning is enabled (through autotune), determines whether to also
58
- // autotune buffer sizes for datasets with parallelism.
59
- oneof optional_autotune_buffers {
60
- bool autotune_buffers = 3 ;
61
- }
62
- // When autotuning is enabled (through autotune), determines the CPU budget to
63
- // use. Values greater than the number of schedulable CPU cores are allowed
64
- // but may result in CPU contention.
65
- oneof optional_autotune_cpu_budget {
66
- int32 autotune_cpu_budget = 4 ;
67
- }
68
- // When autotuning is enabled (through autotune), determines the RAM budget to
69
- // use. Values greater than the available RAM in bytes may result in OOM. If
70
- // 0, defaults to half of the available RAM in bytes.
71
- oneof optional_autotune_ram_budget {
72
- int32 autotune_ram_budget = 5 ;
73
- }
64
+ reserved 2 ;
65
+ reserved 3 ;
66
+ reserved 4 ;
67
+ reserved 5 ;
74
68
// Whether to fuse filter transformations.
75
69
oneof optional_filter_fusion {
76
70
bool filter_fusion = 6 ;
77
71
}
78
- // Whether to fuse filter dataset that predicts random_uniform < rate into a
79
- // sampling dataset.
80
- oneof optional_filter_with_random_uniform_fusion {
81
- bool filter_with_random_uniform_fusion = 7 ;
82
- }
83
- // Whether to hoist tf.random_uniform() ops out of map transformations.
84
- oneof optional_hoist_random_uniform {
85
- bool hoist_random_uniform = 8 ;
86
- }
72
+ // NOTE: field id 7 deleted in June 2021.
73
+ reserved 7 ;
74
+ // NOTE: field id 8 deleted in June 2021.
75
+ reserved 8 ;
87
76
// Whether to fuse map and batch transformations.
88
77
oneof optional_map_and_batch_fusion {
89
78
bool map_and_batch_fusion = 9 ;
@@ -100,8 +89,10 @@ message OptimizationOptions {
100
89
oneof optional_map_parallelization {
101
90
bool map_parallelization = 12 ;
102
91
}
103
- // The map vectorization options associated with the dataset.
104
- MapVectorization map_vectorization = 13 ;
92
+
93
+ // NOTE: field id 13 deleted in June 2021.
94
+ reserved 13 ;
95
+
105
96
// Whether to eliminate no-op transformations.
106
97
oneof optional_noop_elimination {
107
98
bool noop_elimination = 14 ;
@@ -115,21 +106,15 @@ message OptimizationOptions {
115
106
oneof optional_parallel_batch {
116
107
bool parallel_batch = 15 ;
117
108
}
118
- // Whether to reorder ops that will discard data to the front of unary
119
- // cardinality preserving transformations, e.g. dataset.map(...).take(3) will
120
- // be optimized to dataset.take(3).map(...). For now this optimization will
121
- // move `skip`, `shard` and `take` to the front of `map` and `prefetch`. This
122
- // optimization is only for performance; it will not affect the output of the
123
- // dataset.
124
- oneof optional_reorder_data_discarding_ops {
125
- bool reorder_data_discarding_ops = 16 ;
126
- }
109
+ // Field id 16 was removed in 06/2021.
110
+ reserved 16 ;
127
111
// Whether to fuse shuffle and repeat transformations.
128
112
oneof optional_shuffle_and_repeat_fusion {
129
113
bool shuffle_and_repeat_fusion = 17 ;
130
114
}
131
115
}
132
116
117
+ // next: 3
133
118
message ThreadingOptions {
134
119
// If set, it overrides the maximum degree of intra-op parallelism.
135
120
oneof optional_max_intra_op_parallelism {
@@ -150,12 +135,16 @@ enum ExternalStatePolicy {
150
135
151
136
// Message stored with Dataset objects to control how datasets are processed and
152
137
// optimized.
138
+ //
139
+ // next: 8
153
140
message Options {
154
141
// Whether the outputs need to be produced in deterministic order.
155
142
oneof optional_deterministic {
156
143
bool deterministic = 1 ;
157
144
}
158
145
// The distribution strategy options associated with the dataset.
146
+ AutotuneOptions autotune_options = 7 ;
147
+ // The distribution strategy options associated with the dataset.
159
148
DistributeOptions distribute_options = 2 ;
160
149
// The optimization options associated with the dataset.
161
150
OptimizationOptions optimization_options = 3 ;
0 commit comments