Skip to content

Commit 18e278e

Browse files
authored
Merge pull request tensorflow#299 from kirilg/branch_144997521
Upstream internal changes
2 parents 46915c6 + c37e686 commit 18e278e

37 files changed

+1589
-155
lines changed

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ load('//tensorflow_serving:workspace.bzl', 'tf_serving_workspace')
1010
tf_serving_workspace()
1111

1212
# Specify the minimum required bazel version.
13-
load("@org_tensorflow//tensorflow:tensorflow.bzl", "check_version")
13+
load("@org_tensorflow//tensorflow:workspace.bzl", "check_version")
1414
check_version("0.4.2")

tensorflow

Submodule tensorflow updated 2583 files

tensorflow_serving/apis/prediction_service_pb2.py

Lines changed: 104 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# source: tensorflow_serving/apis/prediction_service.proto
1717

1818
import sys
19-
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
19+
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
2020
from google.protobuf import descriptor as _descriptor
2121
from google.protobuf import message as _message
2222
from google.protobuf import reflection as _reflection
@@ -26,118 +26,141 @@
2626

2727
_sym_db = _symbol_database.Default()
2828

29-
from tensorflow_serving.apis import predict_pb2 as third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2
29+
30+
from tensorflow_serving.apis import predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2
31+
3032

3133
DESCRIPTOR = _descriptor.FileDescriptor(
32-
name='tensorflow_serving/apis/prediction_service.proto',
33-
package='tensorflow.serving',
34-
syntax='proto3',
35-
serialized_pb=_b(
36-
'\n<tensorflow_serving/apis/prediction_service.proto\x12\x12tensorflow.serving\x1a\x31tensorflow_serving/apis/predict.proto2g\n\x11PredictionService\x12R\n\x07Predict\x12\".tensorflow.serving.PredictRequest\x1a#.tensorflow.serving.PredictResponseB\x03\xf8\x01\x01\x62\x06proto3'),
37-
dependencies=[
38-
third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2.
39-
DESCRIPTOR,
40-
])
34+
name='tensorflow_serving/apis/prediction_service.proto',
35+
package='tensorflow.serving',
36+
syntax='proto3',
37+
serialized_pb=_b('\n0tensorflow_serving/apis/prediction_service.proto\x12\x12tensorflow.serving\x1a%tensorflow_serving/apis/predict.proto2g\n\x11PredictionService\x12R\n\x07Predict\x12\".tensorflow.serving.PredictRequest\x1a#.tensorflow.serving.PredictResponseB\x03\xf8\x01\x01\x62\x06proto3')
38+
,
39+
dependencies=[tensorflow__serving_dot_apis_dot_predict__pb2.DESCRIPTOR,])
4140
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
4241

42+
43+
44+
45+
4346
DESCRIPTOR.has_options = True
44-
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(),
45-
_b('\370\001\001'))
46-
from grpc.beta import implementations as beta_implementations
47-
from grpc.beta import interfaces as beta_interfaces
47+
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\370\001\001'))
48+
49+
import grpc
4850
from grpc.framework.common import cardinality
4951
from grpc.framework.interfaces.face import utilities as face_utilities
52+
from grpc.beta import implementations as beta_implementations
53+
from grpc.beta import interfaces as beta_interfaces
5054

5155

52-
class BetaPredictionServiceServicer(object):
53-
"""PredictionService provides basic machine learning methods.
56+
class PredictionServiceStub(object):
57+
"""PredictionService provides access to machine-learned models loaded by
58+
model_servers.
59+
"""
60+
61+
def __init__(self, channel):
62+
"""Constructor.
63+
64+
Args:
65+
channel: A grpc.Channel.
66+
"""
67+
self.Predict = channel.unary_unary(
68+
'/tensorflow.serving.PredictionService/Predict',
69+
request_serializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.SerializeToString,
70+
response_deserializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.FromString,
71+
)
5472

55-
TODO(b/28599843): Decide whether to keep the separate services in addition to
56-
this combined service.
73+
74+
class PredictionServiceServicer(object):
75+
"""PredictionService provides access to machine-learned models loaded by
76+
model_servers.
5777
"""
5878

5979
def Predict(self, request, context):
60-
"""Predict.
80+
"""Predict -- provides access to loaded TensorFlow model.
81+
"""
82+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
83+
context.set_details('Method not implemented!')
84+
raise NotImplementedError('Method not implemented!')
85+
86+
87+
def add_PredictionServiceServicer_to_server(servicer, server):
88+
rpc_method_handlers = {
89+
'Predict': grpc.unary_unary_rpc_method_handler(
90+
servicer.Predict,
91+
request_deserializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.FromString,
92+
response_serializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.SerializeToString,
93+
),
94+
}
95+
generic_handler = grpc.method_handlers_generic_handler(
96+
'tensorflow.serving.PredictionService', rpc_method_handlers)
97+
server.add_generic_rpc_handlers((generic_handler,))
98+
99+
100+
class BetaPredictionServiceServicer(object):
101+
"""The Beta API is deprecated for 0.15.0 and later.
102+
103+
It is recommended to use the GA API (classes and functions in this
104+
file not marked beta) for all further purposes. This class was generated
105+
only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
106+
"""PredictionService provides access to machine-learned models loaded by
107+
model_servers.
108+
"""
109+
def Predict(self, request, context):
110+
"""Predict -- provides access to loaded TensorFlow model.
61111
"""
62112
context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
63113

64114

65115
class BetaPredictionServiceStub(object):
66-
"""PredictionService provides basic machine learning methods.
116+
"""The Beta API is deprecated for 0.15.0 and later.
67117
68-
TODO(b/28599843): Decide whether to keep the separate services in addition to
69-
this combined service.
118+
It is recommended to use the GA API (classes and functions in this
119+
file not marked beta) for all further purposes. This class was generated
120+
only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
121+
"""PredictionService provides access to machine-learned models loaded by
122+
model_servers.
70123
"""
71-
72-
def Predict(self,
73-
request,
74-
timeout,
75-
metadata=None,
76-
with_call=False,
77-
protocol_options=None):
78-
"""Predict.
124+
def Predict(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
125+
"""Predict -- provides access to loaded TensorFlow model.
79126
"""
80127
raise NotImplementedError()
81-
82128
Predict.future = None
83129

84130

85-
def beta_create_PredictionService_server(servicer,
86-
pool=None,
87-
pool_size=None,
88-
default_timeout=None,
89-
maximum_timeout=None):
131+
def beta_create_PredictionService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
132+
"""The Beta API is deprecated for 0.15.0 and later.
133+
134+
It is recommended to use the GA API (classes and functions in this
135+
file not marked beta) for all further purposes. This function was
136+
generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
90137
request_deserializers = {
91-
('tensorflow.serving.PredictionService', 'Predict'):
92-
third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2.
93-
PredictRequest.FromString,
138+
('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.FromString,
94139
}
95140
response_serializers = {
96-
('tensorflow.serving.PredictionService', 'Predict'):
97-
third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2.
98-
PredictResponse.SerializeToString,
141+
('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.SerializeToString,
99142
}
100143
method_implementations = {
101-
('tensorflow.serving.PredictionService', 'Predict'):
102-
face_utilities.unary_unary_inline(servicer.Predict),
144+
('tensorflow.serving.PredictionService', 'Predict'): face_utilities.unary_unary_inline(servicer.Predict),
103145
}
104-
server_options = beta_implementations.server_options(
105-
request_deserializers=request_deserializers,
106-
response_serializers=response_serializers,
107-
thread_pool=pool,
108-
thread_pool_size=pool_size,
109-
default_timeout=default_timeout,
110-
maximum_timeout=maximum_timeout)
111-
return beta_implementations.server(
112-
method_implementations, options=server_options)
113-
114-
115-
def beta_create_PredictionService_stub(channel,
116-
host=None,
117-
metadata_transformer=None,
118-
pool=None,
119-
pool_size=None):
146+
server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
147+
return beta_implementations.server(method_implementations, options=server_options)
148+
149+
150+
def beta_create_PredictionService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
151+
"""The Beta API is deprecated for 0.15.0 and later.
152+
153+
It is recommended to use the GA API (classes and functions in this
154+
file not marked beta) for all further purposes. This function was
155+
generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
120156
request_serializers = {
121-
('tensorflow.serving.PredictionService', 'Predict'):
122-
third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2.
123-
PredictRequest.SerializeToString,
157+
('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.SerializeToString,
124158
}
125159
response_deserializers = {
126-
('tensorflow.serving.PredictionService', 'Predict'):
127-
third__party_dot_tensorflow__serving_dot_apis_dot_predict__pb2.
128-
PredictResponse.FromString,
160+
('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.FromString,
161+
}
162+
cardinalities = {
163+
'Predict': cardinality.Cardinality.UNARY_UNARY,
129164
}
130-
cardinalities = {'Predict': cardinality.Cardinality.UNARY_UNARY,}
131-
stub_options = beta_implementations.stub_options(
132-
host=host,
133-
metadata_transformer=metadata_transformer,
134-
request_serializers=request_serializers,
135-
response_deserializers=response_deserializers,
136-
thread_pool=pool,
137-
thread_pool_size=pool_size)
138-
return beta_implementations.dynamic_stub(
139-
channel,
140-
'tensorflow.serving.PredictionService',
141-
cardinalities,
142-
options=stub_options)
143-
# @@protoc_insertion_point(module_scope)
165+
stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
166+
return beta_implementations.dynamic_stub(channel, 'tensorflow.serving.PredictionService', cardinalities, options=stub_options)

tensorflow_serving/batching/batching_session.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ Status BatchingSession::Run(
217217
if (batch_scheduler_it == batch_schedulers_.end()) {
218218
// We have a Run() call that doesn't match one of our batching signatures.
219219
// Run it in-line.
220+
LOG(WARNING) << "Request doesn't match any declared signature. Bypassing "
221+
"batcher. Request signature is: "
222+
<< TensorSignatureDebugString(signature);
220223
return wrapped_->Run(inputs, output_tensor_names, target_node_names,
221224
outputs);
222225
}

tensorflow_serving/config/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ serving_proto_library(
2727
srcs = ["model_server_config.proto"],
2828
cc_api_version = 2,
2929
deps = [
30-
"@protobuf//:cc_wkt_protos",
30+
":logging_config_proto",
3131
"//tensorflow_serving/sources/storage_path:file_system_storage_path_source_proto",
32+
"@protobuf//:cc_wkt_protos",
3233
],
3334
)
3435

tensorflow_serving/config/model_server_config.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package tensorflow.serving;
44
option cc_enable_arenas = true;
55

66
import "google/protobuf/any.proto";
7+
import "tensorflow_serving/config/logging_config.proto";
78
import "tensorflow_serving/sources/storage_path/file_system_storage_path_source.proto";
89

910
// The type of model.
@@ -35,6 +36,9 @@ message ModelConfig {
3536
// be served at the same time.
3637
// The default option is to serve only the latest version of the model.
3738
FileSystemStoragePathSourceConfig.VersionPolicy version_policy = 5;
39+
40+
// Configures logging requests and responses, to the model.
41+
LoggingConfig logging_config = 6;
3842
}
3943

4044
// Static list of models to be loaded for serving.

0 commit comments

Comments
 (0)