flwr-nightly 1.17.0.dev20250319__py3-none-any.whl → 1.17.0.dev20250321__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.
- flwr/cli/run/run.py +5 -9
- flwr/client/app.py +6 -4
- flwr/client/client_app.py +10 -12
- flwr/client/clientapp/app.py +2 -2
- flwr/client/grpc_client/connection.py +24 -21
- flwr/client/message_handler/message_handler.py +27 -27
- flwr/client/mod/__init__.py +2 -2
- flwr/client/mod/centraldp_mods.py +7 -7
- flwr/client/mod/comms_mods.py +16 -22
- flwr/client/mod/localdp_mod.py +4 -4
- flwr/client/mod/secure_aggregation/secaggplus_mod.py +31 -31
- flwr/client/run_info_store.py +2 -2
- flwr/common/__init__.py +12 -4
- flwr/common/config.py +4 -4
- flwr/common/constant.py +1 -1
- flwr/common/context.py +4 -4
- flwr/common/message.py +269 -101
- flwr/common/record/__init__.py +8 -4
- flwr/common/record/{parametersrecord.py → arrayrecord.py} +75 -32
- flwr/common/record/{configsrecord.py → configrecord.py} +75 -29
- flwr/common/record/conversion_utils.py +1 -1
- flwr/common/record/{metricsrecord.py → metricrecord.py} +78 -32
- flwr/common/record/recorddict.py +288 -0
- flwr/common/recorddict_compat.py +410 -0
- flwr/common/secure_aggregation/secaggplus_constants.py +1 -1
- flwr/common/serde.py +66 -71
- flwr/common/typing.py +8 -8
- flwr/proto/exec_pb2.py +3 -3
- flwr/proto/exec_pb2.pyi +3 -3
- flwr/proto/message_pb2.py +12 -12
- flwr/proto/message_pb2.pyi +9 -9
- flwr/proto/recorddict_pb2.py +70 -0
- flwr/proto/{recordset_pb2.pyi → recorddict_pb2.pyi} +35 -35
- flwr/proto/run_pb2.py +31 -31
- flwr/proto/run_pb2.pyi +3 -3
- flwr/server/compat/grid_client_proxy.py +31 -31
- flwr/server/grid/grid.py +3 -3
- flwr/server/grid/grpc_grid.py +15 -23
- flwr/server/grid/inmemory_grid.py +14 -20
- flwr/server/superlink/fleet/vce/backend/backend.py +2 -2
- flwr/server/superlink/fleet/vce/backend/raybackend.py +2 -2
- flwr/server/superlink/fleet/vce/vce_api.py +1 -3
- flwr/server/superlink/linkstate/in_memory_linkstate.py +5 -5
- flwr/server/superlink/linkstate/linkstate.py +4 -4
- flwr/server/superlink/linkstate/sqlite_linkstate.py +21 -25
- flwr/server/superlink/linkstate/utils.py +18 -15
- flwr/server/superlink/serverappio/serverappio_servicer.py +3 -3
- flwr/server/superlink/simulation/simulationio_servicer.py +2 -2
- flwr/server/utils/validator.py +4 -4
- flwr/server/workflow/default_workflows.py +34 -41
- flwr/server/workflow/secure_aggregation/secaggplus_workflow.py +37 -39
- flwr/simulation/app.py +2 -2
- flwr/simulation/ray_transport/ray_actor.py +4 -2
- flwr/simulation/ray_transport/ray_client_proxy.py +34 -32
- flwr/simulation/run_simulation.py +5 -5
- flwr/superexec/deployment.py +4 -4
- flwr/superexec/exec_servicer.py +2 -2
- flwr/superexec/executor.py +3 -3
- flwr/superexec/simulation.py +3 -3
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/METADATA +1 -1
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/RECORD +66 -66
- flwr/common/record/recordset.py +0 -209
- flwr/common/recordset_compat.py +0 -418
- flwr/proto/recordset_pb2.py +0 -70
- /flwr/proto/{recordset_pb2_grpc.py → recorddict_pb2_grpc.py} +0 -0
- /flwr/proto/{recordset_pb2_grpc.pyi → recorddict_pb2_grpc.pyi} +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/entry_points.txt +0 -0
@@ -104,7 +104,7 @@ class Array(google.protobuf.message.Message):
|
|
104
104
|
def ClearField(self, field_name: typing_extensions.Literal["data",b"data","dtype",b"dtype","shape",b"shape","stype",b"stype"]) -> None: ...
|
105
105
|
global___Array = Array
|
106
106
|
|
107
|
-
class
|
107
|
+
class MetricRecordValue(google.protobuf.message.Message):
|
108
108
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
109
109
|
DOUBLE_FIELD_NUMBER: builtins.int
|
110
110
|
SINT64_FIELD_NUMBER: builtins.int
|
@@ -137,9 +137,9 @@ class MetricsRecordValue(google.protobuf.message.Message):
|
|
137
137
|
def HasField(self, field_name: typing_extensions.Literal["double",b"double","double_list",b"double_list","sint64",b"sint64","sint_list",b"sint_list","uint64",b"uint64","uint_list",b"uint_list","value",b"value"]) -> builtins.bool: ...
|
138
138
|
def ClearField(self, field_name: typing_extensions.Literal["double",b"double","double_list",b"double_list","sint64",b"sint64","sint_list",b"sint_list","uint64",b"uint64","uint_list",b"uint_list","value",b"value"]) -> None: ...
|
139
139
|
def WhichOneof(self, oneof_group: typing_extensions.Literal["value",b"value"]) -> typing.Optional[typing_extensions.Literal["double","sint64","uint64","double_list","sint_list","uint_list"]]: ...
|
140
|
-
|
140
|
+
global___MetricRecordValue = MetricRecordValue
|
141
141
|
|
142
|
-
class
|
142
|
+
class ConfigRecordValue(google.protobuf.message.Message):
|
143
143
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
144
144
|
DOUBLE_FIELD_NUMBER: builtins.int
|
145
145
|
SINT64_FIELD_NUMBER: builtins.int
|
@@ -193,9 +193,9 @@ class ConfigsRecordValue(google.protobuf.message.Message):
|
|
193
193
|
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","sint_list",b"sint_list","string",b"string","string_list",b"string_list","uint64",b"uint64","uint_list",b"uint_list","value",b"value"]) -> builtins.bool: ...
|
194
194
|
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","sint_list",b"sint_list","string",b"string","string_list",b"string_list","uint64",b"uint64","uint_list",b"uint_list","value",b"value"]) -> None: ...
|
195
195
|
def WhichOneof(self, oneof_group: typing_extensions.Literal["value",b"value"]) -> typing.Optional[typing_extensions.Literal["double","sint64","uint64","bool","string","bytes","double_list","sint_list","uint_list","bool_list","string_list","bytes_list"]]: ...
|
196
|
-
|
196
|
+
global___ConfigRecordValue = ConfigRecordValue
|
197
197
|
|
198
|
-
class
|
198
|
+
class ArrayRecord(google.protobuf.message.Message):
|
199
199
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
200
200
|
DATA_KEYS_FIELD_NUMBER: builtins.int
|
201
201
|
DATA_VALUES_FIELD_NUMBER: builtins.int
|
@@ -209,9 +209,9 @@ class ParametersRecord(google.protobuf.message.Message):
|
|
209
209
|
data_values: typing.Optional[typing.Iterable[global___Array]] = ...,
|
210
210
|
) -> None: ...
|
211
211
|
def ClearField(self, field_name: typing_extensions.Literal["data_keys",b"data_keys","data_values",b"data_values"]) -> None: ...
|
212
|
-
|
212
|
+
global___ArrayRecord = ArrayRecord
|
213
213
|
|
214
|
-
class
|
214
|
+
class MetricRecord(google.protobuf.message.Message):
|
215
215
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
216
216
|
class DataEntry(google.protobuf.message.Message):
|
217
217
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
@@ -219,26 +219,26 @@ class MetricsRecord(google.protobuf.message.Message):
|
|
219
219
|
VALUE_FIELD_NUMBER: builtins.int
|
220
220
|
key: typing.Text
|
221
221
|
@property
|
222
|
-
def value(self) ->
|
222
|
+
def value(self) -> global___MetricRecordValue: ...
|
223
223
|
def __init__(self,
|
224
224
|
*,
|
225
225
|
key: typing.Text = ...,
|
226
|
-
value: typing.Optional[
|
226
|
+
value: typing.Optional[global___MetricRecordValue] = ...,
|
227
227
|
) -> None: ...
|
228
228
|
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
|
229
229
|
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
|
230
230
|
|
231
231
|
DATA_FIELD_NUMBER: builtins.int
|
232
232
|
@property
|
233
|
-
def data(self) -> google.protobuf.internal.containers.MessageMap[typing.Text,
|
233
|
+
def data(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___MetricRecordValue]: ...
|
234
234
|
def __init__(self,
|
235
235
|
*,
|
236
|
-
data: typing.Optional[typing.Mapping[typing.Text,
|
236
|
+
data: typing.Optional[typing.Mapping[typing.Text, global___MetricRecordValue]] = ...,
|
237
237
|
) -> None: ...
|
238
238
|
def ClearField(self, field_name: typing_extensions.Literal["data",b"data"]) -> None: ...
|
239
|
-
|
239
|
+
global___MetricRecord = MetricRecord
|
240
240
|
|
241
|
-
class
|
241
|
+
class ConfigRecord(google.protobuf.message.Message):
|
242
242
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
243
243
|
class DataEntry(google.protobuf.message.Message):
|
244
244
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
@@ -246,38 +246,38 @@ class ConfigsRecord(google.protobuf.message.Message):
|
|
246
246
|
VALUE_FIELD_NUMBER: builtins.int
|
247
247
|
key: typing.Text
|
248
248
|
@property
|
249
|
-
def value(self) ->
|
249
|
+
def value(self) -> global___ConfigRecordValue: ...
|
250
250
|
def __init__(self,
|
251
251
|
*,
|
252
252
|
key: typing.Text = ...,
|
253
|
-
value: typing.Optional[
|
253
|
+
value: typing.Optional[global___ConfigRecordValue] = ...,
|
254
254
|
) -> None: ...
|
255
255
|
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
|
256
256
|
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
|
257
257
|
|
258
258
|
DATA_FIELD_NUMBER: builtins.int
|
259
259
|
@property
|
260
|
-
def data(self) -> google.protobuf.internal.containers.MessageMap[typing.Text,
|
260
|
+
def data(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___ConfigRecordValue]: ...
|
261
261
|
def __init__(self,
|
262
262
|
*,
|
263
|
-
data: typing.Optional[typing.Mapping[typing.Text,
|
263
|
+
data: typing.Optional[typing.Mapping[typing.Text, global___ConfigRecordValue]] = ...,
|
264
264
|
) -> None: ...
|
265
265
|
def ClearField(self, field_name: typing_extensions.Literal["data",b"data"]) -> None: ...
|
266
|
-
|
266
|
+
global___ConfigRecord = ConfigRecord
|
267
267
|
|
268
|
-
class
|
268
|
+
class RecordDict(google.protobuf.message.Message):
|
269
269
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
270
|
-
class
|
270
|
+
class ArraysEntry(google.protobuf.message.Message):
|
271
271
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
272
272
|
KEY_FIELD_NUMBER: builtins.int
|
273
273
|
VALUE_FIELD_NUMBER: builtins.int
|
274
274
|
key: typing.Text
|
275
275
|
@property
|
276
|
-
def value(self) ->
|
276
|
+
def value(self) -> global___ArrayRecord: ...
|
277
277
|
def __init__(self,
|
278
278
|
*,
|
279
279
|
key: typing.Text = ...,
|
280
|
-
value: typing.Optional[
|
280
|
+
value: typing.Optional[global___ArrayRecord] = ...,
|
281
281
|
) -> None: ...
|
282
282
|
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
|
283
283
|
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
|
@@ -288,11 +288,11 @@ class RecordSet(google.protobuf.message.Message):
|
|
288
288
|
VALUE_FIELD_NUMBER: builtins.int
|
289
289
|
key: typing.Text
|
290
290
|
@property
|
291
|
-
def value(self) ->
|
291
|
+
def value(self) -> global___MetricRecord: ...
|
292
292
|
def __init__(self,
|
293
293
|
*,
|
294
294
|
key: typing.Text = ...,
|
295
|
-
value: typing.Optional[
|
295
|
+
value: typing.Optional[global___MetricRecord] = ...,
|
296
296
|
) -> None: ...
|
297
297
|
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
|
298
298
|
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
|
@@ -303,29 +303,29 @@ class RecordSet(google.protobuf.message.Message):
|
|
303
303
|
VALUE_FIELD_NUMBER: builtins.int
|
304
304
|
key: typing.Text
|
305
305
|
@property
|
306
|
-
def value(self) ->
|
306
|
+
def value(self) -> global___ConfigRecord: ...
|
307
307
|
def __init__(self,
|
308
308
|
*,
|
309
309
|
key: typing.Text = ...,
|
310
|
-
value: typing.Optional[
|
310
|
+
value: typing.Optional[global___ConfigRecord] = ...,
|
311
311
|
) -> None: ...
|
312
312
|
def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ...
|
313
313
|
def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ...
|
314
314
|
|
315
|
-
|
315
|
+
ARRAYS_FIELD_NUMBER: builtins.int
|
316
316
|
METRICS_FIELD_NUMBER: builtins.int
|
317
317
|
CONFIGS_FIELD_NUMBER: builtins.int
|
318
318
|
@property
|
319
|
-
def
|
319
|
+
def arrays(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___ArrayRecord]: ...
|
320
320
|
@property
|
321
|
-
def metrics(self) -> google.protobuf.internal.containers.MessageMap[typing.Text,
|
321
|
+
def metrics(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___MetricRecord]: ...
|
322
322
|
@property
|
323
|
-
def configs(self) -> google.protobuf.internal.containers.MessageMap[typing.Text,
|
323
|
+
def configs(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___ConfigRecord]: ...
|
324
324
|
def __init__(self,
|
325
325
|
*,
|
326
|
-
|
327
|
-
metrics: typing.Optional[typing.Mapping[typing.Text,
|
328
|
-
configs: typing.Optional[typing.Mapping[typing.Text,
|
326
|
+
arrays: typing.Optional[typing.Mapping[typing.Text, global___ArrayRecord]] = ...,
|
327
|
+
metrics: typing.Optional[typing.Mapping[typing.Text, global___MetricRecord]] = ...,
|
328
|
+
configs: typing.Optional[typing.Mapping[typing.Text, global___ConfigRecord]] = ...,
|
329
329
|
) -> None: ...
|
330
|
-
def ClearField(self, field_name: typing_extensions.Literal["
|
331
|
-
|
330
|
+
def ClearField(self, field_name: typing_extensions.Literal["arrays",b"arrays","configs",b"configs","metrics",b"metrics"]) -> None: ...
|
331
|
+
global___RecordDict = RecordDict
|
flwr/proto/run_pb2.py
CHANGED
@@ -14,11 +14,11 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
16
16
|
from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
|
17
|
-
from flwr.proto import
|
17
|
+
from flwr.proto import recorddict_pb2 as flwr_dot_proto_dot_recorddict__pb2
|
18
18
|
from flwr.proto import transport_pb2 as flwr_dot_proto_dot_transport__pb2
|
19
19
|
|
20
20
|
|
21
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/run.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x15\x66lwr/proto/node.proto\x1a\
|
21
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/run.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x1b\x66lwr/proto/recorddict.proto\x1a\x1a\x66lwr/proto/transport.proto\"\xce\x02\n\x03Run\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x0e\n\x06\x66\x61\x62_id\x18\x02 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x03 \x01(\t\x12<\n\x0foverride_config\x18\x04 \x03(\x0b\x32#.flwr.proto.Run.OverrideConfigEntry\x12\x10\n\x08\x66\x61\x62_hash\x18\x05 \x01(\t\x12\x12\n\npending_at\x18\x06 \x01(\t\x12\x13\n\x0bstarting_at\x18\x07 \x01(\t\x12\x12\n\nrunning_at\x18\x08 \x01(\t\x12\x13\n\x0b\x66inished_at\x18\t \x01(\t\x12%\n\x06status\x18\n \x01(\x0b\x32\x15.flwr.proto.RunStatus\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"@\n\tRunStatus\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x12\n\nsub_status\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\"\xeb\x01\n\x10\x43reateRunRequest\x12\x0e\n\x06\x66\x61\x62_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x02 \x01(\t\x12I\n\x0foverride_config\x18\x03 \x03(\x0b\x32\x30.flwr.proto.CreateRunRequest.OverrideConfigEntry\x12\x1c\n\x03\x66\x61\x62\x18\x04 \x01(\x0b\x32\x0f.flwr.proto.Fab\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"#\n\x11\x43reateRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"?\n\rGetRunRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\".\n\x0eGetRunResponse\x12\x1c\n\x03run\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Run\"S\n\x16UpdateRunStatusRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12)\n\nrun_status\x18\x02 \x01(\x0b\x32\x15.flwr.proto.RunStatus\"\x19\n\x17UpdateRunStatusResponse\"F\n\x13GetRunStatusRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x0f\n\x07run_ids\x18\x02 \x03(\x04\"\xb1\x01\n\x14GetRunStatusResponse\x12L\n\x0frun_status_dict\x18\x01 \x03(\x0b\x32\x33.flwr.proto.GetRunStatusResponse.RunStatusDictEntry\x1aK\n\x12RunStatusDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.flwr.proto.RunStatus:\x02\x38\x01\"-\n\x1bGetFederationOptionsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"T\n\x1cGetFederationOptionsResponse\x12\x34\n\x12\x66\x65\x64\x65ration_options\x18\x01 \x01(\x0b\x32\x18.flwr.proto.ConfigRecordb\x06proto3')
|
22
22
|
|
23
23
|
_globals = globals()
|
24
24
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -31,34 +31,34 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
31
31
|
_globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_options = b'8\001'
|
32
32
|
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._options = None
|
33
33
|
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_options = b'8\001'
|
34
|
-
_globals['_RUN']._serialized_start=
|
35
|
-
_globals['_RUN']._serialized_end=
|
36
|
-
_globals['_RUN_OVERRIDECONFIGENTRY']._serialized_start=
|
37
|
-
_globals['_RUN_OVERRIDECONFIGENTRY']._serialized_end=
|
38
|
-
_globals['_RUNSTATUS']._serialized_start=
|
39
|
-
_globals['_RUNSTATUS']._serialized_end=
|
40
|
-
_globals['_CREATERUNREQUEST']._serialized_start=
|
41
|
-
_globals['_CREATERUNREQUEST']._serialized_end=
|
42
|
-
_globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_start=
|
43
|
-
_globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_end=
|
44
|
-
_globals['_CREATERUNRESPONSE']._serialized_start=
|
45
|
-
_globals['_CREATERUNRESPONSE']._serialized_end=
|
46
|
-
_globals['_GETRUNREQUEST']._serialized_start=
|
47
|
-
_globals['_GETRUNREQUEST']._serialized_end=
|
48
|
-
_globals['_GETRUNRESPONSE']._serialized_start=
|
49
|
-
_globals['_GETRUNRESPONSE']._serialized_end=
|
50
|
-
_globals['_UPDATERUNSTATUSREQUEST']._serialized_start=
|
51
|
-
_globals['_UPDATERUNSTATUSREQUEST']._serialized_end=
|
52
|
-
_globals['_UPDATERUNSTATUSRESPONSE']._serialized_start=
|
53
|
-
_globals['_UPDATERUNSTATUSRESPONSE']._serialized_end=
|
54
|
-
_globals['_GETRUNSTATUSREQUEST']._serialized_start=
|
55
|
-
_globals['_GETRUNSTATUSREQUEST']._serialized_end=
|
56
|
-
_globals['_GETRUNSTATUSRESPONSE']._serialized_start=
|
57
|
-
_globals['_GETRUNSTATUSRESPONSE']._serialized_end=
|
58
|
-
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_start=
|
59
|
-
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_end=
|
60
|
-
_globals['_GETFEDERATIONOPTIONSREQUEST']._serialized_start=
|
61
|
-
_globals['_GETFEDERATIONOPTIONSREQUEST']._serialized_end=
|
62
|
-
_globals['_GETFEDERATIONOPTIONSRESPONSE']._serialized_start=
|
34
|
+
_globals['_RUN']._serialized_start=139
|
35
|
+
_globals['_RUN']._serialized_end=473
|
36
|
+
_globals['_RUN_OVERRIDECONFIGENTRY']._serialized_start=400
|
37
|
+
_globals['_RUN_OVERRIDECONFIGENTRY']._serialized_end=473
|
38
|
+
_globals['_RUNSTATUS']._serialized_start=475
|
39
|
+
_globals['_RUNSTATUS']._serialized_end=539
|
40
|
+
_globals['_CREATERUNREQUEST']._serialized_start=542
|
41
|
+
_globals['_CREATERUNREQUEST']._serialized_end=777
|
42
|
+
_globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_start=400
|
43
|
+
_globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_end=473
|
44
|
+
_globals['_CREATERUNRESPONSE']._serialized_start=779
|
45
|
+
_globals['_CREATERUNRESPONSE']._serialized_end=814
|
46
|
+
_globals['_GETRUNREQUEST']._serialized_start=816
|
47
|
+
_globals['_GETRUNREQUEST']._serialized_end=879
|
48
|
+
_globals['_GETRUNRESPONSE']._serialized_start=881
|
49
|
+
_globals['_GETRUNRESPONSE']._serialized_end=927
|
50
|
+
_globals['_UPDATERUNSTATUSREQUEST']._serialized_start=929
|
51
|
+
_globals['_UPDATERUNSTATUSREQUEST']._serialized_end=1012
|
52
|
+
_globals['_UPDATERUNSTATUSRESPONSE']._serialized_start=1014
|
53
|
+
_globals['_UPDATERUNSTATUSRESPONSE']._serialized_end=1039
|
54
|
+
_globals['_GETRUNSTATUSREQUEST']._serialized_start=1041
|
55
|
+
_globals['_GETRUNSTATUSREQUEST']._serialized_end=1111
|
56
|
+
_globals['_GETRUNSTATUSRESPONSE']._serialized_start=1114
|
57
|
+
_globals['_GETRUNSTATUSRESPONSE']._serialized_end=1291
|
58
|
+
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_start=1216
|
59
|
+
_globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_end=1291
|
60
|
+
_globals['_GETFEDERATIONOPTIONSREQUEST']._serialized_start=1293
|
61
|
+
_globals['_GETFEDERATIONOPTIONSREQUEST']._serialized_end=1338
|
62
|
+
_globals['_GETFEDERATIONOPTIONSRESPONSE']._serialized_start=1340
|
63
63
|
_globals['_GETFEDERATIONOPTIONSRESPONSE']._serialized_end=1424
|
64
64
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/run_pb2.pyi
CHANGED
@@ -5,7 +5,7 @@ isort:skip_file
|
|
5
5
|
import builtins
|
6
6
|
import flwr.proto.fab_pb2
|
7
7
|
import flwr.proto.node_pb2
|
8
|
-
import flwr.proto.
|
8
|
+
import flwr.proto.recorddict_pb2
|
9
9
|
import flwr.proto.transport_pb2
|
10
10
|
import google.protobuf.descriptor
|
11
11
|
import google.protobuf.internal.containers
|
@@ -258,10 +258,10 @@ class GetFederationOptionsResponse(google.protobuf.message.Message):
|
|
258
258
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
259
259
|
FEDERATION_OPTIONS_FIELD_NUMBER: builtins.int
|
260
260
|
@property
|
261
|
-
def federation_options(self) -> flwr.proto.
|
261
|
+
def federation_options(self) -> flwr.proto.recorddict_pb2.ConfigRecord: ...
|
262
262
|
def __init__(self,
|
263
263
|
*,
|
264
|
-
federation_options: typing.Optional[flwr.proto.
|
264
|
+
federation_options: typing.Optional[flwr.proto.recorddict_pb2.ConfigRecord] = ...,
|
265
265
|
) -> None: ...
|
266
266
|
def HasField(self, field_name: typing_extensions.Literal["federation_options",b"federation_options"]) -> builtins.bool: ...
|
267
267
|
def ClearField(self, field_name: typing_extensions.Literal["federation_options",b"federation_options"]) -> None: ...
|
@@ -18,8 +18,8 @@
|
|
18
18
|
from typing import Optional
|
19
19
|
|
20
20
|
from flwr import common
|
21
|
-
from flwr.common import Message, MessageType, MessageTypeLegacy,
|
22
|
-
from flwr.common import
|
21
|
+
from flwr.common import Message, MessageType, MessageTypeLegacy, RecordDict
|
22
|
+
from flwr.common import recorddict_compat as compat
|
23
23
|
from flwr.server.client_proxy import ClientProxy
|
24
24
|
|
25
25
|
from ..grid.grid import Grid
|
@@ -41,14 +41,14 @@ class GridClientProxy(ClientProxy):
|
|
41
41
|
group_id: Optional[int],
|
42
42
|
) -> common.GetPropertiesRes:
|
43
43
|
"""Return client's properties."""
|
44
|
-
# Ins to
|
45
|
-
|
44
|
+
# Ins to RecordDict
|
45
|
+
out_recorddict = compat.getpropertiesins_to_recorddict(ins)
|
46
46
|
# Fetch response
|
47
|
-
|
48
|
-
|
47
|
+
in_recorddict = self._send_receive_recorddict(
|
48
|
+
out_recorddict, MessageTypeLegacy.GET_PROPERTIES, timeout, group_id
|
49
49
|
)
|
50
|
-
#
|
51
|
-
return compat.
|
50
|
+
# RecordDict to Res
|
51
|
+
return compat.recorddict_to_getpropertiesres(in_recorddict)
|
52
52
|
|
53
53
|
def get_parameters(
|
54
54
|
self,
|
@@ -57,40 +57,40 @@ class GridClientProxy(ClientProxy):
|
|
57
57
|
group_id: Optional[int],
|
58
58
|
) -> common.GetParametersRes:
|
59
59
|
"""Return the current local model parameters."""
|
60
|
-
# Ins to
|
61
|
-
|
60
|
+
# Ins to RecordDict
|
61
|
+
out_recorddict = compat.getparametersins_to_recorddict(ins)
|
62
62
|
# Fetch response
|
63
|
-
|
64
|
-
|
63
|
+
in_recorddict = self._send_receive_recorddict(
|
64
|
+
out_recorddict, MessageTypeLegacy.GET_PARAMETERS, timeout, group_id
|
65
65
|
)
|
66
|
-
#
|
67
|
-
return compat.
|
66
|
+
# RecordDict to Res
|
67
|
+
return compat.recorddict_to_getparametersres(in_recorddict, False)
|
68
68
|
|
69
69
|
def fit(
|
70
70
|
self, ins: common.FitIns, timeout: Optional[float], group_id: Optional[int]
|
71
71
|
) -> common.FitRes:
|
72
72
|
"""Train model parameters on the locally held dataset."""
|
73
|
-
# Ins to
|
74
|
-
|
73
|
+
# Ins to RecordDict
|
74
|
+
out_recorddict = compat.fitins_to_recorddict(ins, keep_input=True)
|
75
75
|
# Fetch response
|
76
|
-
|
77
|
-
|
76
|
+
in_recorddict = self._send_receive_recorddict(
|
77
|
+
out_recorddict, MessageType.TRAIN, timeout, group_id
|
78
78
|
)
|
79
|
-
#
|
80
|
-
return compat.
|
79
|
+
# RecordDict to Res
|
80
|
+
return compat.recorddict_to_fitres(in_recorddict, keep_input=False)
|
81
81
|
|
82
82
|
def evaluate(
|
83
83
|
self, ins: common.EvaluateIns, timeout: Optional[float], group_id: Optional[int]
|
84
84
|
) -> common.EvaluateRes:
|
85
85
|
"""Evaluate model parameters on the locally held dataset."""
|
86
|
-
# Ins to
|
87
|
-
|
86
|
+
# Ins to RecordDict
|
87
|
+
out_recorddict = compat.evaluateins_to_recorddict(ins, keep_input=True)
|
88
88
|
# Fetch response
|
89
|
-
|
90
|
-
|
89
|
+
in_recorddict = self._send_receive_recorddict(
|
90
|
+
out_recorddict, MessageType.EVALUATE, timeout, group_id
|
91
91
|
)
|
92
|
-
#
|
93
|
-
return compat.
|
92
|
+
# RecordDict to Res
|
93
|
+
return compat.recorddict_to_evaluateres(in_recorddict)
|
94
94
|
|
95
95
|
def reconnect(
|
96
96
|
self,
|
@@ -101,17 +101,17 @@ class GridClientProxy(ClientProxy):
|
|
101
101
|
"""Disconnect and (optionally) reconnect later."""
|
102
102
|
return common.DisconnectRes(reason="") # Nothing to do here (yet)
|
103
103
|
|
104
|
-
def
|
104
|
+
def _send_receive_recorddict(
|
105
105
|
self,
|
106
|
-
|
106
|
+
recorddict: RecordDict,
|
107
107
|
message_type: str,
|
108
108
|
timeout: Optional[float],
|
109
109
|
group_id: Optional[int],
|
110
|
-
) ->
|
110
|
+
) -> RecordDict:
|
111
111
|
|
112
112
|
# Create message
|
113
|
-
message =
|
114
|
-
content=
|
113
|
+
message = Message(
|
114
|
+
content=recorddict,
|
115
115
|
message_type=message_type,
|
116
116
|
dst_node_id=self.node_id,
|
117
117
|
group_id=str(group_id) if group_id else "",
|
flwr/server/grid/grid.py
CHANGED
@@ -19,7 +19,7 @@ from abc import ABC, abstractmethod
|
|
19
19
|
from collections.abc import Iterable
|
20
20
|
from typing import Optional
|
21
21
|
|
22
|
-
from flwr.common import Message,
|
22
|
+
from flwr.common import Message, RecordDict
|
23
23
|
from flwr.common.typing import Run
|
24
24
|
|
25
25
|
|
@@ -48,7 +48,7 @@ class Grid(ABC):
|
|
48
48
|
@abstractmethod
|
49
49
|
def create_message( # pylint: disable=too-many-arguments,R0917
|
50
50
|
self,
|
51
|
-
content:
|
51
|
+
content: RecordDict,
|
52
52
|
message_type: str,
|
53
53
|
dst_node_id: int,
|
54
54
|
group_id: str,
|
@@ -61,7 +61,7 @@ class Grid(ABC):
|
|
61
61
|
|
62
62
|
Parameters
|
63
63
|
----------
|
64
|
-
content :
|
64
|
+
content : RecordDict
|
65
65
|
The content for the new message. This holds records that are to be sent
|
66
66
|
to the destination node.
|
67
67
|
message_type : str
|
flwr/server/grid/grpc_grid.py
CHANGED
@@ -22,13 +22,13 @@ from typing import Optional, cast
|
|
22
22
|
|
23
23
|
import grpc
|
24
24
|
|
25
|
-
from flwr.common import
|
25
|
+
from flwr.common import Message, RecordDict
|
26
26
|
from flwr.common.constant import (
|
27
27
|
SERVERAPPIO_API_DEFAULT_CLIENT_ADDRESS,
|
28
28
|
SUPERLINK_NODE_ID,
|
29
29
|
)
|
30
30
|
from flwr.common.grpc import create_channel, on_channel_state_change
|
31
|
-
from flwr.common.logger import log
|
31
|
+
from flwr.common.logger import log, warn_deprecated_feature
|
32
32
|
from flwr.common.retry_invoker import _make_simple_grpc_retry_invoker, _wrap_stub
|
33
33
|
from flwr.common.serde import message_from_proto, message_to_proto, run_from_proto
|
34
34
|
from flwr.common.typing import Run
|
@@ -161,18 +161,15 @@ class GrpcGrid(Grid):
|
|
161
161
|
def _check_message(self, message: Message) -> None:
|
162
162
|
# Check if the message is valid
|
163
163
|
if not (
|
164
|
-
|
165
|
-
message.metadata.
|
166
|
-
and message.metadata.src_node_id == self.node.node_id
|
167
|
-
and message.metadata.message_id == ""
|
168
|
-
and message.metadata.reply_to_message == ""
|
164
|
+
message.metadata.message_id == ""
|
165
|
+
and message.metadata.reply_to_message_id == ""
|
169
166
|
and message.metadata.ttl > 0
|
170
167
|
):
|
171
168
|
raise ValueError(f"Invalid message: {message}")
|
172
169
|
|
173
170
|
def create_message( # pylint: disable=too-many-arguments,R0917
|
174
171
|
self,
|
175
|
-
content:
|
172
|
+
content: RecordDict,
|
176
173
|
message_type: str,
|
177
174
|
dst_node_id: int,
|
178
175
|
group_id: str,
|
@@ -183,18 +180,11 @@ class GrpcGrid(Grid):
|
|
183
180
|
This method constructs a new `Message` with given content and metadata.
|
184
181
|
The `run_id` and `src_node_id` will be set automatically.
|
185
182
|
"""
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
message_id="", # Will be set by the server
|
190
|
-
src_node_id=self.node.node_id,
|
191
|
-
dst_node_id=dst_node_id,
|
192
|
-
reply_to_message="",
|
193
|
-
group_id=group_id,
|
194
|
-
ttl=ttl_,
|
195
|
-
message_type=message_type,
|
183
|
+
warn_deprecated_feature(
|
184
|
+
"`Driver.create_message` / `Grid.create_message` is deprecated."
|
185
|
+
"Use `Message` constructor instead."
|
196
186
|
)
|
197
|
-
return Message(
|
187
|
+
return Message(content, dst_node_id, message_type, ttl=ttl, group_id=group_id)
|
198
188
|
|
199
189
|
def get_node_ids(self) -> Iterable[int]:
|
200
190
|
"""Get node IDs."""
|
@@ -211,8 +201,12 @@ class GrpcGrid(Grid):
|
|
211
201
|
to the node specified in `dst_node_id`.
|
212
202
|
"""
|
213
203
|
# Construct Messages
|
204
|
+
run_id = cast(Run, self._run).run_id
|
214
205
|
message_proto_list: list[ProtoMessage] = []
|
215
206
|
for msg in messages:
|
207
|
+
# Populate metadata
|
208
|
+
msg.metadata.__dict__["_run_id"] = run_id
|
209
|
+
msg.metadata.__dict__["_src_node_id"] = self.node.node_id
|
216
210
|
# Check message
|
217
211
|
self._check_message(msg)
|
218
212
|
# Convert to proto
|
@@ -223,9 +217,7 @@ class GrpcGrid(Grid):
|
|
223
217
|
try:
|
224
218
|
# Call GrpcServerAppIoStub method
|
225
219
|
res: PushInsMessagesResponse = self._stub.PushMessages(
|
226
|
-
PushInsMessagesRequest(
|
227
|
-
messages_list=message_proto_list, run_id=cast(Run, self._run).run_id
|
228
|
-
)
|
220
|
+
PushInsMessagesRequest(messages_list=message_proto_list, run_id=run_id)
|
229
221
|
)
|
230
222
|
if len([msg_id for msg_id in res.message_ids if msg_id]) != len(
|
231
223
|
message_proto_list
|
@@ -289,7 +281,7 @@ class GrpcGrid(Grid):
|
|
289
281
|
res_msgs = self.pull_messages(msg_ids)
|
290
282
|
ret.extend(res_msgs)
|
291
283
|
msg_ids.difference_update(
|
292
|
-
{msg.metadata.
|
284
|
+
{msg.metadata.reply_to_message_id for msg in res_msgs}
|
293
285
|
)
|
294
286
|
if len(msg_ids) == 0:
|
295
287
|
break
|
@@ -20,8 +20,9 @@ from collections.abc import Iterable
|
|
20
20
|
from typing import Optional, cast
|
21
21
|
from uuid import UUID
|
22
22
|
|
23
|
-
from flwr.common import
|
23
|
+
from flwr.common import Message, RecordDict
|
24
24
|
from flwr.common.constant import SUPERLINK_NODE_ID
|
25
|
+
from flwr.common.logger import warn_deprecated_feature
|
25
26
|
from flwr.common.typing import Run
|
26
27
|
from flwr.proto.node_pb2 import Node # pylint: disable=E0611
|
27
28
|
from flwr.server.superlink.linkstate import LinkStateFactory
|
@@ -53,10 +54,8 @@ class InMemoryGrid(Grid):
|
|
53
54
|
def _check_message(self, message: Message) -> None:
|
54
55
|
# Check if the message is valid
|
55
56
|
if not (
|
56
|
-
message.metadata.
|
57
|
-
and message.metadata.
|
58
|
-
and message.metadata.message_id == ""
|
59
|
-
and message.metadata.reply_to_message == ""
|
57
|
+
message.metadata.message_id == ""
|
58
|
+
and message.metadata.reply_to_message_id == ""
|
60
59
|
and message.metadata.ttl > 0
|
61
60
|
and message.metadata.delivered_at == ""
|
62
61
|
):
|
@@ -76,7 +75,7 @@ class InMemoryGrid(Grid):
|
|
76
75
|
|
77
76
|
def create_message( # pylint: disable=too-many-arguments,R0917
|
78
77
|
self,
|
79
|
-
content:
|
78
|
+
content: RecordDict,
|
80
79
|
message_type: str,
|
81
80
|
dst_node_id: int,
|
82
81
|
group_id: str,
|
@@ -87,19 +86,11 @@ class InMemoryGrid(Grid):
|
|
87
86
|
This method constructs a new `Message` with given content and metadata.
|
88
87
|
The `run_id` and `src_node_id` will be set automatically.
|
89
88
|
"""
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
run_id=cast(Run, self._run).run_id,
|
94
|
-
message_id="", # Will be set by the server
|
95
|
-
src_node_id=self.node.node_id,
|
96
|
-
dst_node_id=dst_node_id,
|
97
|
-
reply_to_message="",
|
98
|
-
group_id=group_id,
|
99
|
-
ttl=ttl_,
|
100
|
-
message_type=message_type,
|
89
|
+
warn_deprecated_feature(
|
90
|
+
"`Driver.create_message` / `Grid.create_message` is deprecated."
|
91
|
+
"Use `Message` constructor instead."
|
101
92
|
)
|
102
|
-
return Message(
|
93
|
+
return Message(content, dst_node_id, message_type, ttl=ttl, group_id=group_id)
|
103
94
|
|
104
95
|
def get_node_ids(self) -> Iterable[int]:
|
105
96
|
"""Get node IDs."""
|
@@ -113,6 +104,9 @@ class InMemoryGrid(Grid):
|
|
113
104
|
"""
|
114
105
|
msg_ids: list[str] = []
|
115
106
|
for msg in messages:
|
107
|
+
# Populate metadata
|
108
|
+
msg.metadata.__dict__["_run_id"] = cast(Run, self._run).run_id
|
109
|
+
msg.metadata.__dict__["_src_node_id"] = self.node.node_id
|
116
110
|
# Check message
|
117
111
|
self._check_message(msg)
|
118
112
|
# Store in state
|
@@ -133,7 +127,7 @@ class InMemoryGrid(Grid):
|
|
133
127
|
message_res_list = self.state.get_message_res(message_ids=msg_ids)
|
134
128
|
# Get IDs of Messages these replies are for
|
135
129
|
message_ins_ids_to_delete = {
|
136
|
-
UUID(msg_res.metadata.
|
130
|
+
UUID(msg_res.metadata.reply_to_message_id) for msg_res in message_res_list
|
137
131
|
}
|
138
132
|
# Delete
|
139
133
|
self.state.delete_messages(message_ins_ids=message_ins_ids_to_delete)
|
@@ -162,7 +156,7 @@ class InMemoryGrid(Grid):
|
|
162
156
|
res_msgs = self.pull_messages(msg_ids)
|
163
157
|
ret.extend(res_msgs)
|
164
158
|
msg_ids.difference_update(
|
165
|
-
{msg.metadata.
|
159
|
+
{msg.metadata.reply_to_message_id for msg in res_msgs}
|
166
160
|
)
|
167
161
|
if len(msg_ids) == 0:
|
168
162
|
break
|
@@ -21,9 +21,9 @@ from typing import Callable
|
|
21
21
|
from flwr.client.client_app import ClientApp
|
22
22
|
from flwr.common.context import Context
|
23
23
|
from flwr.common.message import Message
|
24
|
-
from flwr.common.typing import
|
24
|
+
from flwr.common.typing import ConfigRecordValues
|
25
25
|
|
26
|
-
BackendConfig = dict[str, dict[str,
|
26
|
+
BackendConfig = dict[str, dict[str, ConfigRecordValues]]
|
27
27
|
|
28
28
|
|
29
29
|
class Backend(ABC):
|
@@ -26,7 +26,7 @@ from flwr.common.constant import PARTITION_ID_KEY
|
|
26
26
|
from flwr.common.context import Context
|
27
27
|
from flwr.common.logger import log
|
28
28
|
from flwr.common.message import Message
|
29
|
-
from flwr.common.typing import
|
29
|
+
from flwr.common.typing import ConfigRecordValues
|
30
30
|
from flwr.simulation.ray_transport.ray_actor import BasicActorPool, ClientAppActor
|
31
31
|
from flwr.simulation.ray_transport.utils import enable_tf_gpu_growth
|
32
32
|
|
@@ -104,7 +104,7 @@ class RayBackend(Backend):
|
|
104
104
|
if not ray.is_initialized():
|
105
105
|
ray_init_args: dict[
|
106
106
|
str,
|
107
|
-
|
107
|
+
ConfigRecordValues,
|
108
108
|
] = {}
|
109
109
|
|
110
110
|
if backend_config.get(self.init_args_key):
|