flwr-nightly 1.5.0.dev20230608__py3-none-any.whl → 1.5.0.dev20230615__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. flwr/client/app.py +0 -3
  2. flwr/client/client.py +0 -4
  3. flwr/client/dpfedavg_numpy_client.py +97 -0
  4. flwr/client/grpc_rere_client/connection.py +0 -2
  5. flwr/client/message_handler/task_handler.py +0 -1
  6. flwr/client/numpy_client.py +1 -1
  7. flwr/client/rest_client/connection.py +0 -3
  8. flwr/common/address.py +1 -1
  9. flwr/common/dp.py +1 -2
  10. flwr/common/grpc.py +0 -1
  11. flwr/common/logger.py +0 -1
  12. flwr/common/serde.py +0 -1
  13. flwr/driver/driver.py +0 -3
  14. flwr/driver/driver_client_manager.py +9 -0
  15. flwr/driver/driver_client_proxy.py +1 -1
  16. flwr/proto/task_pb2.py +94 -6
  17. flwr/proto/task_pb2.pyi +137 -2
  18. flwr/server/app.py +4 -11
  19. flwr/server/client_manager.py +7 -0
  20. flwr/server/client_proxy.py +1 -1
  21. flwr/server/criterion.py +1 -2
  22. flwr/server/fleet/grpc_bidi/flower_service_servicer.py +3 -1
  23. flwr/server/fleet/grpc_bidi/grpc_bridge.py +1 -2
  24. flwr/server/fleet/grpc_bidi/grpc_client_proxy.py +1 -1
  25. flwr/server/fleet/grpc_bidi/grpc_server.py +1 -3
  26. flwr/server/fleet/grpc_bidi/ins_scheduler.py +0 -1
  27. flwr/server/fleet/message_handler/message_handler.py +0 -2
  28. flwr/server/history.py +15 -0
  29. flwr/server/server.py +0 -5
  30. flwr/server/state/in_memory_state.py +8 -5
  31. flwr/server/state/sqlite_state.py +4 -5
  32. flwr/server/state/state.py +2 -2
  33. flwr/server/state/state_factory.py +0 -1
  34. flwr/server/strategy/dpfedavg_adaptive.py +1 -1
  35. flwr/server/strategy/dpfedavg_fixed.py +46 -2
  36. flwr/server/strategy/fedadagrad.py +4 -4
  37. flwr/server/strategy/fedadam.py +3 -4
  38. flwr/server/strategy/fedavg.py +1 -2
  39. flwr/server/strategy/fedavg_android.py +1 -2
  40. flwr/server/strategy/fedopt.py +1 -2
  41. flwr/server/strategy/fedxgb_nn_avg.py +2 -2
  42. flwr/server/strategy/fedyogi.py +3 -4
  43. flwr/server/strategy/qfedavg.py +1 -2
  44. flwr/server/utils/tensorboard.py +2 -4
  45. flwr/server/utils/validator.py +0 -1
  46. flwr/simulation/app.py +4 -5
  47. flwr/simulation/ray_transport/ray_client_proxy.py +13 -13
  48. {flwr_nightly-1.5.0.dev20230608.dist-info → flwr_nightly-1.5.0.dev20230615.dist-info}/METADATA +1 -1
  49. {flwr_nightly-1.5.0.dev20230608.dist-info → flwr_nightly-1.5.0.dev20230615.dist-info}/RECORD +52 -52
  50. {flwr_nightly-1.5.0.dev20230608.dist-info → flwr_nightly-1.5.0.dev20230615.dist-info}/LICENSE +0 -0
  51. {flwr_nightly-1.5.0.dev20230608.dist-info → flwr_nightly-1.5.0.dev20230615.dist-info}/WHEEL +0 -0
  52. {flwr_nightly-1.5.0.dev20230608.dist-info → flwr_nightly-1.5.0.dev20230615.dist-info}/entry_points.txt +0 -0
flwr/client/app.py CHANGED
@@ -150,7 +150,6 @@ def start_client(
150
150
  >>> root_certificates=Path("/crts/root.pem").read_bytes(),
151
151
  >>> )
152
152
  """
153
-
154
153
  event(EventType.START_CLIENT_ENTER)
155
154
 
156
155
  # Parse IP address
@@ -278,7 +277,6 @@ def start_numpy_client(
278
277
  >>> root_certificates=Path("/crts/root.pem").read_bytes(),
279
278
  >>> )
280
279
  """
281
-
282
280
  # Start
283
281
  start_client(
284
282
  server_address=server_address,
@@ -321,7 +319,6 @@ def _get_parameters(self: Client, ins: GetParametersIns) -> GetParametersRes:
321
319
 
322
320
  def _fit(self: Client, ins: FitIns) -> FitRes:
323
321
  """Refine the provided parameters using the locally held dataset."""
324
-
325
322
  # Deconstruct FitIns
326
323
  parameters: NDArrays = parameters_to_ndarrays(ins.parameters)
327
324
 
flwr/client/client.py CHANGED
@@ -161,7 +161,6 @@ def maybe_call_get_properties(
161
161
  client: Client, get_properties_ins: GetPropertiesIns
162
162
  ) -> GetPropertiesRes:
163
163
  """Call `get_properties` if the client overrides it."""
164
-
165
164
  # Check if client overrides `get_properties`
166
165
  if not has_get_properties(client=client):
167
166
  # If client does not override `get_properties`, don't call it
@@ -182,7 +181,6 @@ def maybe_call_get_parameters(
182
181
  client: Client, get_parameters_ins: GetParametersIns
183
182
  ) -> GetParametersRes:
184
183
  """Call `get_parameters` if the client overrides it."""
185
-
186
184
  # Check if client overrides `get_parameters`
187
185
  if not has_get_parameters(client=client):
188
186
  # If client does not override `get_parameters`, don't call it
@@ -201,7 +199,6 @@ def maybe_call_get_parameters(
201
199
 
202
200
  def maybe_call_fit(client: Client, fit_ins: FitIns) -> FitRes:
203
201
  """Call `fit` if the client overrides it."""
204
-
205
202
  # Check if client overrides `fit`
206
203
  if not has_fit(client=client):
207
204
  # If client does not override `fit`, don't call it
@@ -222,7 +219,6 @@ def maybe_call_fit(client: Client, fit_ins: FitIns) -> FitRes:
222
219
 
223
220
  def maybe_call_evaluate(client: Client, evaluate_ins: EvaluateIns) -> EvaluateRes:
224
221
  """Call `evaluate` if the client overrides it."""
225
-
226
222
  # Check if client overrides `evaluate`
227
223
  if not has_evaluate(client=client):
228
224
  # If client does not override `evaluate`, don't call it
@@ -33,14 +33,82 @@ class DPFedAvgNumPyClient(NumPyClient):
33
33
  self.client = client
34
34
 
35
35
  def get_properties(self, config: Config) -> Dict[str, Scalar]:
36
+ """Get client properties using the given Numpy client.
37
+
38
+ Parameters
39
+ ----------
40
+ config : Config
41
+ Configuration parameters requested by the server.
42
+ This can be used to tell the client which properties
43
+ are needed along with some Scalar attributes.
44
+
45
+ Returns
46
+ -------
47
+ properties : Dict[str, Scalar]
48
+ A dictionary mapping arbitrary string keys to values of type
49
+ bool, bytes, float, int, or str. It can be used to communicate
50
+ arbitrary property values back to the server.
51
+ """
36
52
  return self.client.get_properties(config)
37
53
 
38
54
  def get_parameters(self, config: Dict[str, Scalar]) -> NDArrays:
55
+ """Return the current local model parameters.
56
+
57
+ Parameters
58
+ ----------
59
+ config : Config
60
+ Configuration parameters requested by the server.
61
+ This can be used to tell the client which parameters
62
+ are needed along with some Scalar attributes.
63
+
64
+ Returns
65
+ -------
66
+ parameters : NDArrays
67
+ The local model parameters as a list of NumPy ndarrays.
68
+ """
39
69
  return self.client.get_parameters(config)
40
70
 
41
71
  def fit(
42
72
  self, parameters: NDArrays, config: Dict[str, Scalar]
43
73
  ) -> Tuple[NDArrays, int, Dict[str, Scalar]]:
74
+ """Train the provided parameters using the locally held dataset.
75
+
76
+ This method first updates the local model using the original parameters
77
+ provided. It then calculates the update by subtracting the original
78
+ parameters from the updated model. The update is then clipped by an L2
79
+ norm and Gaussian noise is added if specified by the configuration.
80
+
81
+ The update is then applied to the original parameters to obtain the
82
+ updated parameters which are returned along with the number of examples
83
+ used and metrics computed during the fitting process.
84
+
85
+ Parameters
86
+ ----------
87
+ parameters : NDArrays
88
+ The current (global) model parameters.
89
+ config : Dict[str, Scalar]
90
+ Configuration parameters which allow the
91
+ server to influence training on the client. It can be used to
92
+ communicate arbitrary values from the server to the client, for
93
+ example, to set the number of (local) training epochs.
94
+
95
+ Returns
96
+ -------
97
+ parameters : NDArrays
98
+ The locally updated model parameters.
99
+ num_examples : int
100
+ The number of examples used for training.
101
+ metrics : Dict[str, Scalar]
102
+ A dictionary mapping arbitrary string keys to values of type
103
+ bool, bytes, float, int, or str. It can be used to communicate
104
+ arbitrary values back to the server.
105
+
106
+ Raises
107
+ ------
108
+ Exception
109
+ If any required configuration parameters are not provided or are of
110
+ the wrong type.
111
+ """
44
112
  original_params = copy.deepcopy(parameters)
45
113
  # Getting the updated model from the wrapped client
46
114
  updated_params, num_examples, metrics = self.client.fit(parameters, config)
@@ -80,4 +148,33 @@ class DPFedAvgNumPyClient(NumPyClient):
80
148
  def evaluate(
81
149
  self, parameters: NDArrays, config: Dict[str, Scalar]
82
150
  ) -> Tuple[float, int, Dict[str, Scalar]]:
151
+ """Evaluate the provided parameters using the locally held dataset.
152
+
153
+ Parameters
154
+ ----------
155
+ parameters : NDArrays
156
+ The current (global) model parameters.
157
+ config : Dict[str, Scalar]
158
+ Configuration parameters which allow the server to influence
159
+ evaluation on the client. It can be used to communicate
160
+ arbitrary values from the server to the client, for example,
161
+ to influence the number of examples used for evaluation.
162
+
163
+ Returns
164
+ -------
165
+ loss : float
166
+ The evaluation loss of the model on the local dataset.
167
+ num_examples : int
168
+ The number of examples used for evaluation.
169
+ metrics : Dict[str, Scalar]
170
+ A dictionary mapping arbitrary string keys to values of
171
+ type bool, bytes, float, int, or str. It can be used to
172
+ communicate arbitrary values back to the server.
173
+
174
+ Warning
175
+ -------
176
+ The previous return type format (int, float, float) and the
177
+ extended format (int, float, float, Dict[str, Scalar]) have been
178
+ deprecated and removed since Flower 0.19.
179
+ """
83
180
  return self.client.evaluate(parameters, config)
@@ -98,7 +98,6 @@ def grpc_request_response(
98
98
 
99
99
  def receive() -> Optional[ServerMessage]:
100
100
  """Receive next task from server."""
101
-
102
101
  # Request instructions (task) from server
103
102
  request = PullTaskInsRequest(
104
103
  node=Node(node_id=0, anonymous=True),
@@ -121,7 +120,6 @@ def grpc_request_response(
121
120
 
122
121
  def send(client_message_proto: ClientMessage) -> None:
123
122
  """Send task result back to server."""
124
-
125
123
  if state[KEY_TASK_INS] is None:
126
124
  log(ERROR, "No current TaskIns")
127
125
  return
@@ -26,7 +26,6 @@ def get_server_message(
26
26
  pull_task_ins_response: PullTaskInsResponse,
27
27
  ) -> Optional[Tuple[TaskIns, ServerMessage]]:
28
28
  """Get the first ServerMessage, if available."""
29
-
30
29
  # Extract a single ServerMessage from the response, if possible
31
30
  if len(pull_task_ins_response.task_ins_list) == 0:
32
31
  return None
@@ -25,7 +25,7 @@ class NumPyClient(ABC):
25
25
  """Abstract base class for Flower clients using NumPy."""
26
26
 
27
27
  def get_properties(self, config: Config) -> Dict[str, Scalar]:
28
- """Returns a client's set of properties.
28
+ """Return a client's set of properties.
29
29
 
30
30
  Parameters
31
31
  ----------
@@ -79,7 +79,6 @@ def http_request_response(
79
79
  -------
80
80
  receive, send : Callable, Callable
81
81
  """
82
-
83
82
  log(
84
83
  WARN,
85
84
  """
@@ -113,7 +112,6 @@ def http_request_response(
113
112
 
114
113
  def receive() -> Optional[ServerMessage]:
115
114
  """Receive next task from server."""
116
-
117
115
  # Serialize ProtoBuf to bytes
118
116
  pull_task_ins_req_proto = PullTaskInsRequest(
119
117
  node=Node(node_id=0, anonymous=True),
@@ -170,7 +168,6 @@ def http_request_response(
170
168
 
171
169
  def send(client_message_proto: ClientMessage) -> None:
172
170
  """Send task result back to server."""
173
-
174
171
  if state[KEY_TASK_INS] is None:
175
172
  log(ERROR, "No current TaskIns")
176
173
  return
flwr/common/address.py CHANGED
@@ -21,7 +21,7 @@ IPV6: int = 6
21
21
 
22
22
 
23
23
  def parse_address(address: str) -> Optional[Tuple[str, int, Optional[bool]]]:
24
- """Parses an IP address into host, port, and version.
24
+ """Parse an IP address into host, port, and version.
25
25
 
26
26
  Parameters
27
27
  ----------
flwr/common/dp.py CHANGED
@@ -31,8 +31,7 @@ def _get_update_norm(update: NDArrays) -> float:
31
31
 
32
32
 
33
33
  def add_gaussian_noise(update: NDArrays, std_dev: float) -> NDArrays:
34
- """Adds iid Gaussian noise of the given standard deviation to each floating
35
- point value in the update."""
34
+ """Add iid Gaussian noise to each floating point value in the update."""
36
35
  update_noised = [
37
36
  layer + np.random.normal(0, std_dev, layer.shape) for layer in update
38
37
  ]
flwr/common/grpc.py CHANGED
@@ -31,7 +31,6 @@ def create_channel(
31
31
  max_message_length: int = GRPC_MAX_MESSAGE_LENGTH,
32
32
  ) -> grpc.Channel:
33
33
  """Create a gRPC channel, either secure or insecure."""
34
-
35
34
  # Possible options:
36
35
  # https://github.com/grpc/grpc/blob/v1.43.x/include/grpc/impl/codegen/grpc_types.h
37
36
  channel_options = [
flwr/common/logger.py CHANGED
@@ -70,7 +70,6 @@ def configure(
70
70
  identifier: str, filename: Optional[str] = None, host: Optional[str] = None
71
71
  ) -> None:
72
72
  """Configure logging to file and/or remote log server."""
73
-
74
73
  # Create formatter
75
74
  string_to_input = f"{identifier} | %(levelname)s %(name)s %(asctime)s "
76
75
  string_to_input += "| %(filename)s:%(lineno)d | %(message)s"
flwr/common/serde.py CHANGED
@@ -458,7 +458,6 @@ def metrics_from_proto(proto: Any) -> typing.Metrics:
458
458
 
459
459
  def scalar_to_proto(scalar: typing.Scalar) -> Scalar:
460
460
  """Serialize `Scalar` to ProtoBuf."""
461
-
462
461
  if isinstance(scalar, bool):
463
462
  return Scalar(bool=scalar)
464
463
 
flwr/driver/driver.py CHANGED
@@ -75,7 +75,6 @@ class Driver:
75
75
 
76
76
  def get_nodes(self, req: driver_pb2.GetNodesRequest) -> driver_pb2.GetNodesResponse:
77
77
  """Get client IDs."""
78
-
79
78
  # Check if channel is open
80
79
  if self.stub is None:
81
80
  log(ERROR, ERROR_MESSAGE_DRIVER_NOT_CONNECTED)
@@ -89,7 +88,6 @@ class Driver:
89
88
  self, req: driver_pb2.PushTaskInsRequest
90
89
  ) -> driver_pb2.PushTaskInsResponse:
91
90
  """Schedule tasks."""
92
-
93
91
  # Check if channel is open
94
92
  if self.stub is None:
95
93
  log(ERROR, ERROR_MESSAGE_DRIVER_NOT_CONNECTED)
@@ -103,7 +101,6 @@ class Driver:
103
101
  self, req: driver_pb2.PullTaskResRequest
104
102
  ) -> driver_pb2.PullTaskResResponse:
105
103
  """Get task results."""
106
-
107
104
  # Check if channel is open
108
105
  if self.stub is None:
109
106
  log(ERROR, ERROR_MESSAGE_DRIVER_NOT_CONNECTED)
@@ -85,10 +85,12 @@ class DriverClientManager(ClientManager):
85
85
  raise NotImplementedError("DriverClientManager.unregister is not implemented")
86
86
 
87
87
  def all(self) -> Dict[str, ClientProxy]:
88
+ """Return all available clients."""
88
89
  self._update_nodes()
89
90
  return self.clients
90
91
 
91
92
  def wait_for(self, num_clients: int, timeout: int = 86400) -> bool:
93
+ """Wait until at least `num_clients` are available."""
92
94
  start_time = time.time()
93
95
  while time.time() < start_time + timeout:
94
96
  self._update_nodes()
@@ -103,6 +105,7 @@ class DriverClientManager(ClientManager):
103
105
  min_num_clients: Optional[int] = None,
104
106
  criterion: Optional[Criterion] = None,
105
107
  ) -> List[ClientProxy]:
108
+ """Sample a number of Flower ClientProxy instances."""
106
109
  if min_num_clients is None:
107
110
  min_num_clients = num_clients
108
111
  self.wait_for(min_num_clients)
@@ -128,6 +131,12 @@ class DriverClientManager(ClientManager):
128
131
  return [self.clients[cid] for cid in sampled_cids]
129
132
 
130
133
  def _update_nodes(self) -> None:
134
+ """Update the nodes list in the client manager.
135
+
136
+ This method communicates with the associated driver to get all node ids. Each
137
+ node id is then converted into a `DriverClientProxy` instance and stored in the
138
+ `clients` dictionary with node id as key.
139
+ """
131
140
  get_nodes_res = self.driver.get_nodes(req=driver_pb2.GetNodesRequest())
132
141
  all_node_ids = get_nodes_res.node_ids
133
142
  for node_id in all_node_ids:
@@ -40,7 +40,7 @@ class DriverClientProxy(ClientProxy):
40
40
  def get_properties(
41
41
  self, ins: common.GetPropertiesIns, timeout: Optional[float]
42
42
  ) -> common.GetPropertiesRes:
43
- """Returns client's properties."""
43
+ """Return client's properties."""
44
44
  server_message_proto: transport_pb2.ServerMessage = (
45
45
  serde.server_message_to_proto(
46
46
  server_message=common.ServerMessage(get_properties_ins=ins)
flwr/proto/task_pb2.py CHANGED
@@ -16,13 +16,21 @@ from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
16
16
  from flwr.proto import transport_pb2 as flwr_dot_proto_dot_transport__pb2
17
17
 
18
18
 
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66lwr/proto/task.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x1a\x66lwr/proto/transport.proto\"\x93\x02\n\x04Task\x12\"\n\x08producer\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\"\n\x08\x63onsumer\x18\x02 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x12\n\ncreated_at\x18\x03 \x01(\t\x12\x14\n\x0c\x64\x65livered_at\x18\x04 \x01(\t\x12\x0b\n\x03ttl\x18\x05 \x01(\t\x12\x10\n\x08\x61ncestry\x18\x06 \x03(\t\x12<\n\x15legacy_server_message\x18\x65 \x01(\x0b\x32\x19.flwr.proto.ServerMessageB\x02\x18\x01\x12<\n\x15legacy_client_message\x18\x66 \x01(\x0b\x32\x19.flwr.proto.ClientMessageB\x02\x18\x01\"a\n\x07TaskIns\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x13\n\x0bworkload_id\x18\x03 \x01(\t\x12\x1e\n\x04task\x18\x04 \x01(\x0b\x32\x10.flwr.proto.Task\"a\n\x07TaskRes\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x13\n\x0bworkload_id\x18\x03 \x01(\t\x12\x1e\n\x04task\x18\x04 \x01(\x0b\x32\x10.flwr.proto.Taskb\x06proto3')
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66lwr/proto/task.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x1a\x66lwr/proto/transport.proto\"\xbe\x02\n\x04Task\x12\"\n\x08producer\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\"\n\x08\x63onsumer\x18\x02 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x12\n\ncreated_at\x18\x03 \x01(\t\x12\x14\n\x0c\x64\x65livered_at\x18\x04 \x01(\t\x12\x0b\n\x03ttl\x18\x05 \x01(\t\x12\x10\n\x08\x61ncestry\x18\x06 \x03(\t\x12)\n\x02sa\x18\x07 \x01(\x0b\x32\x1d.flwr.proto.SecureAggregation\x12<\n\x15legacy_server_message\x18\x65 \x01(\x0b\x32\x19.flwr.proto.ServerMessageB\x02\x18\x01\x12<\n\x15legacy_client_message\x18\x66 \x01(\x0b\x32\x19.flwr.proto.ClientMessageB\x02\x18\x01\"a\n\x07TaskIns\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x13\n\x0bworkload_id\x18\x03 \x01(\t\x12\x1e\n\x04task\x18\x04 \x01(\x0b\x32\x10.flwr.proto.Task\"a\n\x07TaskRes\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x13\n\x0bworkload_id\x18\x03 \x01(\t\x12\x1e\n\x04task\x18\x04 \x01(\x0b\x32\x10.flwr.proto.Task\"\xf3\x03\n\x05Value\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x0e\n\x04\x62ool\x18\x03 \x01(\x08H\x00\x12\x10\n\x06string\x18\x04 \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x05 \x01(\x0cH\x00\x12\x33\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x1c.flwr.proto.Value.DoubleListH\x00\x12\x33\n\x0bsint64_list\x18\x16 \x01(\x0b\x32\x1c.flwr.proto.Value.Sint64ListH\x00\x12/\n\tbool_list\x18\x17 \x01(\x0b\x32\x1a.flwr.proto.Value.BoolListH\x00\x12\x33\n\x0bstring_list\x18\x18 \x01(\x0b\x32\x1c.flwr.proto.Value.StringListH\x00\x12\x31\n\nbytes_list\x18\x19 \x01(\x0b\x32\x1b.flwr.proto.Value.BytesListH\x00\x1a\x1a\n\nDoubleList\x12\x0c\n\x04vals\x18\x01 \x03(\x01\x1a\x1a\n\nSint64List\x12\x0c\n\x04vals\x18\x01 \x03(\x12\x1a\x18\n\x08\x42oolList\x12\x0c\n\x04vals\x18\x01 \x03(\x08\x1a\x1a\n\nStringList\x12\x0c\n\x04vals\x18\x01 \x03(\t\x1a\x19\n\tBytesList\x12\x0c\n\x04vals\x18\x01 \x03(\x0c\x42\x07\n\x05value\"\xa0\x01\n\x11SecureAggregation\x12\x44\n\x0cnamed_values\x18\x01 \x03(\x0b\x32..flwr.proto.SecureAggregation.NamedValuesEntry\x1a\x45\n\x10NamedValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.flwr.proto.Value:\x02\x38\x01\x62\x06proto3')
20
20
 
21
21
 
22
22
 
23
23
  _TASK = DESCRIPTOR.message_types_by_name['Task']
24
24
  _TASKINS = DESCRIPTOR.message_types_by_name['TaskIns']
25
25
  _TASKRES = DESCRIPTOR.message_types_by_name['TaskRes']
26
+ _VALUE = DESCRIPTOR.message_types_by_name['Value']
27
+ _VALUE_DOUBLELIST = _VALUE.nested_types_by_name['DoubleList']
28
+ _VALUE_SINT64LIST = _VALUE.nested_types_by_name['Sint64List']
29
+ _VALUE_BOOLLIST = _VALUE.nested_types_by_name['BoolList']
30
+ _VALUE_STRINGLIST = _VALUE.nested_types_by_name['StringList']
31
+ _VALUE_BYTESLIST = _VALUE.nested_types_by_name['BytesList']
32
+ _SECUREAGGREGATION = DESCRIPTOR.message_types_by_name['SecureAggregation']
33
+ _SECUREAGGREGATION_NAMEDVALUESENTRY = _SECUREAGGREGATION.nested_types_by_name['NamedValuesEntry']
26
34
  Task = _reflection.GeneratedProtocolMessageType('Task', (_message.Message,), {
27
35
  'DESCRIPTOR' : _TASK,
28
36
  '__module__' : 'flwr.proto.task_pb2'
@@ -44,6 +52,68 @@ TaskRes = _reflection.GeneratedProtocolMessageType('TaskRes', (_message.Message,
44
52
  })
45
53
  _sym_db.RegisterMessage(TaskRes)
46
54
 
55
+ Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), {
56
+
57
+ 'DoubleList' : _reflection.GeneratedProtocolMessageType('DoubleList', (_message.Message,), {
58
+ 'DESCRIPTOR' : _VALUE_DOUBLELIST,
59
+ '__module__' : 'flwr.proto.task_pb2'
60
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value.DoubleList)
61
+ })
62
+ ,
63
+
64
+ 'Sint64List' : _reflection.GeneratedProtocolMessageType('Sint64List', (_message.Message,), {
65
+ 'DESCRIPTOR' : _VALUE_SINT64LIST,
66
+ '__module__' : 'flwr.proto.task_pb2'
67
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value.Sint64List)
68
+ })
69
+ ,
70
+
71
+ 'BoolList' : _reflection.GeneratedProtocolMessageType('BoolList', (_message.Message,), {
72
+ 'DESCRIPTOR' : _VALUE_BOOLLIST,
73
+ '__module__' : 'flwr.proto.task_pb2'
74
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value.BoolList)
75
+ })
76
+ ,
77
+
78
+ 'StringList' : _reflection.GeneratedProtocolMessageType('StringList', (_message.Message,), {
79
+ 'DESCRIPTOR' : _VALUE_STRINGLIST,
80
+ '__module__' : 'flwr.proto.task_pb2'
81
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value.StringList)
82
+ })
83
+ ,
84
+
85
+ 'BytesList' : _reflection.GeneratedProtocolMessageType('BytesList', (_message.Message,), {
86
+ 'DESCRIPTOR' : _VALUE_BYTESLIST,
87
+ '__module__' : 'flwr.proto.task_pb2'
88
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value.BytesList)
89
+ })
90
+ ,
91
+ 'DESCRIPTOR' : _VALUE,
92
+ '__module__' : 'flwr.proto.task_pb2'
93
+ # @@protoc_insertion_point(class_scope:flwr.proto.Value)
94
+ })
95
+ _sym_db.RegisterMessage(Value)
96
+ _sym_db.RegisterMessage(Value.DoubleList)
97
+ _sym_db.RegisterMessage(Value.Sint64List)
98
+ _sym_db.RegisterMessage(Value.BoolList)
99
+ _sym_db.RegisterMessage(Value.StringList)
100
+ _sym_db.RegisterMessage(Value.BytesList)
101
+
102
+ SecureAggregation = _reflection.GeneratedProtocolMessageType('SecureAggregation', (_message.Message,), {
103
+
104
+ 'NamedValuesEntry' : _reflection.GeneratedProtocolMessageType('NamedValuesEntry', (_message.Message,), {
105
+ 'DESCRIPTOR' : _SECUREAGGREGATION_NAMEDVALUESENTRY,
106
+ '__module__' : 'flwr.proto.task_pb2'
107
+ # @@protoc_insertion_point(class_scope:flwr.proto.SecureAggregation.NamedValuesEntry)
108
+ })
109
+ ,
110
+ 'DESCRIPTOR' : _SECUREAGGREGATION,
111
+ '__module__' : 'flwr.proto.task_pb2'
112
+ # @@protoc_insertion_point(class_scope:flwr.proto.SecureAggregation)
113
+ })
114
+ _sym_db.RegisterMessage(SecureAggregation)
115
+ _sym_db.RegisterMessage(SecureAggregation.NamedValuesEntry)
116
+
47
117
  if _descriptor._USE_C_DESCRIPTORS == False:
48
118
 
49
119
  DESCRIPTOR._options = None
@@ -51,10 +121,28 @@ if _descriptor._USE_C_DESCRIPTORS == False:
51
121
  _TASK.fields_by_name['legacy_server_message']._serialized_options = b'\030\001'
52
122
  _TASK.fields_by_name['legacy_client_message']._options = None
53
123
  _TASK.fields_by_name['legacy_client_message']._serialized_options = b'\030\001'
124
+ _SECUREAGGREGATION_NAMEDVALUESENTRY._options = None
125
+ _SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_options = b'8\001'
54
126
  _TASK._serialized_start=89
55
- _TASK._serialized_end=364
56
- _TASKINS._serialized_start=366
57
- _TASKINS._serialized_end=463
58
- _TASKRES._serialized_start=465
59
- _TASKRES._serialized_end=562
127
+ _TASK._serialized_end=407
128
+ _TASKINS._serialized_start=409
129
+ _TASKINS._serialized_end=506
130
+ _TASKRES._serialized_start=508
131
+ _TASKRES._serialized_end=605
132
+ _VALUE._serialized_start=608
133
+ _VALUE._serialized_end=1107
134
+ _VALUE_DOUBLELIST._serialized_start=963
135
+ _VALUE_DOUBLELIST._serialized_end=989
136
+ _VALUE_SINT64LIST._serialized_start=991
137
+ _VALUE_SINT64LIST._serialized_end=1017
138
+ _VALUE_BOOLLIST._serialized_start=1019
139
+ _VALUE_BOOLLIST._serialized_end=1043
140
+ _VALUE_STRINGLIST._serialized_start=1045
141
+ _VALUE_STRINGLIST._serialized_end=1071
142
+ _VALUE_BYTESLIST._serialized_start=1073
143
+ _VALUE_BYTESLIST._serialized_end=1098
144
+ _SECUREAGGREGATION._serialized_start=1110
145
+ _SECUREAGGREGATION._serialized_end=1270
146
+ _SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_start=1201
147
+ _SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_end=1270
60
148
  # @@protoc_insertion_point(module_scope)
flwr/proto/task_pb2.pyi CHANGED
@@ -21,6 +21,7 @@ class Task(google.protobuf.message.Message):
21
21
  DELIVERED_AT_FIELD_NUMBER: builtins.int
22
22
  TTL_FIELD_NUMBER: builtins.int
23
23
  ANCESTRY_FIELD_NUMBER: builtins.int
24
+ SA_FIELD_NUMBER: builtins.int
24
25
  LEGACY_SERVER_MESSAGE_FIELD_NUMBER: builtins.int
25
26
  LEGACY_CLIENT_MESSAGE_FIELD_NUMBER: builtins.int
26
27
  @property
@@ -33,6 +34,8 @@ class Task(google.protobuf.message.Message):
33
34
  @property
34
35
  def ancestry(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ...
35
36
  @property
37
+ def sa(self) -> global___SecureAggregation: ...
38
+ @property
36
39
  def legacy_server_message(self) -> flwr.proto.transport_pb2.ServerMessage: ...
37
40
  @property
38
41
  def legacy_client_message(self) -> flwr.proto.transport_pb2.ClientMessage: ...
@@ -44,11 +47,12 @@ class Task(google.protobuf.message.Message):
44
47
  delivered_at: typing.Text = ...,
45
48
  ttl: typing.Text = ...,
46
49
  ancestry: typing.Optional[typing.Iterable[typing.Text]] = ...,
50
+ sa: typing.Optional[global___SecureAggregation] = ...,
47
51
  legacy_server_message: typing.Optional[flwr.proto.transport_pb2.ServerMessage] = ...,
48
52
  legacy_client_message: typing.Optional[flwr.proto.transport_pb2.ClientMessage] = ...,
49
53
  ) -> None: ...
50
- def HasField(self, field_name: typing_extensions.Literal["consumer",b"consumer","legacy_client_message",b"legacy_client_message","legacy_server_message",b"legacy_server_message","producer",b"producer"]) -> builtins.bool: ...
51
- def ClearField(self, field_name: typing_extensions.Literal["ancestry",b"ancestry","consumer",b"consumer","created_at",b"created_at","delivered_at",b"delivered_at","legacy_client_message",b"legacy_client_message","legacy_server_message",b"legacy_server_message","producer",b"producer","ttl",b"ttl"]) -> None: ...
54
+ def HasField(self, field_name: typing_extensions.Literal["consumer",b"consumer","legacy_client_message",b"legacy_client_message","legacy_server_message",b"legacy_server_message","producer",b"producer","sa",b"sa"]) -> builtins.bool: ...
55
+ def ClearField(self, field_name: typing_extensions.Literal["ancestry",b"ancestry","consumer",b"consumer","created_at",b"created_at","delivered_at",b"delivered_at","legacy_client_message",b"legacy_client_message","legacy_server_message",b"legacy_server_message","producer",b"producer","sa",b"sa","ttl",b"ttl"]) -> None: ...
52
56
  global___Task = Task
53
57
 
54
58
  class TaskIns(google.protobuf.message.Message):
@@ -94,3 +98,134 @@ class TaskRes(google.protobuf.message.Message):
94
98
  def HasField(self, field_name: typing_extensions.Literal["task",b"task"]) -> builtins.bool: ...
95
99
  def ClearField(self, field_name: typing_extensions.Literal["group_id",b"group_id","task",b"task","task_id",b"task_id","workload_id",b"workload_id"]) -> None: ...
96
100
  global___TaskRes = TaskRes
101
+
102
+ class Value(google.protobuf.message.Message):
103
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
104
+ class DoubleList(google.protobuf.message.Message):
105
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
106
+ VALS_FIELD_NUMBER: builtins.int
107
+ @property
108
+ def vals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.float]: ...
109
+ def __init__(self,
110
+ *,
111
+ vals: typing.Optional[typing.Iterable[builtins.float]] = ...,
112
+ ) -> None: ...
113
+ def ClearField(self, field_name: typing_extensions.Literal["vals",b"vals"]) -> None: ...
114
+
115
+ class Sint64List(google.protobuf.message.Message):
116
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
117
+ VALS_FIELD_NUMBER: builtins.int
118
+ @property
119
+ def vals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ...
120
+ def __init__(self,
121
+ *,
122
+ vals: typing.Optional[typing.Iterable[builtins.int]] = ...,
123
+ ) -> None: ...
124
+ def ClearField(self, field_name: typing_extensions.Literal["vals",b"vals"]) -> None: ...
125
+
126
+ class BoolList(google.protobuf.message.Message):
127
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
128
+ VALS_FIELD_NUMBER: builtins.int
129
+ @property
130
+ def vals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bool]: ...
131
+ def __init__(self,
132
+ *,
133
+ vals: typing.Optional[typing.Iterable[builtins.bool]] = ...,
134
+ ) -> None: ...
135
+ def ClearField(self, field_name: typing_extensions.Literal["vals",b"vals"]) -> None: ...
136
+
137
+ class StringList(google.protobuf.message.Message):
138
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
139
+ VALS_FIELD_NUMBER: builtins.int
140
+ @property
141
+ def vals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ...
142
+ def __init__(self,
143
+ *,
144
+ vals: typing.Optional[typing.Iterable[typing.Text]] = ...,
145
+ ) -> None: ...
146
+ def ClearField(self, field_name: typing_extensions.Literal["vals",b"vals"]) -> None: ...
147
+
148
+ class BytesList(google.protobuf.message.Message):
149
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
150
+ VALS_FIELD_NUMBER: builtins.int
151
+ @property
152
+ def vals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
153
+ def __init__(self,
154
+ *,
155
+ vals: typing.Optional[typing.Iterable[builtins.bytes]] = ...,
156
+ ) -> None: ...
157
+ def ClearField(self, field_name: typing_extensions.Literal["vals",b"vals"]) -> None: ...
158
+
159
+ DOUBLE_FIELD_NUMBER: builtins.int
160
+ SINT64_FIELD_NUMBER: builtins.int
161
+ BOOL_FIELD_NUMBER: builtins.int
162
+ STRING_FIELD_NUMBER: builtins.int
163
+ BYTES_FIELD_NUMBER: builtins.int
164
+ DOUBLE_LIST_FIELD_NUMBER: builtins.int
165
+ SINT64_LIST_FIELD_NUMBER: builtins.int
166
+ BOOL_LIST_FIELD_NUMBER: builtins.int
167
+ STRING_LIST_FIELD_NUMBER: builtins.int
168
+ BYTES_LIST_FIELD_NUMBER: builtins.int
169
+ double: builtins.float
170
+ """Single element"""
171
+
172
+ sint64: builtins.int
173
+ bool: builtins.bool
174
+ string: typing.Text
175
+ bytes: builtins.bytes
176
+ @property
177
+ def double_list(self) -> global___Value.DoubleList:
178
+ """List types"""
179
+ pass
180
+ @property
181
+ def sint64_list(self) -> global___Value.Sint64List: ...
182
+ @property
183
+ def bool_list(self) -> global___Value.BoolList: ...
184
+ @property
185
+ def string_list(self) -> global___Value.StringList: ...
186
+ @property
187
+ def bytes_list(self) -> global___Value.BytesList: ...
188
+ def __init__(self,
189
+ *,
190
+ double: builtins.float = ...,
191
+ sint64: builtins.int = ...,
192
+ bool: builtins.bool = ...,
193
+ string: typing.Text = ...,
194
+ bytes: builtins.bytes = ...,
195
+ double_list: typing.Optional[global___Value.DoubleList] = ...,
196
+ sint64_list: typing.Optional[global___Value.Sint64List] = ...,
197
+ bool_list: typing.Optional[global___Value.BoolList] = ...,
198
+ string_list: typing.Optional[global___Value.StringList] = ...,
199
+ bytes_list: typing.Optional[global___Value.BytesList] = ...,
200
+ ) -> None: ...
201
+ def HasField(self, field_name: typing_extensions.Literal["bool",b"bool","bool_list",b"bool_list","bytes",b"bytes","bytes_list",b"bytes_list","double",b"double","double_list",b"double_list","sint64",b"sint64","sint64_list",b"sint64_list","string",b"string","string_list",b"string_list","value",b"value"]) -> builtins.bool: ...
202
+ def ClearField(self, field_name: typing_extensions.Literal["bool",b"bool","bool_list",b"bool_list","bytes",b"bytes","bytes_list",b"bytes_list","double",b"double","double_list",b"double_list","sint64",b"sint64","sint64_list",b"sint64_list","string",b"string","string_list",b"string_list","value",b"value"]) -> None: ...
203
+ def WhichOneof(self, oneof_group: typing_extensions.Literal["value",b"value"]) -> typing.Optional[typing_extensions.Literal["double","sint64","bool","string","bytes","double_list","sint64_list","bool_list","string_list","bytes_list"]]: ...
204
+ global___Value = Value
205
+
206
+ class SecureAggregation(google.protobuf.message.Message):
207
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
208
+ class NamedValuesEntry(google.protobuf.message.Message):
209
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
210
+ KEY_FIELD_NUMBER: builtins.int
211
+ VALUE_FIELD_NUMBER: builtins.int
212
+ key: typing.Text
213
+ @property
214
+ def value(self) -> global___Value: ...
215
+ def __init__(self,
216
+ *,
217
+ key: typing.Text = ...,
218
+ value: typing.Optional[global___Value] = ...,
219
+ ) -> None: ...
220
+ def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
221
+ def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
222
+
223
+ NAMED_VALUES_FIELD_NUMBER: builtins.int
224
+ @property
225
+ def named_values(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___Value]: ...
226
+ def __init__(self,
227
+ *,
228
+ named_values: typing.Optional[typing.Mapping[typing.Text, global___Value]] = ...,
229
+ ) -> None: ...
230
+ def ClearField(self, field_name: typing_extensions.Literal["named_values",b"named_values"]) -> None: ...
231
+ global___SecureAggregation = SecureAggregation