Skip to content

Commit 9098e5d

Browse files
committed
update tensorflow serving protos to 2.5.1
1 parent 8882662 commit 9098e5d

32 files changed

+601
-119
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# upstream tensorflow/serving version
2-
build --embed_label=2.4.1
2+
build --embed_label=2.5.1
33

44
build --verbose_failures
55
# enable proper toolchain resolution for cc rules

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ Additionally, a pure python3 wheel is published that includes the `tensorflow_se
6767
**Install Wheels with `pip`**
6868
```sh
6969
# on linux_amd64 python 3.7
70-
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-cp37-none-manylinux2014_x86_64.whl
70+
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.5.1/tensorflow_serving_arm_client-2.5.1-cp37-none-manylinux2014_x86_64.whl
7171
# on linux_arm64 python 3.7
72-
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-cp37-none-manylinux2014_aarch64.whl
72+
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.5.1/tensorflow_serving_arm_client-2.5.1-cp37-none-manylinux2014_aarch64.whl
7373
# on linux_arm python 3.7
74-
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-cp37-none-manylinux2014_armv7l.whl
74+
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.5.1/tensorflow_serving_arm_client-2.5.1-cp37-none-manylinux2014_armv7l.whl
7575
# pure python 3 (will require grpcio and protobuf pypi packages)
76-
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-py3-none-any.whl
76+
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.5.1/tensorflow_serving_arm_client-2.5.1-py3-none-any.whl
7777
```
7878

7979
**Building Wheels From Source**

proto/tensorflow/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ proto_library(
99
"//proto/tensorflow/core:protos_all",
1010
"//proto/tensorflow/core/example:protos_all",
1111
"//proto/tensorflow/core/framework:protos_all",
12+
"//proto/tensorflow/core/grappler/costs:protos_all",
1213
"//proto/tensorflow/core/lib/core:protos_all",
1314
"//proto/tensorflow/core/profiler:protos_all",
1415
"//proto/tensorflow/core/profiler/protobuf:protos_all",

proto/tensorflow/core/BUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ proto_library(
1919
"protobuf/cluster.proto",
2020
"protobuf/config.proto",
2121
"protobuf/control_flow.proto",
22-
"protobuf/data/experimental/service_config.proto",
23-
"protobuf/data/experimental/snapshot.proto",
2422
"protobuf/debug.proto",
2523
"protobuf/debug_event.proto",
2624
"protobuf/device_filters.proto",
2725
"protobuf/device_properties.proto",
26+
"protobuf/extension_type_variant.proto",
2827
"protobuf/graph_debug_info.proto",
2928
"protobuf/meta_graph.proto",
3029
"protobuf/named_tensor.proto",
@@ -34,6 +33,8 @@ proto_library(
3433
"protobuf/saved_model.proto",
3534
"protobuf/saved_object_graph.proto",
3635
"protobuf/saver.proto",
36+
"protobuf/service_config.proto",
37+
"protobuf/snapshot.proto",
3738
"protobuf/struct.proto",
3839
"protobuf/tensor_bundle.proto",
3940
"protobuf/tensorflow_server.proto",
@@ -47,6 +48,7 @@ proto_library(
4748
":error_codes_proto_impl",
4849
"//proto/tensorflow/core/example:protos_all",
4950
"//proto/tensorflow/core/framework:protos_all",
51+
"//proto/tensorflow/core/grappler/costs:protos_all",
5052
"//proto/tensorflow/core/lib/core:protos_all",
5153
"//proto/tensorflow/core/profiler:protos_all",
5254
"//proto/tensorflow/core/profiler/protobuf:protos_all",

proto/tensorflow/core/example/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ proto_library(
3838
srcs = ["example.proto"],
3939
go_package = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/example",
4040
strip_import_prefix = "/proto/",
41-
deps = [":feature_proto"],
4241
)

proto/tensorflow/core/example/example.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ option java_multiple_files = true;
1212
option java_package = "org.tensorflow.example";
1313
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";
1414

15+
// LINT.IfChange
1516
// An Example is a mostly-normalized data format for storing data for
1617
// training and inference. It contains a key-value store (features); where
1718
// each key (string) maps to a Feature message (which is oneof packed BytesList,
@@ -301,3 +302,5 @@ message SequenceExample {
301302
Features context = 1;
302303
FeatureLists feature_lists = 2;
303304
}
305+
// LINT.ThenChange(
306+
// https://www.tensorflow.org/code/tensorflow/python/training/training.py)

proto/tensorflow/core/example/feature.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ option java_multiple_files = true;
6363
option java_package = "org.tensorflow.example";
6464
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";
6565

66+
// LINT.IfChange
6667
// Containers to hold repeated fundamental values.
6768
message BytesList {
6869
repeated bytes value = 1;
@@ -105,3 +106,5 @@ message FeatureLists {
105106
// Map from feature name to feature list.
106107
map<string, FeatureList> feature_list = 1;
107108
}
109+
// LINT.ThenChange(
110+
// https://www.tensorflow.org/code/tensorflow/python/training/training.py)

proto/tensorflow/core/framework/BUILD

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ proto_library(
1111
":api_def_proto",
1212
":attr_value_proto",
1313
":cost_graph_proto",
14+
":dataset_options_proto",
1415
":device_attributes_proto",
1516
":function_proto",
1617
":graph_proto",
1718
":graph_transfer_info_proto",
1819
":kernel_def_proto",
1920
":log_memory_proto",
21+
":model_proto",
2022
":node_def_proto",
2123
":op_def_proto",
2224
":reader_base_proto",
23-
":remote_fused_graph_execute_info_proto",
2425
":resource_handle_proto",
2526
":step_stats_proto",
2627
":summary_proto",
@@ -130,25 +131,6 @@ proto_library(
130131
],
131132
)
132133

133-
proto_library(
134-
name = "remote_fused_graph_execute_info_proto",
135-
srcs = ["remote_fused_graph_execute_info.proto"],
136-
go_package = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework",
137-
strip_import_prefix = "/proto/",
138-
deps = [
139-
":attr_value_proto",
140-
":function_proto",
141-
":graph_proto",
142-
":node_def_proto",
143-
":op_def_proto",
144-
":resource_handle_proto",
145-
":tensor_proto",
146-
":tensor_shape_proto",
147-
":types_proto",
148-
":versions_proto",
149-
],
150-
)
151-
152134
proto_library(
153135
name = "reader_base_proto",
154136
srcs = ["reader_base.proto"],
@@ -184,6 +166,13 @@ proto_library(
184166
],
185167
)
186168

169+
proto_library(
170+
name = "model_proto",
171+
srcs = ["model.proto"],
172+
go_package = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework",
173+
strip_import_prefix = "/proto/",
174+
)
175+
187176
proto_library(
188177
name = "log_memory_proto",
189178
srcs = ["log_memory.proto"],
@@ -260,6 +249,13 @@ proto_library(
260249
strip_import_prefix = "/proto/",
261250
)
262251

252+
proto_library(
253+
name = "dataset_options_proto",
254+
srcs = ["dataset_options.proto"],
255+
go_package = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework",
256+
strip_import_prefix = "/proto/",
257+
)
258+
263259
proto_library(
264260
name = "cost_graph_proto",
265261
srcs = ["cost_graph.proto"],
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
syntax = "proto3";
2+
3+
package tensorflow.data;
4+
5+
// Represents the type of auto-sharding we enable.
6+
enum AutoShardPolicy {
7+
// AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
8+
AUTO = 0;
9+
// FILE: Shards by input files (i.e. each worker will get a set of files to
10+
// process). When this option is selected, make sure that there is at least as
11+
// many files as workers. If there are fewer input files than workers, a
12+
// runtime error will be raised.
13+
FILE = 1;
14+
// DATA: Shards by elements produced by the dataset. Each worker will process
15+
// the whole dataset and discard the portion that is not for itself. Note that
16+
// for this mode to correctly partitions the dataset elements, the dataset
17+
// needs to produce elements in a deterministic order.
18+
DATA = 2;
19+
// HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
20+
// as a placeholder to replace with `shard(num_workers, worker_index)`.
21+
HINT = 3;
22+
// OFF: No sharding will be performed.
23+
OFF = -1;
24+
}
25+
26+
message DistributeOptions {
27+
AutoShardPolicy auto_shard_policy = 1;
28+
// The number of devices attached to this input pipeline.
29+
oneof optional_num_devices {
30+
int32 num_devices = 2;
31+
}
32+
}
33+
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+
47+
message OptimizationOptions {
48+
// Whether to apply default graph optimizations. If False, only graph
49+
// optimizations that have been explicitly enabled will be applied.
50+
oneof optional_apply_default_optimizations {
51+
bool apply_default_optimizations = 1;
52+
}
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+
}
74+
// Whether to fuse filter transformations.
75+
oneof optional_filter_fusion {
76+
bool filter_fusion = 6;
77+
}
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+
}
87+
// Whether to fuse map and batch transformations.
88+
oneof optional_map_and_batch_fusion {
89+
bool map_and_batch_fusion = 9;
90+
}
91+
// Whether to fuse map and filter transformations.
92+
oneof optional_map_and_filter_fusion {
93+
bool map_and_filter_fusion = 10;
94+
}
95+
// Whether to fuse map transformations.
96+
oneof optional_map_fusion {
97+
bool map_fusion = 11;
98+
}
99+
// Whether to parallelize stateless map transformations.
100+
oneof optional_map_parallelization {
101+
bool map_parallelization = 12;
102+
}
103+
// The map vectorization options associated with the dataset.
104+
MapVectorization map_vectorization = 13;
105+
// Whether to eliminate no-op transformations.
106+
oneof optional_noop_elimination {
107+
bool noop_elimination = 14;
108+
}
109+
// Whether to parallelize copying of batch elements. This optimization is
110+
// highly experimental and can cause performance degradation (e.g. when the
111+
// parallelization overhead exceeds the benefits of performing the data copies
112+
// in parallel). You should only enable this optimization if a) your input
113+
// pipeline is bottlenecked on batching and b) you have validated that this
114+
// optimization improves performance.
115+
oneof optional_parallel_batch {
116+
bool parallel_batch = 15;
117+
}
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+
}
127+
// Whether to fuse shuffle and repeat transformations.
128+
oneof optional_shuffle_and_repeat_fusion {
129+
bool shuffle_and_repeat_fusion = 17;
130+
}
131+
}
132+
133+
message ThreadingOptions {
134+
// If set, it overrides the maximum degree of intra-op parallelism.
135+
oneof optional_max_intra_op_parallelism {
136+
int32 max_intra_op_parallelism = 1;
137+
}
138+
// If set, the dataset will use a private threadpool of the given size.
139+
oneof optional_private_threadpool_size {
140+
int32 private_threadpool_size = 2;
141+
}
142+
}
143+
144+
// Represents how to handle external state during serialization.
145+
enum ExternalStatePolicy {
146+
POLICY_WARN = 0;
147+
POLICY_IGNORE = 1;
148+
POLICY_FAIL = 2;
149+
}
150+
151+
// Message stored with Dataset objects to control how datasets are processed and
152+
// optimized.
153+
message Options {
154+
// Whether the outputs need to be produced in deterministic order.
155+
oneof optional_deterministic {
156+
bool deterministic = 1;
157+
}
158+
// The distribution strategy options associated with the dataset.
159+
DistributeOptions distribute_options = 2;
160+
// The optimization options associated with the dataset.
161+
OptimizationOptions optimization_options = 3;
162+
// Whether to introduce 'slack' in the last `prefetch` of the input pipeline,
163+
// if it exists. This may reduce CPU contention with accelerator host-side
164+
// activity at the start of a step. The slack frequency is determined by the
165+
// number of devices attached to this input pipeline.
166+
oneof optional_slack {
167+
bool slack = 4;
168+
}
169+
// The threading options associated with the dataset.
170+
ThreadingOptions threading_options = 5;
171+
// This option can be used to override the default policy for how to handle
172+
// external state when serializing a dataset or checkpointing its iterator.
173+
// There are three settings available - IGNORE: External state is ignored
174+
// without a warning; WARN: External state is ignored and a warning is logged;
175+
// FAIL: External state results in an error.
176+
oneof optional_external_state_policy {
177+
ExternalStatePolicy external_state_policy = 6;
178+
}
179+
}

proto/tensorflow/core/framework/graph.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ message GraphDef {
2626
// compatible, this field is entirely ignored.
2727
int32 version = 3 [deprecated = true];
2828

29-
// EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.
30-
//
3129
// "library" provides user-defined functions.
3230
//
3331
// Naming:

0 commit comments

Comments
 (0)