flwr-nightly 1.6.0.dev20231026__tar.gz → 1.6.0.dev20231101__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/PKG-INFO +50 -51
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/README.md +49 -50
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/pyproject.toml +1 -1
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/app.py +57 -34
- flwr_nightly-1.6.0.dev20231101/src/py/flwr/common/retry_invoker.py +288 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/LICENSE +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/client.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/dpfedavg_numpy_client.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/grpc_client/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/grpc_client/connection.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/grpc_rere_client/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/grpc_rere_client/connection.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/message_handler/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/message_handler/message_handler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/message_handler/task_handler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/numpy_client.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/rest_client/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/rest_client/connection.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/run.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/secure_aggregation/handler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/secure_aggregation/secaggplus_handler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/client/typing.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/address.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/constant.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/date.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/dp.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/logger.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/parameter.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/crypto/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/crypto/shamir.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/crypto/symmetric_encryption.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/ndarrays_arithmetic.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/quantization.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/secaggplus_constants.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/secure_aggregation/secaggplus_utils.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/serde.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/telemetry.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/typing.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/common/version.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/driver/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/driver/app.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/driver/driver.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/driver/driver_client_proxy.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/driver/grpc_driver.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/driver_pb2.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/driver_pb2.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/driver_pb2_grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/driver_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/fleet_pb2.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/fleet_pb2.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/fleet_pb2_grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/fleet_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/node_pb2.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/node_pb2.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/node_pb2_grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/node_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/task_pb2.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/task_pb2.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/task_pb2_grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/task_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/transport_pb2.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/transport_pb2.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/transport_pb2_grpc.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/proto/transport_pb2_grpc.pyi +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/py.typed +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/app.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/client_manager.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/client_proxy.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/criterion.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/driver/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/driver/driver_servicer.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/driver_client_manager.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/flower_service_servicer.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/grpc_bridge.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/grpc_client_proxy.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/grpc_server.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_bidi/ins_scheduler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_rere/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/grpc_rere/fleet_servicer.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/message_handler/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/message_handler/message_handler.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/rest_rere/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/fleet/rest_rere/rest_api.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/history.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/server.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/state/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/state/in_memory_state.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/state/sqlite_state.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/state/state.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/state/state_factory.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/aggregate.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/dpfedavg_adaptive.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/dpfedavg_fixed.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fault_tolerant_fedavg.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedadagrad.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedadam.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedavg.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedavg_android.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedavgm.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedmedian.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedopt.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedprox.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedtrimmedavg.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedxgb_nn_avg.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/fedyogi.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/krum.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/qfedavg.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/strategy/strategy.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/utils/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/utils/tensorboard.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/server/utils/validator.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/app.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/ray_transport/__init__.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/ray_transport/ray_actor.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/ray_transport/ray_client_proxy.py +0 -0
- {flwr_nightly-1.6.0.dev20231026 → flwr_nightly-1.6.0.dev20231101}/src/py/flwr/simulation/ray_transport/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: flwr-nightly
|
3
|
-
Version: 1.6.0.
|
3
|
+
Version: 1.6.0.dev20231101
|
4
4
|
Summary: Flower: A Friendly Federated Learning Framework
|
5
5
|
Home-page: https://flower.dev
|
6
6
|
License: Apache-2.0
|
@@ -71,22 +71,21 @@ Description-Content-Type: text/markdown
|
|
71
71
|
Flower (`flwr`) is a framework for building federated learning systems. The
|
72
72
|
design of Flower is based on a few guiding principles:
|
73
73
|
|
74
|
-
|
74
|
+
- **Customizable**: Federated learning systems vary wildly from one use case to
|
75
75
|
another. Flower allows for a wide range of different configurations depending
|
76
76
|
on the needs of each individual use case.
|
77
77
|
|
78
|
-
|
78
|
+
- **Extendable**: Flower originated from a research project at the University of
|
79
79
|
Oxford, so it was built with AI research in mind. Many components can be
|
80
80
|
extended and overridden to build new state-of-the-art systems.
|
81
81
|
|
82
|
-
|
82
|
+
- **Framework-agnostic**: Different machine learning frameworks have different
|
83
83
|
strengths. Flower can be used with any machine learning framework, for
|
84
84
|
example, [PyTorch](https://pytorch.org),
|
85
|
-
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [MXNet](https://mxnet.apache.org/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/
|
86
|
-
) for federated analytics, or even raw [NumPy](https://numpy.org/)
|
85
|
+
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [MXNet](https://mxnet.apache.org/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/) for federated analytics, or even raw [NumPy](https://numpy.org/)
|
87
86
|
for users who enjoy computing gradients by hand.
|
88
87
|
|
89
|
-
|
88
|
+
- **Understandable**: Flower is written with maintainability in mind. The
|
90
89
|
community is encouraged to both read and contribute to the codebase.
|
91
90
|
|
92
91
|
Meet the Flower community on [flower.dev](https://flower.dev)!
|
@@ -106,11 +105,11 @@ Flower's goal is to make federated learning accessible to everyone. This series
|
|
106
105
|
2. **Using Strategies in Federated Learning**
|
107
106
|
|
108
107
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-use-a-federated-learning-strategy-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-use-a-federated-learning-strategy-pytorch.ipynb))
|
109
|
-
|
108
|
+
|
110
109
|
3. **Building Strategies for Federated Learning**
|
111
110
|
|
112
111
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-series-use-a-federated-learning-strategy-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-series-use-a-federated-learning-strategy-pytorch.ipynb))
|
113
|
-
|
112
|
+
|
114
113
|
4. **Custom Clients for Federated Learning**
|
115
114
|
|
116
115
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-series-customize-the-client-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-series-customize-the-client-pytorch.ipynb))
|
@@ -121,39 +120,39 @@ Stay tuned, more tutorials are coming soon. Topics include **Privacy and Securit
|
|
121
120
|
|
122
121
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/examples/flower-in-30-minutes/tutorial.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/examples/flower-in-30-minutes/tutorial.ipynb))
|
123
122
|
|
124
|
-
|
125
123
|
## Documentation
|
126
124
|
|
127
125
|
[Flower Docs](https://flower.dev/docs):
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
126
|
+
|
127
|
+
- [Installation](https://flower.dev/docs/framework/how-to-install-flower.html)
|
128
|
+
- [Quickstart (TensorFlow)](https://flower.dev/docs/framework/tutorial-quickstart-tensorflow.html)
|
129
|
+
- [Quickstart (PyTorch)](https://flower.dev/docs/framework/tutorial-quickstart-pytorch.html)
|
130
|
+
- [Quickstart (Hugging Face)](https://flower.dev/docs/framework/tutorial-quickstart-huggingface.html)
|
131
|
+
- [Quickstart (PyTorch Lightning [code example])](https://flower.dev/docs/framework/tutorial-quickstart-pytorch-lightning.html)
|
132
|
+
- [Quickstart (MXNet)](https://flower.dev/docs/framework/example-mxnet-walk-through.html)
|
133
|
+
- [Quickstart (Pandas)](https://flower.dev/docs/framework/tutorial-quickstart-pandas.html)
|
134
|
+
- [Quickstart (fastai)](https://flower.dev/docs/framework/tutorial-quickstart-fastai.html)
|
135
|
+
- [Quickstart (JAX)](https://flower.dev/docs/framework/tutorial-quickstart-jax.html)
|
136
|
+
- [Quickstart (scikit-learn)](https://flower.dev/docs/framework/tutorial-quickstart-scikitlearn.html)
|
137
|
+
- [Quickstart (Android [TFLite])](https://flower.dev/docs/framework/tutorial-quickstart-android.html)
|
138
|
+
- [Quickstart (iOS [CoreML])](https://flower.dev/docs/framework/tutorial-quickstart-ios.html)
|
140
139
|
|
141
140
|
## Flower Baselines
|
142
141
|
|
143
142
|
Flower Baselines is a collection of community-contributed experiments that reproduce the experiments performed in popular federated learning publications. Researchers can build on Flower Baselines to quickly evaluate new ideas:
|
144
143
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
144
|
+
- [FedAvg](https://arxiv.org/abs/1602.05629):
|
145
|
+
- [MNIST](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/fedavg_mnist)
|
146
|
+
- [FedProx](https://arxiv.org/abs/1812.06127):
|
147
|
+
- [MNIST](https://github.com/adap/flower/tree/main/baselines/fedprox/)
|
148
|
+
- [FedBN: Federated Learning on non-IID Features via Local Batch Normalization](https://arxiv.org/abs/2102.07623):
|
149
|
+
- [Convergence Rate](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/fedbn/convergence_rate)
|
150
|
+
- [Adaptive Federated Optimization](https://arxiv.org/abs/2003.00295):
|
151
|
+
- [CIFAR-10/100](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/adaptive_federated_optimization)
|
153
152
|
|
154
|
-
Check the Flower documentation to learn more: [Using Baselines](https://flower.dev/docs/baselines/
|
153
|
+
Check the Flower documentation to learn more: [Using Baselines](https://flower.dev/docs/baselines/how-to-use-baselines.html)
|
155
154
|
|
156
|
-
The Flower community loves contributions! Make your work more visible and enable others to build on it by contributing it as a baseline: [Contributing Baselines](https://flower.dev/docs/baselines/
|
155
|
+
The Flower community loves contributions! Make your work more visible and enable others to build on it by contributing it as a baseline: [Contributing Baselines](https://flower.dev/docs/baselines/how-to-contribute-baselines.html)
|
157
156
|
|
158
157
|
## Flower Usage Examples
|
159
158
|
|
@@ -161,26 +160,26 @@ Several code examples show different usage scenarios of Flower (in combination w
|
|
161
160
|
|
162
161
|
Quickstart examples:
|
163
162
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
163
|
+
- [Quickstart (TensorFlow)](https://github.com/adap/flower/tree/main/examples/quickstart-tensorflow)
|
164
|
+
- [Quickstart (PyTorch)](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch)
|
165
|
+
- [Quickstart (Hugging Face)](https://github.com/adap/flower/tree/main/examples/quickstart-huggingface)
|
166
|
+
- [Quickstart (PyTorch Lightning)](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch-lightning)
|
167
|
+
- [Quickstart (fastai)](https://github.com/adap/flower/tree/main/examples/quickstart-fastai)
|
168
|
+
- [Quickstart (Pandas)](https://github.com/adap/flower/tree/main/examples/quickstart-pandas)
|
169
|
+
- [Quickstart (MXNet)](https://github.com/adap/flower/tree/main/examples/quickstart-mxnet)
|
170
|
+
- [Quickstart (JAX)](https://github.com/adap/flower/tree/main/examples/quickstart-jax)
|
171
|
+
- [Quickstart (scikit-learn)](https://github.com/adap/flower/tree/main/examples/sklearn-logreg-mnist)
|
172
|
+
- [Quickstart (Android [TFLite])](https://github.com/adap/flower/tree/main/examples/android)
|
173
|
+
- [Quickstart (iOS [CoreML])](https://github.com/adap/flower/tree/main/examples/ios)
|
175
174
|
|
176
175
|
Other [examples](https://github.com/adap/flower/tree/main/examples):
|
177
176
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
177
|
+
- [Raspberry Pi & Nvidia Jetson Tutorial](https://github.com/adap/flower/tree/main/examples/embedded-devices)
|
178
|
+
- [PyTorch: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/pytorch-from-centralized-to-federated)
|
179
|
+
- [MXNet: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/mxnet-from-centralized-to-federated)
|
180
|
+
- [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
|
181
|
+
- [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
|
182
|
+
- Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation_pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation_tensorflow))
|
184
183
|
|
185
184
|
## Community
|
186
185
|
|
@@ -192,12 +191,12 @@ Flower is built by a wonderful community of researchers and engineers. [Join Sla
|
|
192
191
|
|
193
192
|
## Citation
|
194
193
|
|
195
|
-
If you publish work that uses Flower, please cite Flower as follows:
|
194
|
+
If you publish work that uses Flower, please cite Flower as follows:
|
196
195
|
|
197
196
|
```bibtex
|
198
197
|
@article{beutel2020flower,
|
199
198
|
title={Flower: A Friendly Federated Learning Research Framework},
|
200
|
-
author={Beutel, Daniel J and Topal, Taner and Mathur, Akhil and Qiu, Xinchi and Fernandez-Marques, Javier and Gao, Yan and Sani, Lorenzo and Kwing, Hei Li and Parcollet, Titouan and Gusmão, Pedro PB de and Lane, Nicholas D},
|
199
|
+
author={Beutel, Daniel J and Topal, Taner and Mathur, Akhil and Qiu, Xinchi and Fernandez-Marques, Javier and Gao, Yan and Sani, Lorenzo and Kwing, Hei Li and Parcollet, Titouan and Gusmão, Pedro PB de and Lane, Nicholas D},
|
201
200
|
journal={arXiv preprint arXiv:2007.14390},
|
202
201
|
year={2020}
|
203
202
|
}
|
@@ -23,22 +23,21 @@
|
|
23
23
|
Flower (`flwr`) is a framework for building federated learning systems. The
|
24
24
|
design of Flower is based on a few guiding principles:
|
25
25
|
|
26
|
-
|
26
|
+
- **Customizable**: Federated learning systems vary wildly from one use case to
|
27
27
|
another. Flower allows for a wide range of different configurations depending
|
28
28
|
on the needs of each individual use case.
|
29
29
|
|
30
|
-
|
30
|
+
- **Extendable**: Flower originated from a research project at the University of
|
31
31
|
Oxford, so it was built with AI research in mind. Many components can be
|
32
32
|
extended and overridden to build new state-of-the-art systems.
|
33
33
|
|
34
|
-
|
34
|
+
- **Framework-agnostic**: Different machine learning frameworks have different
|
35
35
|
strengths. Flower can be used with any machine learning framework, for
|
36
36
|
example, [PyTorch](https://pytorch.org),
|
37
|
-
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [MXNet](https://mxnet.apache.org/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/
|
38
|
-
) for federated analytics, or even raw [NumPy](https://numpy.org/)
|
37
|
+
[TensorFlow](https://tensorflow.org), [Hugging Face Transformers](https://huggingface.co/), [PyTorch Lightning](https://pytorchlightning.ai/), [MXNet](https://mxnet.apache.org/), [scikit-learn](https://scikit-learn.org/), [JAX](https://jax.readthedocs.io/), [TFLite](https://tensorflow.org/lite/), [fastai](https://www.fast.ai/), [Pandas](https://pandas.pydata.org/) for federated analytics, or even raw [NumPy](https://numpy.org/)
|
39
38
|
for users who enjoy computing gradients by hand.
|
40
39
|
|
41
|
-
|
40
|
+
- **Understandable**: Flower is written with maintainability in mind. The
|
42
41
|
community is encouraged to both read and contribute to the codebase.
|
43
42
|
|
44
43
|
Meet the Flower community on [flower.dev](https://flower.dev)!
|
@@ -58,11 +57,11 @@ Flower's goal is to make federated learning accessible to everyone. This series
|
|
58
57
|
2. **Using Strategies in Federated Learning**
|
59
58
|
|
60
59
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-use-a-federated-learning-strategy-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-use-a-federated-learning-strategy-pytorch.ipynb))
|
61
|
-
|
60
|
+
|
62
61
|
3. **Building Strategies for Federated Learning**
|
63
62
|
|
64
63
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-series-use-a-federated-learning-strategy-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-series-use-a-federated-learning-strategy-pytorch.ipynb))
|
65
|
-
|
64
|
+
|
66
65
|
4. **Custom Clients for Federated Learning**
|
67
66
|
|
68
67
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/doc/source/tutorial-series-customize-the-client-pytorch.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/doc/source/tutorial-series-customize-the-client-pytorch.ipynb))
|
@@ -73,39 +72,39 @@ Stay tuned, more tutorials are coming soon. Topics include **Privacy and Securit
|
|
73
72
|
|
74
73
|
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/examples/flower-in-30-minutes/tutorial.ipynb) (or open the [Jupyter Notebook](https://github.com/adap/flower/blob/main/examples/flower-in-30-minutes/tutorial.ipynb))
|
75
74
|
|
76
|
-
|
77
75
|
## Documentation
|
78
76
|
|
79
77
|
[Flower Docs](https://flower.dev/docs):
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
78
|
+
|
79
|
+
- [Installation](https://flower.dev/docs/framework/how-to-install-flower.html)
|
80
|
+
- [Quickstart (TensorFlow)](https://flower.dev/docs/framework/tutorial-quickstart-tensorflow.html)
|
81
|
+
- [Quickstart (PyTorch)](https://flower.dev/docs/framework/tutorial-quickstart-pytorch.html)
|
82
|
+
- [Quickstart (Hugging Face)](https://flower.dev/docs/framework/tutorial-quickstart-huggingface.html)
|
83
|
+
- [Quickstart (PyTorch Lightning [code example])](https://flower.dev/docs/framework/tutorial-quickstart-pytorch-lightning.html)
|
84
|
+
- [Quickstart (MXNet)](https://flower.dev/docs/framework/example-mxnet-walk-through.html)
|
85
|
+
- [Quickstart (Pandas)](https://flower.dev/docs/framework/tutorial-quickstart-pandas.html)
|
86
|
+
- [Quickstart (fastai)](https://flower.dev/docs/framework/tutorial-quickstart-fastai.html)
|
87
|
+
- [Quickstart (JAX)](https://flower.dev/docs/framework/tutorial-quickstart-jax.html)
|
88
|
+
- [Quickstart (scikit-learn)](https://flower.dev/docs/framework/tutorial-quickstart-scikitlearn.html)
|
89
|
+
- [Quickstart (Android [TFLite])](https://flower.dev/docs/framework/tutorial-quickstart-android.html)
|
90
|
+
- [Quickstart (iOS [CoreML])](https://flower.dev/docs/framework/tutorial-quickstart-ios.html)
|
92
91
|
|
93
92
|
## Flower Baselines
|
94
93
|
|
95
94
|
Flower Baselines is a collection of community-contributed experiments that reproduce the experiments performed in popular federated learning publications. Researchers can build on Flower Baselines to quickly evaluate new ideas:
|
96
95
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
96
|
+
- [FedAvg](https://arxiv.org/abs/1602.05629):
|
97
|
+
- [MNIST](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/fedavg_mnist)
|
98
|
+
- [FedProx](https://arxiv.org/abs/1812.06127):
|
99
|
+
- [MNIST](https://github.com/adap/flower/tree/main/baselines/fedprox/)
|
100
|
+
- [FedBN: Federated Learning on non-IID Features via Local Batch Normalization](https://arxiv.org/abs/2102.07623):
|
101
|
+
- [Convergence Rate](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/fedbn/convergence_rate)
|
102
|
+
- [Adaptive Federated Optimization](https://arxiv.org/abs/2003.00295):
|
103
|
+
- [CIFAR-10/100](https://github.com/adap/flower/tree/main/baselines/flwr_baselines/flwr_baselines/publications/adaptive_federated_optimization)
|
105
104
|
|
106
|
-
Check the Flower documentation to learn more: [Using Baselines](https://flower.dev/docs/baselines/
|
105
|
+
Check the Flower documentation to learn more: [Using Baselines](https://flower.dev/docs/baselines/how-to-use-baselines.html)
|
107
106
|
|
108
|
-
The Flower community loves contributions! Make your work more visible and enable others to build on it by contributing it as a baseline: [Contributing Baselines](https://flower.dev/docs/baselines/
|
107
|
+
The Flower community loves contributions! Make your work more visible and enable others to build on it by contributing it as a baseline: [Contributing Baselines](https://flower.dev/docs/baselines/how-to-contribute-baselines.html)
|
109
108
|
|
110
109
|
## Flower Usage Examples
|
111
110
|
|
@@ -113,26 +112,26 @@ Several code examples show different usage scenarios of Flower (in combination w
|
|
113
112
|
|
114
113
|
Quickstart examples:
|
115
114
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
115
|
+
- [Quickstart (TensorFlow)](https://github.com/adap/flower/tree/main/examples/quickstart-tensorflow)
|
116
|
+
- [Quickstart (PyTorch)](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch)
|
117
|
+
- [Quickstart (Hugging Face)](https://github.com/adap/flower/tree/main/examples/quickstart-huggingface)
|
118
|
+
- [Quickstart (PyTorch Lightning)](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch-lightning)
|
119
|
+
- [Quickstart (fastai)](https://github.com/adap/flower/tree/main/examples/quickstart-fastai)
|
120
|
+
- [Quickstart (Pandas)](https://github.com/adap/flower/tree/main/examples/quickstart-pandas)
|
121
|
+
- [Quickstart (MXNet)](https://github.com/adap/flower/tree/main/examples/quickstart-mxnet)
|
122
|
+
- [Quickstart (JAX)](https://github.com/adap/flower/tree/main/examples/quickstart-jax)
|
123
|
+
- [Quickstart (scikit-learn)](https://github.com/adap/flower/tree/main/examples/sklearn-logreg-mnist)
|
124
|
+
- [Quickstart (Android [TFLite])](https://github.com/adap/flower/tree/main/examples/android)
|
125
|
+
- [Quickstart (iOS [CoreML])](https://github.com/adap/flower/tree/main/examples/ios)
|
127
126
|
|
128
127
|
Other [examples](https://github.com/adap/flower/tree/main/examples):
|
129
128
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
129
|
+
- [Raspberry Pi & Nvidia Jetson Tutorial](https://github.com/adap/flower/tree/main/examples/embedded-devices)
|
130
|
+
- [PyTorch: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/pytorch-from-centralized-to-federated)
|
131
|
+
- [MXNet: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/mxnet-from-centralized-to-federated)
|
132
|
+
- [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
|
133
|
+
- [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
|
134
|
+
- Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation_pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation_tensorflow))
|
136
135
|
|
137
136
|
## Community
|
138
137
|
|
@@ -144,12 +143,12 @@ Flower is built by a wonderful community of researchers and engineers. [Join Sla
|
|
144
143
|
|
145
144
|
## Citation
|
146
145
|
|
147
|
-
If you publish work that uses Flower, please cite Flower as follows:
|
146
|
+
If you publish work that uses Flower, please cite Flower as follows:
|
148
147
|
|
149
148
|
```bibtex
|
150
149
|
@article{beutel2020flower,
|
151
150
|
title={Flower: A Friendly Federated Learning Research Framework},
|
152
|
-
author={Beutel, Daniel J and Topal, Taner and Mathur, Akhil and Qiu, Xinchi and Fernandez-Marques, Javier and Gao, Yan and Sani, Lorenzo and Kwing, Hei Li and Parcollet, Titouan and Gusmão, Pedro PB de and Lane, Nicholas D},
|
151
|
+
author={Beutel, Daniel J and Topal, Taner and Mathur, Akhil and Qiu, Xinchi and Fernandez-Marques, Javier and Gao, Yan and Sani, Lorenzo and Kwing, Hei Li and Parcollet, Titouan and Gusmão, Pedro PB de and Lane, Nicholas D},
|
153
152
|
journal={arXiv preprint arXiv:2007.14390},
|
154
153
|
year={2020}
|
155
154
|
}
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
5
5
|
[tool.poetry]
|
6
6
|
name = "flwr-nightly"
|
7
|
-
version = "1.6.0-
|
7
|
+
version = "1.6.0-dev20231101"
|
8
8
|
description = "Flower: A Friendly Federated Learning Framework"
|
9
9
|
license = "Apache-2.0"
|
10
10
|
authors = ["The Flower Authors <hello@flower.dev>"]
|
@@ -19,7 +19,7 @@ import sys
|
|
19
19
|
import time
|
20
20
|
import warnings
|
21
21
|
from logging import INFO
|
22
|
-
from typing import Optional, Union
|
22
|
+
from typing import Callable, ContextManager, Optional, Tuple, Union
|
23
23
|
|
24
24
|
from flwr.client.client import Client
|
25
25
|
from flwr.client.typing import ClientFn
|
@@ -33,6 +33,7 @@ from flwr.common.constant import (
|
|
33
33
|
TRANSPORT_TYPES,
|
34
34
|
)
|
35
35
|
from flwr.common.logger import log
|
36
|
+
from flwr.proto.task_pb2 import TaskIns, TaskRes
|
36
37
|
|
37
38
|
from .grpc_client.connection import grpc_connection
|
38
39
|
from .grpc_rere_client.connection import grpc_request_response
|
@@ -134,44 +135,15 @@ def start_client(
|
|
134
135
|
|
135
136
|
client_fn = single_client_factory
|
136
137
|
|
137
|
-
#
|
138
|
-
|
139
|
-
if not parsed_address:
|
140
|
-
sys.exit(f"Server address ({server_address}) cannot be parsed.")
|
141
|
-
host, port, is_v6 = parsed_address
|
142
|
-
address = f"[{host}]:{port}" if is_v6 else f"{host}:{port}"
|
143
|
-
|
144
|
-
# Set the default transport layer
|
145
|
-
if transport is None:
|
146
|
-
transport = TRANSPORT_TYPE_GRPC_BIDI
|
147
|
-
|
148
|
-
# Use either gRPC bidirectional streaming or REST request/response
|
149
|
-
if transport == TRANSPORT_TYPE_REST:
|
150
|
-
try:
|
151
|
-
from .rest_client.connection import http_request_response
|
152
|
-
except ModuleNotFoundError:
|
153
|
-
sys.exit(MISSING_EXTRA_REST)
|
154
|
-
if server_address[:4] != "http":
|
155
|
-
sys.exit(
|
156
|
-
"When using the REST API, please provide `https://` or "
|
157
|
-
"`http://` before the server address (e.g. `http://127.0.0.1:8080`)"
|
158
|
-
)
|
159
|
-
connection = http_request_response
|
160
|
-
elif transport == TRANSPORT_TYPE_GRPC_RERE:
|
161
|
-
connection = grpc_request_response
|
162
|
-
elif transport == TRANSPORT_TYPE_GRPC_BIDI:
|
163
|
-
connection = grpc_connection
|
164
|
-
else:
|
165
|
-
raise ValueError(
|
166
|
-
f"Unknown transport type: {transport} (possible: {TRANSPORT_TYPES})"
|
167
|
-
)
|
138
|
+
# Initialize connection context manager
|
139
|
+
connection, address = _init_connection(transport, server_address)
|
168
140
|
|
169
141
|
while True:
|
170
142
|
sleep_duration: int = 0
|
171
143
|
with connection(
|
172
144
|
address,
|
173
|
-
|
174
|
-
root_certificates
|
145
|
+
grpc_max_message_length,
|
146
|
+
root_certificates,
|
175
147
|
) as conn:
|
176
148
|
receive, send, create_node, delete_node = conn
|
177
149
|
|
@@ -285,3 +257,54 @@ def start_numpy_client(
|
|
285
257
|
root_certificates=root_certificates,
|
286
258
|
transport=transport,
|
287
259
|
)
|
260
|
+
|
261
|
+
|
262
|
+
def _init_connection(
|
263
|
+
transport: Optional[str], server_address: str
|
264
|
+
) -> Tuple[
|
265
|
+
Callable[
|
266
|
+
[str, int, Union[bytes, str, None]],
|
267
|
+
ContextManager[
|
268
|
+
Tuple[
|
269
|
+
Callable[[], Optional[TaskIns]],
|
270
|
+
Callable[[TaskRes], None],
|
271
|
+
Optional[Callable[[], None]],
|
272
|
+
Optional[Callable[[], None]],
|
273
|
+
]
|
274
|
+
],
|
275
|
+
],
|
276
|
+
str,
|
277
|
+
]:
|
278
|
+
# Parse IP address
|
279
|
+
parsed_address = parse_address(server_address)
|
280
|
+
if not parsed_address:
|
281
|
+
sys.exit(f"Server address ({server_address}) cannot be parsed.")
|
282
|
+
host, port, is_v6 = parsed_address
|
283
|
+
address = f"[{host}]:{port}" if is_v6 else f"{host}:{port}"
|
284
|
+
|
285
|
+
# Set the default transport layer
|
286
|
+
if transport is None:
|
287
|
+
transport = TRANSPORT_TYPE_GRPC_BIDI
|
288
|
+
|
289
|
+
# Use either gRPC bidirectional streaming or REST request/response
|
290
|
+
if transport == TRANSPORT_TYPE_REST:
|
291
|
+
try:
|
292
|
+
from .rest_client.connection import http_request_response
|
293
|
+
except ModuleNotFoundError:
|
294
|
+
sys.exit(MISSING_EXTRA_REST)
|
295
|
+
if server_address[:4] != "http":
|
296
|
+
sys.exit(
|
297
|
+
"When using the REST API, please provide `https://` or "
|
298
|
+
"`http://` before the server address (e.g. `http://127.0.0.1:8080`)"
|
299
|
+
)
|
300
|
+
connection = http_request_response
|
301
|
+
elif transport == TRANSPORT_TYPE_GRPC_RERE:
|
302
|
+
connection = grpc_request_response
|
303
|
+
elif transport == TRANSPORT_TYPE_GRPC_BIDI:
|
304
|
+
connection = grpc_connection
|
305
|
+
else:
|
306
|
+
raise ValueError(
|
307
|
+
f"Unknown transport type: {transport} (possible: {TRANSPORT_TYPES})"
|
308
|
+
)
|
309
|
+
|
310
|
+
return connection, address
|