From d9fcc7152fe591daf4ca5e711722fd2847ba0291 Mon Sep 17 00:00:00 2001 From: "Daniel J. Beutel" Date: Mon, 25 Apr 2022 17:56:49 -0600 Subject: [PATCH] Remove timeout attribute from ServerMessage --- src/proto/flwr/proto/transport.proto | 4 -- src/py/flwr/proto/transport_pb2.py | 95 +++++++++++++--------------- src/py/flwr/proto/transport_pb2.pyi | 9 +-- 3 files changed, 45 insertions(+), 63 deletions(-) diff --git a/src/proto/flwr/proto/transport.proto b/src/proto/flwr/proto/transport.proto index da287c9bb7fb..07889e1130fd 100644 --- a/src/proto/flwr/proto/transport.proto +++ b/src/proto/flwr/proto/transport.proto @@ -60,10 +60,6 @@ message ServerMessage { EvaluateIns evaluate_ins = 4; PropertiesIns properties_ins = 5; } - - // When the field is not explicitly set it will default to zero in gRPC - // therefore all implementations using it should treat 0 as no timeout - float timeout = 20; } message ClientMessage { diff --git a/src/py/flwr/proto/transport_pb2.py b/src/py/flwr/proto/transport_pb2.py index 98544afc716d..0ccbc5d66609 100644 --- a/src/py/flwr/proto/transport_pb2.py +++ b/src/py/flwr/proto/transport_pb2.py @@ -20,7 +20,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1a\x66lwr/proto/transport.proto\x12\x10\x66lower.transport\"?\n\x06Status\x12$\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x16.flower.transport.Code\x12\x0f\n\x07message\x18\x02 \x01(\t\"2\n\nParameters\x12\x0f\n\x07tensors\x18\x01 \x03(\x0c\x12\x13\n\x0btensor_type\x18\x02 \x01(\t\"\xec\x07\n\rServerMessage\x12>\n\treconnect\x18\x01 \x01(\x0b\x32).flower.transport.ServerMessage.ReconnectH\x00\x12G\n\x0eget_parameters\x18\x02 \x01(\x0b\x32-.flower.transport.ServerMessage.GetParametersH\x00\x12\x39\n\x07\x66it_ins\x18\x03 \x01(\x0b\x32&.flower.transport.ServerMessage.FitInsH\x00\x12\x43\n\x0c\x65valuate_ins\x18\x04 \x01(\x0b\x32+.flower.transport.ServerMessage.EvaluateInsH\x00\x12G\n\x0eproperties_ins\x18\x05 \x01(\x0b\x32-.flower.transport.ServerMessage.PropertiesInsH\x00\x12\x0f\n\x07timeout\x18\x14 \x01(\x02\x1a\x1c\n\tReconnect\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x1a\x0f\n\rGetParameters\x1a\xc7\x01\n\x06\x46itIns\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12\x42\n\x06\x63onfig\x18\x02 \x03(\x0b\x32\x32.flower.transport.ServerMessage.FitIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xd1\x01\n\x0b\x45valuateIns\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12G\n\x06\x63onfig\x18\x02 \x03(\x0b\x32\x37.flower.transport.ServerMessage.EvaluateIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xa3\x01\n\rPropertiesIns\x12I\n\x06\x63onfig\x18\x01 \x03(\x0b\x32\x39.flower.transport.ServerMessage.PropertiesIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"\xed\x08\n\rClientMessage\x12@\n\ndisconnect\x18\x01 \x01(\x0b\x32*.flower.transport.ClientMessage.DisconnectH\x00\x12G\n\x0eparameters_res\x18\x02 \x01(\x0b\x32-.flower.transport.ClientMessage.ParametersResH\x00\x12\x39\n\x07\x66it_res\x18\x03 \x01(\x0b\x32&.flower.transport.ClientMessage.FitResH\x00\x12\x43\n\x0c\x65valuate_res\x18\x04 \x01(\x0b\x32+.flower.transport.ClientMessage.EvaluateResH\x00\x12G\n\x0eproperties_res\x18\x05 \x01(\x0b\x32-.flower.transport.ClientMessage.PropertiesResH\x00\x1a\x36\n\nDisconnect\x12(\n\x06reason\x18\x01 \x01(\x0e\x32\x18.flower.transport.Reason\x1a\x41\n\rParametersRes\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x1a\xe0\x01\n\x06\x46itRes\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12\x14\n\x0cnum_examples\x18\x02 \x01(\x03\x12\x44\n\x07metrics\x18\x05 \x03(\x0b\x32\x33.flower.transport.ClientMessage.FitRes.MetricsEntry\x1aH\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xc6\x01\n\x0b\x45valuateRes\x12\x14\n\x0cnum_examples\x18\x01 \x01(\x03\x12\x0c\n\x04loss\x18\x02 \x01(\x02\x12I\n\x07metrics\x18\x04 \x03(\x0b\x32\x38.flower.transport.ClientMessage.EvaluateRes.MetricsEntry\x1aH\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xd9\x01\n\rPropertiesRes\x12(\n\x06status\x18\x01 \x01(\x0b\x32\x18.flower.transport.Status\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32=.flower.transport.ClientMessage.PropertiesRes.PropertiesEntry\x1aK\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"i\n\x06Scalar\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x08 \x01(\x12H\x00\x12\x0e\n\x04\x62ool\x18\r \x01(\x08H\x00\x12\x10\n\x06string\x18\x0e \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x0f \x01(\x0cH\x00\x42\x08\n\x06scalar*2\n\x04\x43ode\x12\x06\n\x02OK\x10\x00\x12\"\n\x1eGET_PARAMETERS_NOT_IMPLEMENTED\x10\x01*[\n\x06Reason\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tRECONNECT\x10\x01\x12\x16\n\x12POWER_DISCONNECTED\x10\x02\x12\x14\n\x10WIFI_UNAVAILABLE\x10\x03\x12\x07\n\x03\x41\x43K\x10\x04\x32_\n\rFlowerService\x12N\n\x04Join\x12\x1f.flower.transport.ClientMessage\x1a\x1f.flower.transport.ServerMessage\"\x00(\x01\x30\x01\x62\x06proto3' + serialized_pb=b'\n\x1a\x66lwr/proto/transport.proto\x12\x10\x66lower.transport\"?\n\x06Status\x12$\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x16.flower.transport.Code\x12\x0f\n\x07message\x18\x02 \x01(\t\"2\n\nParameters\x12\x0f\n\x07tensors\x18\x01 \x03(\x0c\x12\x13\n\x0btensor_type\x18\x02 \x01(\t\"\xdb\x07\n\rServerMessage\x12>\n\treconnect\x18\x01 \x01(\x0b\x32).flower.transport.ServerMessage.ReconnectH\x00\x12G\n\x0eget_parameters\x18\x02 \x01(\x0b\x32-.flower.transport.ServerMessage.GetParametersH\x00\x12\x39\n\x07\x66it_ins\x18\x03 \x01(\x0b\x32&.flower.transport.ServerMessage.FitInsH\x00\x12\x43\n\x0c\x65valuate_ins\x18\x04 \x01(\x0b\x32+.flower.transport.ServerMessage.EvaluateInsH\x00\x12G\n\x0eproperties_ins\x18\x05 \x01(\x0b\x32-.flower.transport.ServerMessage.PropertiesInsH\x00\x1a\x1c\n\tReconnect\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x1a\x0f\n\rGetParameters\x1a\xc7\x01\n\x06\x46itIns\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12\x42\n\x06\x63onfig\x18\x02 \x03(\x0b\x32\x32.flower.transport.ServerMessage.FitIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xd1\x01\n\x0b\x45valuateIns\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12G\n\x06\x63onfig\x18\x02 \x03(\x0b\x32\x37.flower.transport.ServerMessage.EvaluateIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xa3\x01\n\rPropertiesIns\x12I\n\x06\x63onfig\x18\x01 \x03(\x0b\x32\x39.flower.transport.ServerMessage.PropertiesIns.ConfigEntry\x1aG\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"\xed\x08\n\rClientMessage\x12@\n\ndisconnect\x18\x01 \x01(\x0b\x32*.flower.transport.ClientMessage.DisconnectH\x00\x12G\n\x0eparameters_res\x18\x02 \x01(\x0b\x32-.flower.transport.ClientMessage.ParametersResH\x00\x12\x39\n\x07\x66it_res\x18\x03 \x01(\x0b\x32&.flower.transport.ClientMessage.FitResH\x00\x12\x43\n\x0c\x65valuate_res\x18\x04 \x01(\x0b\x32+.flower.transport.ClientMessage.EvaluateResH\x00\x12G\n\x0eproperties_res\x18\x05 \x01(\x0b\x32-.flower.transport.ClientMessage.PropertiesResH\x00\x1a\x36\n\nDisconnect\x12(\n\x06reason\x18\x01 \x01(\x0e\x32\x18.flower.transport.Reason\x1a\x41\n\rParametersRes\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x1a\xe0\x01\n\x06\x46itRes\x12\x30\n\nparameters\x18\x01 \x01(\x0b\x32\x1c.flower.transport.Parameters\x12\x14\n\x0cnum_examples\x18\x02 \x01(\x03\x12\x44\n\x07metrics\x18\x05 \x03(\x0b\x32\x33.flower.transport.ClientMessage.FitRes.MetricsEntry\x1aH\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xc6\x01\n\x0b\x45valuateRes\x12\x14\n\x0cnum_examples\x18\x01 \x01(\x03\x12\x0c\n\x04loss\x18\x02 \x01(\x02\x12I\n\x07metrics\x18\x04 \x03(\x0b\x32\x38.flower.transport.ClientMessage.EvaluateRes.MetricsEntry\x1aH\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x1a\xd9\x01\n\rPropertiesRes\x12(\n\x06status\x18\x01 \x01(\x0b\x32\x18.flower.transport.Status\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32=.flower.transport.ClientMessage.PropertiesRes.PropertiesEntry\x1aK\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.flower.transport.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"i\n\x06Scalar\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x08 \x01(\x12H\x00\x12\x0e\n\x04\x62ool\x18\r \x01(\x08H\x00\x12\x10\n\x06string\x18\x0e \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x0f \x01(\x0cH\x00\x42\x08\n\x06scalar*2\n\x04\x43ode\x12\x06\n\x02OK\x10\x00\x12\"\n\x1eGET_PARAMETERS_NOT_IMPLEMENTED\x10\x01*[\n\x06Reason\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tRECONNECT\x10\x01\x12\x16\n\x12POWER_DISCONNECTED\x10\x02\x12\x14\n\x10WIFI_UNAVAILABLE\x10\x03\x12\x07\n\x03\x41\x43K\x10\x04\x32_\n\rFlowerService\x12N\n\x04Join\x12\x1f.flower.transport.ClientMessage\x1a\x1f.flower.transport.ServerMessage\"\x00(\x01\x30\x01\x62\x06proto3' ) _CODE = _descriptor.EnumDescriptor( @@ -43,8 +43,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2415, - serialized_end=2465, + serialized_start=2398, + serialized_end=2448, ) _sym_db.RegisterEnumDescriptor(_CODE) @@ -84,8 +84,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2467, - serialized_end=2558, + serialized_start=2450, + serialized_end=2541, ) _sym_db.RegisterEnumDescriptor(_REASON) @@ -205,8 +205,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=538, - serialized_end=566, + serialized_start=521, + serialized_end=549, ) _SERVERMESSAGE_GETPARAMETERS = _descriptor.Descriptor( @@ -229,8 +229,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=568, - serialized_end=583, + serialized_start=551, + serialized_end=566, ) _SERVERMESSAGE_FITINS_CONFIGENTRY = _descriptor.Descriptor( @@ -267,8 +267,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=714, - serialized_end=785, + serialized_start=697, + serialized_end=768, ) _SERVERMESSAGE_FITINS = _descriptor.Descriptor( @@ -305,8 +305,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=586, - serialized_end=785, + serialized_start=569, + serialized_end=768, ) _SERVERMESSAGE_EVALUATEINS_CONFIGENTRY = _descriptor.Descriptor( @@ -343,8 +343,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=714, - serialized_end=785, + serialized_start=697, + serialized_end=768, ) _SERVERMESSAGE_EVALUATEINS = _descriptor.Descriptor( @@ -381,8 +381,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=788, - serialized_end=997, + serialized_start=771, + serialized_end=980, ) _SERVERMESSAGE_PROPERTIESINS_CONFIGENTRY = _descriptor.Descriptor( @@ -419,8 +419,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=714, - serialized_end=785, + serialized_start=697, + serialized_end=768, ) _SERVERMESSAGE_PROPERTIESINS = _descriptor.Descriptor( @@ -450,8 +450,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1000, - serialized_end=1163, + serialized_start=983, + serialized_end=1146, ) _SERVERMESSAGE = _descriptor.Descriptor( @@ -497,13 +497,6 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timeout', full_name='flower.transport.ServerMessage.timeout', index=5, - number=20, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -522,7 +515,7 @@ fields=[]), ], serialized_start=166, - serialized_end=1170, + serialized_end=1153, ) @@ -553,8 +546,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1530, - serialized_end=1584, + serialized_start=1513, + serialized_end=1567, ) _CLIENTMESSAGE_PARAMETERSRES = _descriptor.Descriptor( @@ -584,8 +577,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1586, - serialized_end=1651, + serialized_start=1569, + serialized_end=1634, ) _CLIENTMESSAGE_FITRES_METRICSENTRY = _descriptor.Descriptor( @@ -622,8 +615,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1806, - serialized_end=1878, + serialized_start=1789, + serialized_end=1861, ) _CLIENTMESSAGE_FITRES = _descriptor.Descriptor( @@ -667,8 +660,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1654, - serialized_end=1878, + serialized_start=1637, + serialized_end=1861, ) _CLIENTMESSAGE_EVALUATERES_METRICSENTRY = _descriptor.Descriptor( @@ -705,8 +698,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1806, - serialized_end=1878, + serialized_start=1789, + serialized_end=1861, ) _CLIENTMESSAGE_EVALUATERES = _descriptor.Descriptor( @@ -750,8 +743,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1881, - serialized_end=2079, + serialized_start=1864, + serialized_end=2062, ) _CLIENTMESSAGE_PROPERTIESRES_PROPERTIESENTRY = _descriptor.Descriptor( @@ -788,8 +781,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2224, - serialized_end=2299, + serialized_start=2207, + serialized_end=2282, ) _CLIENTMESSAGE_PROPERTIESRES = _descriptor.Descriptor( @@ -826,8 +819,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2082, - serialized_end=2299, + serialized_start=2065, + serialized_end=2282, ) _CLIENTMESSAGE = _descriptor.Descriptor( @@ -890,8 +883,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=1173, - serialized_end=2306, + serialized_start=1156, + serialized_end=2289, ) @@ -955,8 +948,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=2308, - serialized_end=2413, + serialized_start=2291, + serialized_end=2396, ) _STATUS.fields_by_name['code'].enum_type = _CODE @@ -1236,8 +1229,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=2560, - serialized_end=2655, + serialized_start=2543, + serialized_end=2638, methods=[ _descriptor.MethodDescriptor( name='Join', diff --git a/src/py/flwr/proto/transport_pb2.pyi b/src/py/flwr/proto/transport_pb2.pyi index ae1e488b1bf9..0d7f7a22ecbe 100644 --- a/src/py/flwr/proto/transport_pb2.pyi +++ b/src/py/flwr/proto/transport_pb2.pyi @@ -187,7 +187,6 @@ class ServerMessage(google.protobuf.message.Message): FIT_INS_FIELD_NUMBER: builtins.int EVALUATE_INS_FIELD_NUMBER: builtins.int PROPERTIES_INS_FIELD_NUMBER: builtins.int - TIMEOUT_FIELD_NUMBER: builtins.int @property def reconnect(self) -> global___ServerMessage.Reconnect: ... @property @@ -198,11 +197,6 @@ class ServerMessage(google.protobuf.message.Message): def evaluate_ins(self) -> global___ServerMessage.EvaluateIns: ... @property def properties_ins(self) -> global___ServerMessage.PropertiesIns: ... - timeout: builtins.float - """When the field is not explicitly set it will default to zero in gRPC - therefore all implementations using it should treat 0 as no timeout - """ - def __init__(self, *, reconnect: typing.Optional[global___ServerMessage.Reconnect] = ..., @@ -210,10 +204,9 @@ class ServerMessage(google.protobuf.message.Message): fit_ins: typing.Optional[global___ServerMessage.FitIns] = ..., evaluate_ins: typing.Optional[global___ServerMessage.EvaluateIns] = ..., properties_ins: typing.Optional[global___ServerMessage.PropertiesIns] = ..., - timeout: builtins.float = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["evaluate_ins",b"evaluate_ins","fit_ins",b"fit_ins","get_parameters",b"get_parameters","msg",b"msg","properties_ins",b"properties_ins","reconnect",b"reconnect"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["evaluate_ins",b"evaluate_ins","fit_ins",b"fit_ins","get_parameters",b"get_parameters","msg",b"msg","properties_ins",b"properties_ins","reconnect",b"reconnect","timeout",b"timeout"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["evaluate_ins",b"evaluate_ins","fit_ins",b"fit_ins","get_parameters",b"get_parameters","msg",b"msg","properties_ins",b"properties_ins","reconnect",b"reconnect"]) -> None: ... def WhichOneof(self, oneof_group: typing_extensions.Literal["msg",b"msg"]) -> typing.Optional[typing_extensions.Literal["reconnect","get_parameters","fit_ins","evaluate_ins","properties_ins"]]: ... global___ServerMessage = ServerMessage