Skip to content

Commit

Permalink
update tensorflow serving protos to 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emacski committed Mar 19, 2021
1 parent a021aa0 commit 32e1e66
Show file tree
Hide file tree
Showing 33 changed files with 201 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# upstream tensorflow/serving version
build --embed_label=2.3.0
build --embed_label=2.4.0

build --verbose_failures
# enable proper toolchain resolution for cc rules
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Additionally, a pure python3 wheel is published that includes the `tensorflow_se
**Install Wheels with `pip`**
```sh
# on linux_amd64 python 3.7
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_x86_64.whl
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.0/tensorflow_serving_arm_client-2.4.0-cp37-none-manylinux2014_x86_64.whl
# on linux_arm64 python 3.7
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_aarch64.whl
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.0/tensorflow_serving_arm_client-2.4.0-cp37-none-manylinux2014_aarch64.whl
# on linux_arm python 3.7
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_armv7l.whl
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.0/tensorflow_serving_arm_client-2.4.0-cp37-none-manylinux2014_armv7l.whl
# pure python 3 (will also install grpcio and protobuf pypi packages)
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-py3-none-any.whl
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.0/tensorflow_serving_arm_client-2.4.0-py3-none-any.whl
```

**Building Wheels From Source**
Expand Down
1 change: 1 addition & 0 deletions proto/tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ proto_library(
"protobuf/cluster.proto",
"protobuf/config.proto",
"protobuf/control_flow.proto",
"protobuf/data/experimental/service_config.proto",
"protobuf/data/experimental/snapshot.proto",
"protobuf/debug.proto",
"protobuf/debug_event.proto",
Expand Down
11 changes: 11 additions & 0 deletions proto/tensorflow/core/framework/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@ enum DataType {
// https://www.tensorflow.org/code/tensorflow/core/framework/types.cc,
// https://www.tensorflow.org/code/tensorflow/python/framework/dtypes.py,
// https://www.tensorflow.org/code/tensorflow/python/framework/function.py)

// For identifying the underlying type of a variant. For variants, the types
// listed here are a subset of the types in the variant type registry,
// corresponding to commonly used variants which must occasionally be
// special-cased.
enum SpecializedType {
// Invalid/unknown specialized type.
ST_INVALID = 0;
// "tensorflow::TensorList" in the variant type registry.
ST_TENSOR_LIST = 1;
}
33 changes: 32 additions & 1 deletion proto/tensorflow/core/profiler/profiler_options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package tensorflow;

// Next ID: 11
message ProfileOptions {
// Some default value of option are not proto3 default value. Use this version
// to determine if we should use default option value instead of proto3
Expand Down Expand Up @@ -50,5 +51,35 @@ message ProfileOptions {
// Whether serialize hlo_proto when XLA is used. (version >= 1)
bool enable_hlo_proto = 7;

// next-field: 8
// The local profiler starts profiling at this Unix timestamp in nanoseconds.
uint64 start_timestamp_ns = 8;

// The local profiler collects `duration_ms` milliseconds of data. If the
// value is 0, profiling continues until interrupted.
uint64 duration_ms = 9;

// Directory to save profile data to. No-op when empty.
string repository_path = 10;
}

// Options for remote profiler session manager.
// Next ID: 6
message RemoteProfilerSessionManagerOptions {
// Options for each local profiler.
ProfileOptions profiler_options = 1;

// List of servers to profile. Supported formats: host:port.
repeated string service_addresses = 2;

// Unix timestamp of when the session was started.
uint64 session_creation_timestamp_ns = 3;

// Maximum time (in milliseconds) a profiling session manager waits for all
// profilers to finish after issuing gRPC request. If value is 0, session
// continues until interrupted. Otherwise, value must be greater than
// profiler_options.duration_ms.
uint64 max_session_duration_ms = 4;

// Start of profiling is delayed by this much (in milliseconds).
uint64 delay_ms = 5;
}
19 changes: 15 additions & 4 deletions proto/tensorflow/core/profiler/protobuf/xplane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ package tensorflow.profiler;
option cc_enable_arenas = true;

// A container of parallel XPlanes, generated by one or more profiling sources.
// Next ID: 4
// Next ID: 5
message XSpace {
repeated XPlane planes = 1;
// Errors (if any) in the generation of planes.
repeated string errors = 2;
// Warnings (if any) in the generation of planes;
repeated string warnings = 3;
// List of hostnames that XPlanes are generated from.
repeated string hostnames = 4;
}

// An XPlane is a container of parallel timelines (XLines), generated by a
Expand All @@ -36,6 +38,7 @@ message XPlane {
map<int64, XStatMetadata> stat_metadata = 5;

// XStats associated with this plane, e.g. device capabilities.
// Each of these XStats should have a different metadata_id.
repeated XStat stats = 6;
}

Expand Down Expand Up @@ -89,6 +92,7 @@ message XEvent {
int64 duration_ps = 3;

// XStats associated with the event.
// Each of these XStats should have a different metadata_id.
repeated XStat stats = 4;
}

Expand All @@ -112,8 +116,9 @@ message XStat {
}
}

// Metadata for an XEvent, shared by all instances of the same event.
// Next ID: 5
// Metadata for an XEvent, corresponds to an event type and is shared by
// all XEvents with the same metadata_id.
// Next ID: 6
message XEventMetadata {
// XPlane.event_metadata map key.
int64 id = 1;
Expand All @@ -126,15 +131,21 @@ message XEventMetadata {

// Additional metadata in serialized format.
bytes metadata = 3;

// XStats that are constant for all XEvents with the same metadata_id.
// Each of these XStats should have a different metadata_id.
repeated XStat stats = 5;
}

// Metadata for an XStat, shared by all instances of the same stat.
// Metadata for an XStat, corresponds to a stat type and is shared by all
// XStats with the same metadata_id.
// Next ID: 4
message XStatMetadata {
// XPlane.stat_metadata map key.
int64 id = 1;

// Name of the stat (should be short).
// Two XStatMetadata with different id should have different names.
string name = 2;

// Description of the stat (might be long).
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/bfc_memory_map.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package tensorflow;

option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// Some of the data from AllocatorStats
message MemAllocatorStats {
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "ClusterProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// This file contains protos to be used when defining a TensorFlow
// cluster.
Expand Down
21 changes: 20 additions & 1 deletion proto/tensorflow/core/protobuf/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "ConfigProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

message GPUOptions {
// Fraction of the available GPU memory to allocate for each process.
Expand Down Expand Up @@ -568,6 +568,9 @@ message ConfigProto {
// Session::Extend() may not be supported.
bool optimize_for_static_graph = 12;

// This field will eventually be deprecated and replaced by
// mlir_bridge_rollout (b/166038521).
//
// Whether to enable the MLIR-based TF->XLA bridge.
//
// This is a replacement to the existing bridge, and not ready for
Expand All @@ -581,6 +584,22 @@ message ConfigProto {
// to lower the encapsulated graph to a particular device.
bool enable_mlir_bridge = 13;

// An enum that describes the state of the MLIR bridge rollout.
enum MlirBridgeRollout {
// If this field is left unspecified, the MLIR bridge may be selectively
// enabled on a per graph basis.
MLIR_BRIDGE_ROLLOUT_UNSPECIFIED = 0;
// Enabling the MLIR bridge enables it for all graphs in this session.
MLIR_BRIDGE_ROLLOUT_ENABLED = 1;
// Disabling the MLIR bridge disables it for all graphs in this session.
MLIR_BRIDGE_ROLLOUT_DISABLED = 2;
}
// This field is underdevelopment, for now use enable_mlir_bridge
// (b/166038521).
//
// Whether to enable the MLIR-based TF->XLA bridge.
MlirBridgeRollout mlir_bridge_rollout = 17;

// Whether to enable the MLIR-based Graph optimizations.
//
// This will become a part of standard Tensorflow graph optimization
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/control_flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "ControlFlowProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// Control flow context related protocol buffers.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
syntax = "proto3";

package tensorflow.data.experimental;

// Configuration for a tf.data service DispatchServer.
message DispatcherConfig {
// The port for the dispatcher to bind to. A value of 0 indicates that the
// dispatcher may bind to any available port.
int64 port = 1;
// The protocol for the dispatcher to use when connecting to workers.
string protocol = 2;
// A work directory to use for storing dispatcher state, and for recovering
// during restarts. The empty string indicates not to use any work directory.
string work_dir = 3;
// Whether to run in fault tolerant mode, where dispatcher state is saved
// across restarts. Requires that `work_dir` is nonempty.
bool fault_tolerant_mode = 4;
// How often the dispatcher should scan through to delete old and unused jobs.
int64 job_gc_check_interval_ms = 5;
// How long a job needs to be unused before it becomes a candidate for garbage
// collection.
int64 job_gc_timeout_ms = 6;
}

// Configuration for a tf.data service WorkerServer.
message WorkerConfig {
// The port for the worker to bind to. A value of 0 indicates that the
// worker may bind to any available port.
int64 port = 1;
// The protocol for the worker to use when connecting to the dispatcher.
string protocol = 2;
// The address of the dispatcher to register with.
string dispatcher_address = 3;
// The address of the worker server. The substring "%port%", if specified,
// will be replaced with the worker's bound port. This is useful when the port
// is set to `0`.
string worker_address = 4;
// How often the worker should heartbeat to the master.
int64 heartbeat_interval_ms = 5;
// How long to retry requests to the dispatcher before giving up and reporting
// an error.
int64 dispatcher_timeout_ms = 6;
}
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "DebugProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// Option for watching a node in TensorFlow Debugger (tfdbg).
message DebugTensorWatch {
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/debug_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "DebugEventProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.util";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// Available modes for extracting debugging information from a Tensor.
// TODO(cais): Document the detailed column names and semantics in a separate
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/device_filters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "DeviceFiltersProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// This file contains protos to be used when defining a TensorFlow
// cluster.
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/device_properties.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "DevicePropertiesProtos";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

message DeviceProperties {
// Device type (CPU, GPU, ...)
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/error_codes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "ErrorCodesProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// The canonical error codes for TensorFlow APIs.
//
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/graph_debug_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "GraphDebugInfoProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

message GraphDebugInfo {
// This represents a file/line location in the source code.
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/meta_graph.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "MetaGraphProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// NOTE: This protocol buffer is evolving, and will go through revisions in the
// coming months.
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/named_tensor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "NamedTensorProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// A pair of tensor name and tensor values.
message NamedTensorProto {
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/queue_runner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "QueueRunnerProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

// Protocol buffer representing a QueueRunner.
message QueueRunnerDef {
Expand Down
2 changes: 1 addition & 1 deletion proto/tensorflow/core/protobuf/remote_tensor_handle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "RemoteTensorHandleProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

message ResourceDtypeAndShape {
DataType dtype = 1;
Expand Down
Loading

0 comments on commit 32e1e66

Please sign in to comment.