flwr-nightly 1.4.0.dev20230325__py3-none-any.whl → 1.4.0.dev20230330__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- flwr/simulation/app.py +13 -12
- flwr/simulation/ray_transport/ray_client_proxy.py +5 -5
- {flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/METADATA +2 -2
- {flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/RECORD +7 -7
- {flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/entry_points.txt +0 -0
flwr/simulation/app.py
CHANGED
@@ -21,7 +21,7 @@ from typing import Any, Callable, Dict, List, Optional
|
|
21
21
|
|
22
22
|
import ray
|
23
23
|
|
24
|
-
from flwr.client
|
24
|
+
from flwr.client import ClientLike
|
25
25
|
from flwr.common import EventType, event
|
26
26
|
from flwr.common.logger import log
|
27
27
|
from flwr.server import Server
|
@@ -38,7 +38,7 @@ Invalid Arguments in method:
|
|
38
38
|
|
39
39
|
`start_simulation(
|
40
40
|
*,
|
41
|
-
client_fn: Callable[[str],
|
41
|
+
client_fn: Callable[[str], ClientLike],
|
42
42
|
num_clients: Optional[int] = None,
|
43
43
|
clients_ids: Optional[List[str]] = None,
|
44
44
|
client_resources: Optional[Dict[str, float]] = None,
|
@@ -61,7 +61,7 @@ REASON:
|
|
61
61
|
|
62
62
|
def start_simulation( # pylint: disable=too-many-arguments
|
63
63
|
*,
|
64
|
-
client_fn: Callable[[str],
|
64
|
+
client_fn: Callable[[str], ClientLike],
|
65
65
|
num_clients: Optional[int] = None,
|
66
66
|
clients_ids: Optional[List[str]] = None,
|
67
67
|
client_resources: Optional[Dict[str, float]] = None,
|
@@ -76,16 +76,17 @@ def start_simulation( # pylint: disable=too-many-arguments
|
|
76
76
|
|
77
77
|
Parameters
|
78
78
|
----------
|
79
|
-
client_fn : Callable[[str],
|
79
|
+
client_fn : Callable[[str], ClientLike]
|
80
80
|
A function creating client instances. The function must take a single
|
81
|
-
str argument called `cid`. It should return a single client instance
|
82
|
-
Note that the created client instances
|
83
|
-
destroyed after a single method
|
84
|
-
not long-lived, they should not
|
85
|
-
|
86
|
-
hyperparameters, ...) should be
|
87
|
-
`client_fn` or the call to any of
|
88
|
-
evaluation data in the `evaluate`
|
81
|
+
str argument called `cid`. It should return a single client instance
|
82
|
+
of type ClientLike. Note that the created client instances
|
83
|
+
are ephemeral and will often be destroyed after a single method
|
84
|
+
invocation. Since client instances are not long-lived, they should not
|
85
|
+
attempt to carry state over method invocations. Any state required by
|
86
|
+
the instance (model, dataset,hyperparameters, ...) should be
|
87
|
+
(re-)created in either the call to `client_fn` or the call to any of
|
88
|
+
the client methods (e.g., load evaluation data in the `evaluate`
|
89
|
+
method itself).
|
89
90
|
num_clients : Optional[int]
|
90
91
|
The total number of clients in this simulation. This must be set if
|
91
92
|
`clients_ids` is not set and vice-versa.
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"""Ray-based Flower ClientProxy implementation."""
|
16
16
|
|
17
17
|
|
18
|
-
from logging import
|
18
|
+
from logging import ERROR
|
19
19
|
from typing import Callable, Dict, Optional, cast
|
20
20
|
|
21
21
|
import ray
|
@@ -52,7 +52,7 @@ class RayClientProxy(ClientProxy):
|
|
52
52
|
try:
|
53
53
|
res = ray.get(future_get_properties_res, timeout=timeout)
|
54
54
|
except Exception as ex:
|
55
|
-
log(
|
55
|
+
log(ERROR, ex)
|
56
56
|
raise ex
|
57
57
|
return cast(
|
58
58
|
common.GetPropertiesRes,
|
@@ -69,7 +69,7 @@ class RayClientProxy(ClientProxy):
|
|
69
69
|
try:
|
70
70
|
res = ray.get(future_paramseters_res, timeout=timeout)
|
71
71
|
except Exception as ex:
|
72
|
-
log(
|
72
|
+
log(ERROR, ex)
|
73
73
|
raise ex
|
74
74
|
return cast(
|
75
75
|
common.GetParametersRes,
|
@@ -84,7 +84,7 @@ class RayClientProxy(ClientProxy):
|
|
84
84
|
try:
|
85
85
|
res = ray.get(future_fit_res, timeout=timeout)
|
86
86
|
except Exception as ex:
|
87
|
-
log(
|
87
|
+
log(ERROR, ex)
|
88
88
|
raise ex
|
89
89
|
return cast(
|
90
90
|
common.FitRes,
|
@@ -101,7 +101,7 @@ class RayClientProxy(ClientProxy):
|
|
101
101
|
try:
|
102
102
|
res = ray.get(future_evaluate_res, timeout=timeout)
|
103
103
|
except Exception as ex:
|
104
|
-
log(
|
104
|
+
log(ERROR, ex)
|
105
105
|
raise ex
|
106
106
|
return cast(
|
107
107
|
common.EvaluateRes,
|
{flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: flwr-nightly
|
3
|
-
Version: 1.4.0.
|
3
|
+
Version: 1.4.0.dev20230330
|
4
4
|
Summary: Flower: A Friendly Federated Learning Framework
|
5
5
|
Home-page: https://flower.dev
|
6
6
|
License: Apache-2.0
|
@@ -44,7 +44,7 @@ Requires-Dist: importlib-metadata (>=4.0.0,<5.0.0) ; python_version < "3.8"
|
|
44
44
|
Requires-Dist: iterators (>=0.0.2,<0.0.3)
|
45
45
|
Requires-Dist: numpy (>=1.21.0,<2.0.0)
|
46
46
|
Requires-Dist: protobuf (>=3.19.0,<4.0.0)
|
47
|
-
Requires-Dist: ray[default] (
|
47
|
+
Requires-Dist: ray[default] (>=2.3.0,<3.0.0) ; extra == "simulation"
|
48
48
|
Requires-Dist: requests (>=2.28.2,<3.0.0) ; extra == "rest"
|
49
49
|
Requires-Dist: starlette (>=0.25.0,<0.26.0)
|
50
50
|
Requires-Dist: uvicorn[standard] (>=0.20.0,<0.21.0) ; extra == "rest"
|
{flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/RECORD
RENAMED
@@ -92,11 +92,11 @@ flwr/server/utils/__init__.py,sha256=I3aifvGufkoK1Od-w1Xz_nicgAYllqXScQiRU6A5xvA
|
|
92
92
|
flwr/server/utils/tensorboard.py,sha256=BeaO4HIm6HrBXNwRXB_BetOrG4zmsDh_dTJzU3AJAv8,5112
|
93
93
|
flwr/server/utils/validator.py,sha256=BjDMGy8pgB7nwg-w-QNFQf_lipzc0FbVlx-IdHlEVuQ,4939
|
94
94
|
flwr/simulation/__init__.py,sha256=7gYUX6zr_yJd1wtv65xRHajBvurkfoPVXv66buUy4H8,1270
|
95
|
-
flwr/simulation/app.py,sha256=
|
95
|
+
flwr/simulation/app.py,sha256=kYvgqQeQKOzOlQRNWdEYnf6FxmvoStfqYGhsjEghqDQ,7773
|
96
96
|
flwr/simulation/ray_transport/__init__.py,sha256=eJ3pijYkI7XhbX2rLu6FBGTo8hZkFL8RSj4twhApOGw,727
|
97
|
-
flwr/simulation/ray_transport/ray_client_proxy.py,sha256=
|
98
|
-
flwr_nightly-1.4.0.
|
99
|
-
flwr_nightly-1.4.0.
|
100
|
-
flwr_nightly-1.4.0.
|
101
|
-
flwr_nightly-1.4.0.
|
102
|
-
flwr_nightly-1.4.0.
|
97
|
+
flwr/simulation/ray_transport/ray_client_proxy.py,sha256=yGY8p0TKxak-OH7zqFxd9oDe3TQ_cfAZEp0-JJYEnyg,5472
|
98
|
+
flwr_nightly-1.4.0.dev20230330.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
99
|
+
flwr_nightly-1.4.0.dev20230330.dist-info/entry_points.txt,sha256=1uLlD5tIunkzALMfMWnqjdE_D5hRUX_I1iMmOMv6tZI,181
|
100
|
+
flwr_nightly-1.4.0.dev20230330.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
101
|
+
flwr_nightly-1.4.0.dev20230330.dist-info/METADATA,sha256=QgQDA5FLcEymq6UwgEpTRv67SYqhvw5tUHk6Ww3tGu4,12839
|
102
|
+
flwr_nightly-1.4.0.dev20230330.dist-info/RECORD,,
|
{flwr_nightly-1.4.0.dev20230325.dist-info → flwr_nightly-1.4.0.dev20230330.dist-info}/LICENSE
RENAMED
File without changes
|
File without changes
|
File without changes
|