flwr-nightly 1.5.0.dev20230509__py3-none-any.whl → 1.5.0.dev20230511__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
flwr/server/app.py CHANGED
@@ -139,7 +139,7 @@ def start_server( # pylint: disable=too-many-arguments,too-many-locals
139
139
  event(EventType.START_SERVER_ENTER)
140
140
 
141
141
  # Initialize server and server config
142
- initialized_server, initialized_config = _init_defaults(
142
+ initialized_server, initialized_config = init_defaults(
143
143
  server=server,
144
144
  config=config,
145
145
  strategy=strategy,
@@ -173,7 +173,7 @@ def start_server( # pylint: disable=too-many-arguments,too-many-locals
173
173
  )
174
174
 
175
175
  # Start training
176
- hist = _fl(
176
+ hist = run_fl(
177
177
  server=initialized_server,
178
178
  config=initialized_config,
179
179
  )
@@ -186,13 +186,13 @@ def start_server( # pylint: disable=too-many-arguments,too-many-locals
186
186
  return hist
187
187
 
188
188
 
189
- def _init_defaults(
189
+ def init_defaults(
190
190
  server: Optional[Server],
191
191
  config: Optional[ServerConfig],
192
192
  strategy: Optional[Strategy],
193
193
  client_manager: Optional[ClientManager],
194
194
  ) -> Tuple[Server, ServerConfig]:
195
- # Create server instance if none was given
195
+ """Create server instance if none was given."""
196
196
  if server is None:
197
197
  if client_manager is None:
198
198
  client_manager = SimpleClientManager()
@@ -209,11 +209,11 @@ def _init_defaults(
209
209
  return server, config
210
210
 
211
211
 
212
- def _fl(
212
+ def run_fl(
213
213
  server: Server,
214
214
  config: ServerConfig,
215
215
  ) -> History:
216
- # Fit model
216
+ """Train a model on the given server and return the History object."""
217
217
  hist = server.fit(num_rounds=config.num_rounds, timeout=config.round_timeout)
218
218
  log(INFO, "app_fit: losses_distributed %s", str(hist.losses_distributed))
219
219
  log(INFO, "app_fit: metrics_distributed_fit %s", str(hist.metrics_distributed_fit))
@@ -527,7 +527,7 @@ def _run_fleet_api_rest(
527
527
  try:
528
528
  import uvicorn
529
529
 
530
- from flwr.server.rest_server.rest_api import app as fast_api_app
530
+ from flwr.server.fleet.rest_rere.rest_api import app as fast_api_app
531
531
  except ModuleNotFoundError:
532
532
  sys.exit(MISSING_EXTRA_REST)
533
533
  if workers != 1:
@@ -550,7 +550,7 @@ def _run_fleet_api_rest(
550
550
  raise ValueError(validation_exceptions)
551
551
 
552
552
  uvicorn.run(
553
- app="flwr.server.rest_server.rest_api:app",
553
+ app="flwr.server.fleet.rest_rere.rest_api:app",
554
554
  port=port,
555
555
  host=host,
556
556
  reload=False,
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Adap GmbH. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Server-side part of the gRPC transport layer using Request-Response."""
@@ -27,7 +27,7 @@ from flwr.common.logger import log
27
27
  from flwr.proto.transport_pb2_grpc import add_FlowerServiceServicer_to_server
28
28
  from flwr.server.client_manager import ClientManager
29
29
  from flwr.server.driver.driver_servicer import DriverServicer
30
- from flwr.server.fleet.fleet_servicer import FleetServicer
30
+ from flwr.server.fleet.grpc_rere.fleet_servicer import FleetServicer
31
31
  from flwr.server.grpc_server.flower_service_servicer import FlowerServiceServicer
32
32
 
33
33
  INVALID_CERTIFICATES_ERR_MSG = """
flwr/simulation/app.py CHANGED
@@ -25,7 +25,7 @@ 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
28
- from flwr.server.app import ServerConfig, _fl, _init_defaults
28
+ from flwr.server.app import ServerConfig, init_defaults, run_fl
29
29
  from flwr.server.client_manager import ClientManager
30
30
  from flwr.server.history import History
31
31
  from flwr.server.strategy import Strategy
@@ -137,7 +137,7 @@ def start_simulation( # pylint: disable=too-many-arguments
137
137
  )
138
138
 
139
139
  # Initialize server and server config
140
- initialized_server, initialized_config = _init_defaults(
140
+ initialized_server, initialized_config = init_defaults(
141
141
  server=server,
142
142
  config=config,
143
143
  strategy=strategy,
@@ -194,7 +194,7 @@ def start_simulation( # pylint: disable=too-many-arguments
194
194
  initialized_server.client_manager().register(client=client_proxy)
195
195
 
196
196
  # Start training
197
- hist = _fl(
197
+ hist = run_fl(
198
198
  server=initialized_server,
199
199
  config=initialized_config,
200
200
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.5.0.dev20230509
3
+ Version: 1.5.0.dev20230511
4
4
  Summary: Flower: A Friendly Federated Learning Framework
5
5
  Home-page: https://flower.dev
6
6
  License: Apache-2.0
@@ -48,24 +48,25 @@ flwr/proto/transport_pb2_grpc.py,sha256=vLN3EHtx2aEEMCO4f1Upu-l27BPzd3-5pV-u8wPc
48
48
  flwr/proto/transport_pb2_grpc.pyi,sha256=AGXf8RiIiW2J5IKMlm_3qT3AzcDa4F3P5IqUjve_esA,766
49
49
  flwr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  flwr/server/__init__.py,sha256=fDk0_Aa1UkPBnhgAteeQv42KQyxSgU4JsF7le9gvVyY,1370
51
- flwr/server/app.py,sha256=QHptvgsG3v0q53orxw_ITkaTsA_MidzjPML5Q5AcpnA,23569
51
+ flwr/server/app.py,sha256=6L47YCZAGUoCY_oZg8As71H-ZERxVzVmsJToLoruwSg,23645
52
52
  flwr/server/client_manager.py,sha256=OjJsIFos4kgol_knpGLa2IVCnFQJ1NuN-Qdr5BD6lYU,5941
53
53
  flwr/server/client_proxy.py,sha256=f0XnGrhaBzWsKN7j0KD288GqlebhVeJuSOMN38cD8Dc,2228
54
54
  flwr/server/criterion.py,sha256=9qfnUrDzgPhF8XIeBzJc1TrGrAmHOgAq24BEmZRN5BQ,1058
55
55
  flwr/server/driver/__init__.py,sha256=blORT_Pj4Uclj4FRMj38oiGPJiI9RJXiL5osNMCsQPA,705
56
56
  flwr/server/driver/driver_servicer.py,sha256=ArYIocfIM_EoTQ35THWhN0QeuaHDJPUHKq3FR_y21NQ,3919
57
57
  flwr/server/fleet/__init__.py,sha256=ripLU3o6YbNV-tNtqeLtM2f79_qeJwzZJiwt6ABYLbs,704
58
- flwr/server/fleet/fleet_servicer.py,sha256=m9dc1lJRMl9P3ujEDXW8L-2gJIaLq3hYrTngqNwtDHI,1638
58
+ flwr/server/fleet/grpc_rere/__init__.py,sha256=A8q_bIhY6c51pXyUHqAQLedollHyqqp-chl7DDe9rzk,751
59
+ flwr/server/fleet/grpc_rere/fleet_servicer.py,sha256=m9dc1lJRMl9P3ujEDXW8L-2gJIaLq3hYrTngqNwtDHI,1638
60
+ flwr/server/fleet/rest_rere/__init__.py,sha256=2rG5KG7xojkD8jgwUrJPrW4Nsdm_HhwZaQ1poy9x3KQ,728
61
+ flwr/server/fleet/rest_rere/rest_api.py,sha256=RLXyQBoQybciyYlZH9NezFTE_tV0cOxRWC21zRw2gOY,4564
59
62
  flwr/server/grpc_server/__init__.py,sha256=MFFOIhntiPA7BkkV1sAPnP3aZr1H-XWMP1-u9GrfZVE,728
60
63
  flwr/server/grpc_server/driver_client_manager.py,sha256=KpYaIY4mtOZao3s6cwlgCtirsed-tB41tRqzfr5A-Uc,4467
61
64
  flwr/server/grpc_server/flower_service_servicer.py,sha256=iaDfd_GPfu1RUWd5sebKb3Aqv95rXa9xMoDeVB3CNTA,5594
62
65
  flwr/server/grpc_server/grpc_bridge.py,sha256=FofohOKyoVhGv7_hHo4FxO4nH9jvRB24brHdZq9LYQ8,6416
63
66
  flwr/server/grpc_server/grpc_client_proxy.py,sha256=Byput4zxlI_mF2v2aJlKhQKeha2eAwxJdxkTRVy7l4M,4623
64
- flwr/server/grpc_server/grpc_server.py,sha256=WiCurb8Juum4npU0I9Yz3GaBQX348d6Gdh6B4ob-jTc,11509
67
+ flwr/server/grpc_server/grpc_server.py,sha256=wxx_djJxKp5fUxz7Or0UHbbWe29-j8Q-3ArvvL9TN6Q,11519
65
68
  flwr/server/grpc_server/ins_scheduler.py,sha256=HgxavTZx6ejBRrf-9jxCyEzS8sHDSA0imiwOvfeHdS8,6314
66
69
  flwr/server/history.py,sha256=DAI-QKL_DEuFqEgYmHbaul642gF9bWa8E-hdobTYwwA,4457
67
- flwr/server/rest_server/__init__.py,sha256=2rG5KG7xojkD8jgwUrJPrW4Nsdm_HhwZaQ1poy9x3KQ,728
68
- flwr/server/rest_server/rest_api.py,sha256=RLXyQBoQybciyYlZH9NezFTE_tV0cOxRWC21zRw2gOY,4564
69
70
  flwr/server/server.py,sha256=wH6P4Z8Os63dYWNyhaKf95c0eAZKATe3d_w4tgRN7Xg,15891
70
71
  flwr/server/state/__init__.py,sha256=jcTV_f7T8w72NWkAY9kNPFis-FOd3Zm5jLE3CRmvOkE,996
71
72
  flwr/server/state/in_memory_state.py,sha256=Vsk0smDQ1pNLUeI5vIGkRLmTT-a0P6yOvyfMX8fDbv4,6521
@@ -94,11 +95,11 @@ flwr/server/utils/__init__.py,sha256=I3aifvGufkoK1Od-w1Xz_nicgAYllqXScQiRU6A5xvA
94
95
  flwr/server/utils/tensorboard.py,sha256=8CdSkJAdIaunKbp1fD0Wi6gFSC94YzrpwkKGzezv0nA,5114
95
96
  flwr/server/utils/validator.py,sha256=T5Wq5urHI2HD90InACl8-TjFkQJryG8OXXhMLlxvhB4,4941
96
97
  flwr/simulation/__init__.py,sha256=ZtAt5bMbbp9IJp1QQOhACN6_qhSPDtGmHF8gypUOZ9s,1271
97
- flwr/simulation/app.py,sha256=kYvgqQeQKOzOlQRNWdEYnf6FxmvoStfqYGhsjEghqDQ,7773
98
+ flwr/simulation/app.py,sha256=fBIka3dl0x-yCGVoVs9COKRrzgAuoURU1DSPOnQuxgI,7777
98
99
  flwr/simulation/ray_transport/__init__.py,sha256=eJ3pijYkI7XhbX2rLu6FBGTo8hZkFL8RSj4twhApOGw,727
99
100
  flwr/simulation/ray_transport/ray_client_proxy.py,sha256=yGY8p0TKxak-OH7zqFxd9oDe3TQ_cfAZEp0-JJYEnyg,5472
100
- flwr_nightly-1.5.0.dev20230509.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
101
- flwr_nightly-1.5.0.dev20230509.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
102
- flwr_nightly-1.5.0.dev20230509.dist-info/entry_points.txt,sha256=1uLlD5tIunkzALMfMWnqjdE_D5hRUX_I1iMmOMv6tZI,181
103
- flwr_nightly-1.5.0.dev20230509.dist-info/METADATA,sha256=_yCY52LqT9H3c9GEKM_cRS0yVWlwxy1NOpTEnW7KjEg,12772
104
- flwr_nightly-1.5.0.dev20230509.dist-info/RECORD,,
101
+ flwr_nightly-1.5.0.dev20230511.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
102
+ flwr_nightly-1.5.0.dev20230511.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
103
+ flwr_nightly-1.5.0.dev20230511.dist-info/entry_points.txt,sha256=1uLlD5tIunkzALMfMWnqjdE_D5hRUX_I1iMmOMv6tZI,181
104
+ flwr_nightly-1.5.0.dev20230511.dist-info/METADATA,sha256=lQ_RxdS18MHTrBVbYwepdJegJwHdwUDKrCNCUK72_Mg,12772
105
+ flwr_nightly-1.5.0.dev20230511.dist-info/RECORD,,