flwr-nightly 1.7.0.dev20240103__tar.gz → 1.7.0.dev20240104__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/PKG-INFO +1 -1
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/pyproject.toml +1 -1
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/app.py +3 -5
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/grpc_client/connection.py +1 -1
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/message_handler/message_handler.py +1 -1
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/message_handler/task_handler.py +5 -5
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/node_state.py +10 -12
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/node_state_tests.py +7 -7
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/app.py +4 -4
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/driver.py +11 -11
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/driver_client_proxy.py +3 -5
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2.py +16 -16
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2.pyi +8 -8
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2.py +20 -20
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2.pyi +8 -8
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/driver/driver_servicer.py +3 -3
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/state/in_memory_state.py +15 -15
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/state/sqlite_state.py +23 -23
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/state/state.py +4 -4
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/ray_transport/ray_client_proxy.py +5 -5
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/LICENSE +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/README.md +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/client.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/dpfedavg_numpy_client.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/flower.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/grpc_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/grpc_rere_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/grpc_rere_client/connection.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/message_handler/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/middleware/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/middleware/utils.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/numpy_client.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/rest_client/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/rest_client/connection.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/secure_aggregation/handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/secure_aggregation/secaggplus_handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/typing.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/workload_state.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/address.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/constant.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/date.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/dp.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/logger.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/parameter.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/retry_invoker.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/crypto/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/crypto/shamir.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/crypto/symmetric_encryption.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/ndarrays_arithmetic.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/quantization.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/secaggplus_constants.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/secure_aggregation/secaggplus_utils.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/serde.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/telemetry.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/typing.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/common/version.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/grpc_driver.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/flower/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/fleet_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/fleet_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/fleet_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/fleet_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/node_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/node_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/node_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/node_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/transport_pb2.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/transport_pb2.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/transport_pb2_grpc.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/transport_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/py.typed +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/app.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/client_manager.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/client_proxy.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/criterion.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/driver/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/driver_client_manager.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/flower_service_servicer.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/grpc_bridge.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/grpc_client_proxy.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/grpc_server.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_bidi/ins_scheduler.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_rere/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/grpc_rere/fleet_servicer.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/message_handler/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/message_handler/message_handler.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/rest_rere/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/fleet/rest_rere/rest_api.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/history.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/server.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/state/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/state/state_factory.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/aggregate.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/bulyan.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/dpfedavg_adaptive.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/dpfedavg_fixed.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fault_tolerant_fedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedadagrad.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedadam.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedavg_android.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedavgm.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedmedian.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedopt.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedprox.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedtrimmedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedxgb_bagging.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedxgb_cyclic.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedxgb_nn_avg.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/fedyogi.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/krum.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/qfedavg.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/strategy/strategy.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/utils/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/utils/tensorboard.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/server/utils/validator.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/app.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/ray_transport/__init__.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/ray_transport/ray_actor.py +0 -0
- {flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/simulation/ray_transport/utils.py +0 -0
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
5
5
|
[tool.poetry]
|
6
6
|
name = "flwr-nightly"
|
7
|
-
version = "1.7.0-
|
7
|
+
version = "1.7.0-dev20240104"
|
8
8
|
description = "Flower: A Friendly Federated Learning Framework"
|
9
9
|
license = "Apache-2.0"
|
10
10
|
authors = ["The Flower Authors <hello@flower.dev>"]
|
@@ -349,7 +349,7 @@ def _start_client_internal(
|
|
349
349
|
break
|
350
350
|
|
351
351
|
# Register state
|
352
|
-
node_state.register_workloadstate(
|
352
|
+
node_state.register_workloadstate(run_id=task_ins.run_id)
|
353
353
|
|
354
354
|
# Load app
|
355
355
|
app: Flower = load_flower_callable_fn()
|
@@ -357,15 +357,13 @@ def _start_client_internal(
|
|
357
357
|
# Handle task message
|
358
358
|
fwd_msg: Fwd = Fwd(
|
359
359
|
task_ins=task_ins,
|
360
|
-
state=node_state.retrieve_workloadstate(
|
361
|
-
workload_id=task_ins.workload_id
|
362
|
-
),
|
360
|
+
state=node_state.retrieve_workloadstate(run_id=task_ins.run_id),
|
363
361
|
)
|
364
362
|
bwd_msg: Bwd = app(fwd=fwd_msg)
|
365
363
|
|
366
364
|
# Update node state
|
367
365
|
node_state.update_workloadstate(
|
368
|
-
|
366
|
+
run_id=bwd_msg.task_res.run_id,
|
369
367
|
workload_state=bwd_msg.state,
|
370
368
|
)
|
371
369
|
|
@@ -70,7 +70,7 @@ def validate_task_res(task_res: TaskRes) -> bool:
|
|
70
70
|
Returns
|
71
71
|
-------
|
72
72
|
is_valid: bool
|
73
|
-
True if the `task_id`, `group_id`, and `
|
73
|
+
True if the `task_id`, `group_id`, and `run_id` fields in TaskRes
|
74
74
|
and the `producer`, `consumer`, and `ancestry` fields in its sub-message Task
|
75
75
|
are not initialized accidentally elsewhere,
|
76
76
|
False otherwise.
|
@@ -84,7 +84,7 @@ def validate_task_res(task_res: TaskRes) -> bool:
|
|
84
84
|
if (
|
85
85
|
"task_id" in initialized_fields_in_task_res
|
86
86
|
or "group_id" in initialized_fields_in_task_res
|
87
|
-
or "
|
87
|
+
or "run_id" in initialized_fields_in_task_res
|
88
88
|
or "producer" in initialized_fields_in_task
|
89
89
|
or "consumer" in initialized_fields_in_task
|
90
90
|
or "ancestry" in initialized_fields_in_task
|
@@ -129,7 +129,7 @@ def wrap_client_message_in_task_res(client_message: ClientMessage) -> TaskRes:
|
|
129
129
|
return TaskRes(
|
130
130
|
task_id="",
|
131
131
|
group_id="",
|
132
|
-
|
132
|
+
run_id=0,
|
133
133
|
task=Task(ancestry=[], legacy_client_message=client_message),
|
134
134
|
)
|
135
135
|
|
@@ -139,7 +139,7 @@ def configure_task_res(
|
|
139
139
|
) -> TaskRes:
|
140
140
|
"""Set the metadata of a TaskRes.
|
141
141
|
|
142
|
-
Fill `group_id` and `
|
142
|
+
Fill `group_id` and `run_id` in TaskRes
|
143
143
|
and `producer`, `consumer`, and `ancestry` in Task in TaskRes.
|
144
144
|
|
145
145
|
`producer` in Task in TaskRes will remain unchanged/unset.
|
@@ -152,7 +152,7 @@ def configure_task_res(
|
|
152
152
|
task_res = TaskRes(
|
153
153
|
task_id="", # This will be generated by the server
|
154
154
|
group_id=ref_task_ins.group_id,
|
155
|
-
|
155
|
+
run_id=ref_task_ins.run_id,
|
156
156
|
task=task_res.task,
|
157
157
|
)
|
158
158
|
# pylint: disable-next=no-member
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/client/node_state.py
RENAMED
@@ -27,24 +27,22 @@ class NodeState:
|
|
27
27
|
self._meta: Dict[str, Any] = {} # holds metadata about the node
|
28
28
|
self.workload_states: Dict[int, WorkloadState] = {}
|
29
29
|
|
30
|
-
def register_workloadstate(self,
|
30
|
+
def register_workloadstate(self, run_id: int) -> None:
|
31
31
|
"""Register new workload state for this node."""
|
32
|
-
if
|
33
|
-
self.workload_states[
|
32
|
+
if run_id not in self.workload_states:
|
33
|
+
self.workload_states[run_id] = WorkloadState({})
|
34
34
|
|
35
|
-
def retrieve_workloadstate(self,
|
36
|
-
"""Get workload state given a
|
37
|
-
if
|
38
|
-
return self.workload_states[
|
35
|
+
def retrieve_workloadstate(self, run_id: int) -> WorkloadState:
|
36
|
+
"""Get workload state given a run_id."""
|
37
|
+
if run_id in self.workload_states:
|
38
|
+
return self.workload_states[run_id]
|
39
39
|
|
40
40
|
raise RuntimeError(
|
41
|
-
f"WorkloadState for
|
41
|
+
f"WorkloadState for run_id={run_id} doesn't exist."
|
42
42
|
" A workload must be registered before it can be retrieved or updated "
|
43
43
|
" by a client."
|
44
44
|
)
|
45
45
|
|
46
|
-
def update_workloadstate(
|
47
|
-
self, workload_id: int, workload_state: WorkloadState
|
48
|
-
) -> None:
|
46
|
+
def update_workloadstate(self, run_id: int, workload_state: WorkloadState) -> None:
|
49
47
|
"""Update workload state."""
|
50
|
-
self.workload_states[
|
48
|
+
self.workload_states[run_id] = workload_state
|
@@ -32,7 +32,7 @@ def _run_dummy_task(state: WorkloadState) -> WorkloadState:
|
|
32
32
|
def test_multiworkload_in_node_state() -> None:
|
33
33
|
"""Test basic NodeState logic."""
|
34
34
|
# Tasks to perform
|
35
|
-
tasks = [TaskIns(
|
35
|
+
tasks = [TaskIns(run_id=r_id) for r_id in [0, 1, 1, 2, 3, 2, 1, 5]]
|
36
36
|
# the "tasks" is to count how many times each workload is executed
|
37
37
|
expected_values = {0: "1", 1: "1" * 3, 2: "1" * 2, 3: "1", 5: "1"}
|
38
38
|
|
@@ -40,20 +40,20 @@ def test_multiworkload_in_node_state() -> None:
|
|
40
40
|
node_state = NodeState()
|
41
41
|
|
42
42
|
for task in tasks:
|
43
|
-
|
43
|
+
r_id = task.run_id
|
44
44
|
|
45
45
|
# Register
|
46
|
-
node_state.register_workloadstate(
|
46
|
+
node_state.register_workloadstate(run_id=r_id)
|
47
47
|
|
48
48
|
# Get workload state
|
49
|
-
state = node_state.retrieve_workloadstate(
|
49
|
+
state = node_state.retrieve_workloadstate(run_id=r_id)
|
50
50
|
|
51
51
|
# Run "task"
|
52
52
|
updated_state = _run_dummy_task(state)
|
53
53
|
|
54
54
|
# Update workload state
|
55
|
-
node_state.update_workloadstate(
|
55
|
+
node_state.update_workloadstate(run_id=r_id, workload_state=updated_state)
|
56
56
|
|
57
57
|
# Verify values
|
58
|
-
for
|
59
|
-
assert state.state["counter"] == expected_values[
|
58
|
+
for r_id, state in node_state.workload_states.items():
|
59
|
+
assert state.state["counter"] == expected_values[r_id]
|
@@ -170,8 +170,8 @@ def update_client_manager(
|
|
170
170
|
and dead nodes will be removed from the ClientManager via
|
171
171
|
`client_manager.unregister()`.
|
172
172
|
"""
|
173
|
-
# Request for
|
174
|
-
|
173
|
+
# Request for run_id
|
174
|
+
run_id = driver.create_workload(driver_pb2.CreateWorkloadRequest()).run_id
|
175
175
|
|
176
176
|
# Loop until the driver is disconnected
|
177
177
|
registered_nodes: Dict[int, DriverClientProxy] = {}
|
@@ -181,7 +181,7 @@ def update_client_manager(
|
|
181
181
|
if driver.stub is None:
|
182
182
|
break
|
183
183
|
get_nodes_res = driver.get_nodes(
|
184
|
-
req=driver_pb2.GetNodesRequest(
|
184
|
+
req=driver_pb2.GetNodesRequest(run_id=run_id)
|
185
185
|
)
|
186
186
|
all_node_ids = {node.node_id for node in get_nodes_res.nodes}
|
187
187
|
dead_nodes = set(registered_nodes).difference(all_node_ids)
|
@@ -199,7 +199,7 @@ def update_client_manager(
|
|
199
199
|
node_id=node_id,
|
200
200
|
driver=driver,
|
201
201
|
anonymous=False,
|
202
|
-
|
202
|
+
run_id=run_id,
|
203
203
|
)
|
204
204
|
if client_manager.register(client_proxy):
|
205
205
|
registered_nodes[node_id] = client_proxy
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/driver/driver.py
RENAMED
@@ -54,37 +54,37 @@ class Driver:
|
|
54
54
|
self.addr = driver_service_address
|
55
55
|
self.certificates = certificates
|
56
56
|
self.grpc_driver: Optional[GrpcDriver] = None
|
57
|
-
self.
|
57
|
+
self.run_id: Optional[int] = None
|
58
58
|
self.node = Node(node_id=0, anonymous=True)
|
59
59
|
|
60
|
-
def
|
60
|
+
def _get_grpc_driver_and_run_id(self) -> Tuple[GrpcDriver, int]:
|
61
61
|
# Check if the GrpcDriver is initialized
|
62
|
-
if self.grpc_driver is None or self.
|
62
|
+
if self.grpc_driver is None or self.run_id is None:
|
63
63
|
# Connect and create workload
|
64
64
|
self.grpc_driver = GrpcDriver(
|
65
65
|
driver_service_address=self.addr, certificates=self.certificates
|
66
66
|
)
|
67
67
|
self.grpc_driver.connect()
|
68
68
|
res = self.grpc_driver.create_workload(CreateWorkloadRequest())
|
69
|
-
self.
|
69
|
+
self.run_id = res.run_id
|
70
70
|
|
71
|
-
return self.grpc_driver, self.
|
71
|
+
return self.grpc_driver, self.run_id
|
72
72
|
|
73
73
|
def get_nodes(self) -> List[Node]:
|
74
74
|
"""Get node IDs."""
|
75
|
-
grpc_driver,
|
75
|
+
grpc_driver, run_id = self._get_grpc_driver_and_run_id()
|
76
76
|
|
77
77
|
# Call GrpcDriver method
|
78
|
-
res = grpc_driver.get_nodes(GetNodesRequest(
|
78
|
+
res = grpc_driver.get_nodes(GetNodesRequest(run_id=run_id))
|
79
79
|
return list(res.nodes)
|
80
80
|
|
81
81
|
def push_task_ins(self, task_ins_list: List[TaskIns]) -> List[str]:
|
82
82
|
"""Schedule tasks."""
|
83
|
-
grpc_driver,
|
83
|
+
grpc_driver, run_id = self._get_grpc_driver_and_run_id()
|
84
84
|
|
85
|
-
# Set
|
85
|
+
# Set run_id
|
86
86
|
for task_ins in task_ins_list:
|
87
|
-
task_ins.
|
87
|
+
task_ins.run_id = run_id
|
88
88
|
|
89
89
|
# Call GrpcDriver method
|
90
90
|
res = grpc_driver.push_task_ins(PushTaskInsRequest(task_ins_list=task_ins_list))
|
@@ -92,7 +92,7 @@ class Driver:
|
|
92
92
|
|
93
93
|
def pull_task_res(self, task_ids: Iterable[str]) -> List[TaskRes]:
|
94
94
|
"""Get task results."""
|
95
|
-
grpc_driver, _ = self.
|
95
|
+
grpc_driver, _ = self._get_grpc_driver_and_run_id()
|
96
96
|
|
97
97
|
# Call GrpcDriver method
|
98
98
|
res = grpc_driver.pull_task_res(
|
@@ -31,13 +31,11 @@ SLEEP_TIME = 1
|
|
31
31
|
class DriverClientProxy(ClientProxy):
|
32
32
|
"""Flower client proxy which delegates work using the Driver API."""
|
33
33
|
|
34
|
-
def __init__(
|
35
|
-
self, node_id: int, driver: GrpcDriver, anonymous: bool, workload_id: int
|
36
|
-
):
|
34
|
+
def __init__(self, node_id: int, driver: GrpcDriver, anonymous: bool, run_id: int):
|
37
35
|
super().__init__(str(node_id))
|
38
36
|
self.node_id = node_id
|
39
37
|
self.driver = driver
|
40
|
-
self.
|
38
|
+
self.run_id = run_id
|
41
39
|
self.anonymous = anonymous
|
42
40
|
|
43
41
|
def get_properties(
|
@@ -106,7 +104,7 @@ class DriverClientProxy(ClientProxy):
|
|
106
104
|
task_ins = task_pb2.TaskIns(
|
107
105
|
task_id="",
|
108
106
|
group_id="",
|
109
|
-
|
107
|
+
run_id=self.run_id,
|
110
108
|
task=task_pb2.Task(
|
111
109
|
producer=node_pb2.Node(
|
112
110
|
node_id=0,
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2.py
RENAMED
@@ -16,7 +16,7 @@ from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
|
|
16
16
|
from flwr.proto import task_pb2 as flwr_dot_proto_dot_task__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x66lwr/proto/driver.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x15\x66lwr/proto/task.proto\"\x17\n\x15\x43reateWorkloadRequest\"
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x66lwr/proto/driver.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x15\x66lwr/proto/task.proto\"\x17\n\x15\x43reateWorkloadRequest\"(\n\x16\x43reateWorkloadResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\x12\"!\n\x0fGetNodesRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x12\"3\n\x10GetNodesResponse\x12\x1f\n\x05nodes\x18\x01 \x03(\x0b\x32\x10.flwr.proto.Node\"@\n\x12PushTaskInsRequest\x12*\n\rtask_ins_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskIns\"\'\n\x13PushTaskInsResponse\x12\x10\n\x08task_ids\x18\x02 \x03(\t\"F\n\x12PullTaskResRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x10\n\x08task_ids\x18\x02 \x03(\t\"A\n\x13PullTaskResResponse\x12*\n\rtask_res_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskRes2\xd0\x02\n\x06\x44river\x12Y\n\x0e\x43reateWorkload\x12!.flwr.proto.CreateWorkloadRequest\x1a\".flwr.proto.CreateWorkloadResponse\"\x00\x12G\n\x08GetNodes\x12\x1b.flwr.proto.GetNodesRequest\x1a\x1c.flwr.proto.GetNodesResponse\"\x00\x12P\n\x0bPushTaskIns\x12\x1e.flwr.proto.PushTaskInsRequest\x1a\x1f.flwr.proto.PushTaskInsResponse\"\x00\x12P\n\x0bPullTaskRes\x12\x1e.flwr.proto.PullTaskResRequest\x1a\x1f.flwr.proto.PullTaskResResponse\"\x00\x62\x06proto3')
|
20
20
|
|
21
21
|
|
22
22
|
|
@@ -91,19 +91,19 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
91
91
|
_CREATEWORKLOADREQUEST._serialized_start=85
|
92
92
|
_CREATEWORKLOADREQUEST._serialized_end=108
|
93
93
|
_CREATEWORKLOADRESPONSE._serialized_start=110
|
94
|
-
_CREATEWORKLOADRESPONSE._serialized_end=
|
95
|
-
_GETNODESREQUEST._serialized_start=
|
96
|
-
_GETNODESREQUEST._serialized_end=
|
97
|
-
_GETNODESRESPONSE._serialized_start=
|
98
|
-
_GETNODESRESPONSE._serialized_end=
|
99
|
-
_PUSHTASKINSREQUEST._serialized_start=
|
100
|
-
_PUSHTASKINSREQUEST._serialized_end=
|
101
|
-
_PUSHTASKINSRESPONSE._serialized_start=
|
102
|
-
_PUSHTASKINSRESPONSE._serialized_end=
|
103
|
-
_PULLTASKRESREQUEST._serialized_start=
|
104
|
-
_PULLTASKRESREQUEST._serialized_end=
|
105
|
-
_PULLTASKRESRESPONSE._serialized_start=
|
106
|
-
_PULLTASKRESRESPONSE._serialized_end=
|
107
|
-
_DRIVER._serialized_start=
|
108
|
-
_DRIVER._serialized_end=
|
94
|
+
_CREATEWORKLOADRESPONSE._serialized_end=150
|
95
|
+
_GETNODESREQUEST._serialized_start=152
|
96
|
+
_GETNODESREQUEST._serialized_end=185
|
97
|
+
_GETNODESRESPONSE._serialized_start=187
|
98
|
+
_GETNODESRESPONSE._serialized_end=238
|
99
|
+
_PUSHTASKINSREQUEST._serialized_start=240
|
100
|
+
_PUSHTASKINSREQUEST._serialized_end=304
|
101
|
+
_PUSHTASKINSRESPONSE._serialized_start=306
|
102
|
+
_PUSHTASKINSRESPONSE._serialized_end=345
|
103
|
+
_PULLTASKRESREQUEST._serialized_start=347
|
104
|
+
_PULLTASKRESREQUEST._serialized_end=417
|
105
|
+
_PULLTASKRESRESPONSE._serialized_start=419
|
106
|
+
_PULLTASKRESRESPONSE._serialized_end=484
|
107
|
+
_DRIVER._serialized_start=487
|
108
|
+
_DRIVER._serialized_end=823
|
109
109
|
# @@protoc_insertion_point(module_scope)
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/driver_pb2.pyi
RENAMED
@@ -22,25 +22,25 @@ global___CreateWorkloadRequest = CreateWorkloadRequest
|
|
22
22
|
|
23
23
|
class CreateWorkloadResponse(google.protobuf.message.Message):
|
24
24
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
25
|
-
|
26
|
-
|
25
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
26
|
+
run_id: builtins.int
|
27
27
|
def __init__(self,
|
28
28
|
*,
|
29
|
-
|
29
|
+
run_id: builtins.int = ...,
|
30
30
|
) -> None: ...
|
31
|
-
def ClearField(self, field_name: typing_extensions.Literal["
|
31
|
+
def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id"]) -> None: ...
|
32
32
|
global___CreateWorkloadResponse = CreateWorkloadResponse
|
33
33
|
|
34
34
|
class GetNodesRequest(google.protobuf.message.Message):
|
35
35
|
"""GetNodes messages"""
|
36
36
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
37
|
-
|
38
|
-
|
37
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
38
|
+
run_id: builtins.int
|
39
39
|
def __init__(self,
|
40
40
|
*,
|
41
|
-
|
41
|
+
run_id: builtins.int = ...,
|
42
42
|
) -> None: ...
|
43
|
-
def ClearField(self, field_name: typing_extensions.Literal["
|
43
|
+
def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id"]) -> None: ...
|
44
44
|
global___GetNodesRequest = GetNodesRequest
|
45
45
|
|
46
46
|
class GetNodesResponse(google.protobuf.message.Message):
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2.py
RENAMED
@@ -16,7 +16,7 @@ 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\"\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\"
|
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\"\\\n\x07TaskIns\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x12\x12\x1e\n\x04task\x18\x04 \x01(\x0b\x32\x10.flwr.proto.Task\"\\\n\x07TaskRes\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x12\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
|
|
@@ -126,23 +126,23 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
126
126
|
_TASK._serialized_start=89
|
127
127
|
_TASK._serialized_end=407
|
128
128
|
_TASKINS._serialized_start=409
|
129
|
-
_TASKINS._serialized_end=
|
130
|
-
_TASKRES._serialized_start=
|
131
|
-
_TASKRES._serialized_end=
|
132
|
-
_VALUE._serialized_start=
|
133
|
-
_VALUE._serialized_end=
|
134
|
-
_VALUE_DOUBLELIST._serialized_start=
|
135
|
-
_VALUE_DOUBLELIST._serialized_end=
|
136
|
-
_VALUE_SINT64LIST._serialized_start=
|
137
|
-
_VALUE_SINT64LIST._serialized_end=
|
138
|
-
_VALUE_BOOLLIST._serialized_start=
|
139
|
-
_VALUE_BOOLLIST._serialized_end=
|
140
|
-
_VALUE_STRINGLIST._serialized_start=
|
141
|
-
_VALUE_STRINGLIST._serialized_end=
|
142
|
-
_VALUE_BYTESLIST._serialized_start=
|
143
|
-
_VALUE_BYTESLIST._serialized_end=
|
144
|
-
_SECUREAGGREGATION._serialized_start=
|
145
|
-
_SECUREAGGREGATION._serialized_end=
|
146
|
-
_SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_start=
|
147
|
-
_SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_end=
|
129
|
+
_TASKINS._serialized_end=501
|
130
|
+
_TASKRES._serialized_start=503
|
131
|
+
_TASKRES._serialized_end=595
|
132
|
+
_VALUE._serialized_start=598
|
133
|
+
_VALUE._serialized_end=1097
|
134
|
+
_VALUE_DOUBLELIST._serialized_start=953
|
135
|
+
_VALUE_DOUBLELIST._serialized_end=979
|
136
|
+
_VALUE_SINT64LIST._serialized_start=981
|
137
|
+
_VALUE_SINT64LIST._serialized_end=1007
|
138
|
+
_VALUE_BOOLLIST._serialized_start=1009
|
139
|
+
_VALUE_BOOLLIST._serialized_end=1033
|
140
|
+
_VALUE_STRINGLIST._serialized_start=1035
|
141
|
+
_VALUE_STRINGLIST._serialized_end=1061
|
142
|
+
_VALUE_BYTESLIST._serialized_start=1063
|
143
|
+
_VALUE_BYTESLIST._serialized_end=1088
|
144
|
+
_SECUREAGGREGATION._serialized_start=1100
|
145
|
+
_SECUREAGGREGATION._serialized_end=1260
|
146
|
+
_SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_start=1191
|
147
|
+
_SECUREAGGREGATION_NAMEDVALUESENTRY._serialized_end=1260
|
148
148
|
# @@protoc_insertion_point(module_scope)
|
{flwr_nightly-1.7.0.dev20240103 → flwr_nightly-1.7.0.dev20240104}/src/py/flwr/proto/task_pb2.pyi
RENAMED
@@ -59,44 +59,44 @@ class TaskIns(google.protobuf.message.Message):
|
|
59
59
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
60
60
|
TASK_ID_FIELD_NUMBER: builtins.int
|
61
61
|
GROUP_ID_FIELD_NUMBER: builtins.int
|
62
|
-
|
62
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
63
63
|
TASK_FIELD_NUMBER: builtins.int
|
64
64
|
task_id: typing.Text
|
65
65
|
group_id: typing.Text
|
66
|
-
|
66
|
+
run_id: builtins.int
|
67
67
|
@property
|
68
68
|
def task(self) -> global___Task: ...
|
69
69
|
def __init__(self,
|
70
70
|
*,
|
71
71
|
task_id: typing.Text = ...,
|
72
72
|
group_id: typing.Text = ...,
|
73
|
-
|
73
|
+
run_id: builtins.int = ...,
|
74
74
|
task: typing.Optional[global___Task] = ...,
|
75
75
|
) -> None: ...
|
76
76
|
def HasField(self, field_name: typing_extensions.Literal["task",b"task"]) -> builtins.bool: ...
|
77
|
-
def ClearField(self, field_name: typing_extensions.Literal["group_id",b"group_id","
|
77
|
+
def ClearField(self, field_name: typing_extensions.Literal["group_id",b"group_id","run_id",b"run_id","task",b"task","task_id",b"task_id"]) -> None: ...
|
78
78
|
global___TaskIns = TaskIns
|
79
79
|
|
80
80
|
class TaskRes(google.protobuf.message.Message):
|
81
81
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
82
82
|
TASK_ID_FIELD_NUMBER: builtins.int
|
83
83
|
GROUP_ID_FIELD_NUMBER: builtins.int
|
84
|
-
|
84
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
85
85
|
TASK_FIELD_NUMBER: builtins.int
|
86
86
|
task_id: typing.Text
|
87
87
|
group_id: typing.Text
|
88
|
-
|
88
|
+
run_id: builtins.int
|
89
89
|
@property
|
90
90
|
def task(self) -> global___Task: ...
|
91
91
|
def __init__(self,
|
92
92
|
*,
|
93
93
|
task_id: typing.Text = ...,
|
94
94
|
group_id: typing.Text = ...,
|
95
|
-
|
95
|
+
run_id: builtins.int = ...,
|
96
96
|
task: typing.Optional[global___Task] = ...,
|
97
97
|
) -> None: ...
|
98
98
|
def HasField(self, field_name: typing_extensions.Literal["task",b"task"]) -> builtins.bool: ...
|
99
|
-
def ClearField(self, field_name: typing_extensions.Literal["group_id",b"group_id","
|
99
|
+
def ClearField(self, field_name: typing_extensions.Literal["group_id",b"group_id","run_id",b"run_id","task",b"task","task_id",b"task_id"]) -> None: ...
|
100
100
|
global___TaskRes = TaskRes
|
101
101
|
|
102
102
|
class Value(google.protobuf.message.Message):
|
@@ -51,7 +51,7 @@ class DriverServicer(driver_pb2_grpc.DriverServicer):
|
|
51
51
|
"""Get available nodes."""
|
52
52
|
log(INFO, "DriverServicer.GetNodes")
|
53
53
|
state: State = self.state_factory.state()
|
54
|
-
all_ids: Set[int] = state.get_nodes(request.
|
54
|
+
all_ids: Set[int] = state.get_nodes(request.run_id)
|
55
55
|
nodes: List[Node] = [
|
56
56
|
Node(node_id=node_id, anonymous=False) for node_id in all_ids
|
57
57
|
]
|
@@ -63,8 +63,8 @@ class DriverServicer(driver_pb2_grpc.DriverServicer):
|
|
63
63
|
"""Create workload ID."""
|
64
64
|
log(INFO, "DriverServicer.CreateWorkload")
|
65
65
|
state: State = self.state_factory.state()
|
66
|
-
|
67
|
-
return CreateWorkloadResponse(
|
66
|
+
run_id = state.create_workload()
|
67
|
+
return CreateWorkloadResponse(run_id=run_id)
|
68
68
|
|
69
69
|
def PushTaskIns(
|
70
70
|
self, request: PushTaskInsRequest, context: grpc.ServicerContext
|
@@ -32,7 +32,7 @@ class InMemoryState(State):
|
|
32
32
|
|
33
33
|
def __init__(self) -> None:
|
34
34
|
self.node_ids: Set[int] = set()
|
35
|
-
self.
|
35
|
+
self.run_ids: Set[int] = set()
|
36
36
|
self.task_ins_store: Dict[UUID, TaskIns] = {}
|
37
37
|
self.task_res_store: Dict[UUID, TaskRes] = {}
|
38
38
|
|
@@ -43,9 +43,9 @@ class InMemoryState(State):
|
|
43
43
|
if any(errors):
|
44
44
|
log(ERROR, errors)
|
45
45
|
return None
|
46
|
-
# Validate
|
47
|
-
if task_ins.
|
48
|
-
log(ERROR, "`
|
46
|
+
# Validate run_id
|
47
|
+
if task_ins.run_id not in self.run_ids:
|
48
|
+
log(ERROR, "`run_id` is invalid")
|
49
49
|
return None
|
50
50
|
|
51
51
|
# Create task_id, created_at and ttl
|
@@ -104,9 +104,9 @@ class InMemoryState(State):
|
|
104
104
|
log(ERROR, errors)
|
105
105
|
return None
|
106
106
|
|
107
|
-
# Validate
|
108
|
-
if task_res.
|
109
|
-
log(ERROR, "`
|
107
|
+
# Validate run_id
|
108
|
+
if task_res.run_id not in self.run_ids:
|
109
|
+
log(ERROR, "`run_id` is invalid")
|
110
110
|
return None
|
111
111
|
|
112
112
|
# Create task_id, created_at and ttl
|
@@ -199,25 +199,25 @@ class InMemoryState(State):
|
|
199
199
|
raise ValueError(f"Node {node_id} not found")
|
200
200
|
self.node_ids.remove(node_id)
|
201
201
|
|
202
|
-
def get_nodes(self,
|
202
|
+
def get_nodes(self, run_id: int) -> Set[int]:
|
203
203
|
"""Return all available client nodes.
|
204
204
|
|
205
205
|
Constraints
|
206
206
|
-----------
|
207
|
-
If the provided `
|
207
|
+
If the provided `run_id` does not exist or has no matching nodes,
|
208
208
|
an empty `Set` MUST be returned.
|
209
209
|
"""
|
210
|
-
if
|
210
|
+
if run_id not in self.run_ids:
|
211
211
|
return set()
|
212
212
|
return self.node_ids
|
213
213
|
|
214
214
|
def create_workload(self) -> int:
|
215
215
|
"""Create one workload."""
|
216
|
-
# Sample a random int64 as
|
217
|
-
|
216
|
+
# Sample a random int64 as run_id
|
217
|
+
run_id: int = int.from_bytes(os.urandom(8), "little", signed=True)
|
218
218
|
|
219
|
-
if
|
220
|
-
self.
|
221
|
-
return
|
219
|
+
if run_id not in self.run_ids:
|
220
|
+
self.run_ids.add(run_id)
|
221
|
+
return run_id
|
222
222
|
log(ERROR, "Unexpected workload creation failure.")
|
223
223
|
return 0
|