flwr 1.18.0__py3-none-any.whl → 1.20.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. flwr/app/__init__.py +15 -0
  2. flwr/app/error.py +68 -0
  3. flwr/app/metadata.py +223 -0
  4. flwr/cli/build.py +94 -59
  5. flwr/cli/log.py +3 -3
  6. flwr/cli/login/login.py +3 -7
  7. flwr/cli/ls.py +15 -36
  8. flwr/cli/new/new.py +12 -4
  9. flwr/cli/new/templates/app/README.flowertune.md.tpl +2 -0
  10. flwr/cli/new/templates/app/README.md.tpl +5 -0
  11. flwr/cli/new/templates/app/code/client.baseline.py.tpl +1 -1
  12. flwr/cli/new/templates/app/code/model.baseline.py.tpl +1 -1
  13. flwr/cli/new/templates/app/code/server.baseline.py.tpl +2 -3
  14. flwr/cli/new/templates/app/pyproject.baseline.toml.tpl +25 -17
  15. flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl +13 -1
  16. flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl +21 -2
  17. flwr/cli/new/templates/app/pyproject.jax.toml.tpl +18 -1
  18. flwr/cli/new/templates/app/pyproject.mlx.toml.tpl +19 -2
  19. flwr/cli/new/templates/app/pyproject.numpy.toml.tpl +18 -1
  20. flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl +20 -3
  21. flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl +18 -1
  22. flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl +18 -1
  23. flwr/cli/run/run.py +48 -49
  24. flwr/cli/stop.py +2 -2
  25. flwr/cli/utils.py +38 -5
  26. flwr/client/__init__.py +2 -2
  27. flwr/client/client_app.py +1 -1
  28. flwr/client/clientapp/__init__.py +0 -7
  29. flwr/client/grpc_adapter_client/connection.py +15 -8
  30. flwr/client/grpc_rere_client/connection.py +142 -97
  31. flwr/client/grpc_rere_client/grpc_adapter.py +34 -6
  32. flwr/client/message_handler/message_handler.py +1 -1
  33. flwr/client/mod/comms_mods.py +36 -17
  34. flwr/client/rest_client/connection.py +176 -103
  35. flwr/clientapp/__init__.py +15 -0
  36. flwr/common/__init__.py +2 -2
  37. flwr/common/auth_plugin/__init__.py +2 -0
  38. flwr/common/auth_plugin/auth_plugin.py +29 -3
  39. flwr/common/constant.py +39 -8
  40. flwr/common/event_log_plugin/event_log_plugin.py +3 -3
  41. flwr/common/exit/exit_code.py +16 -1
  42. flwr/common/exit_handlers.py +30 -0
  43. flwr/common/grpc.py +12 -1
  44. flwr/common/heartbeat.py +165 -0
  45. flwr/common/inflatable.py +290 -0
  46. flwr/common/inflatable_protobuf_utils.py +141 -0
  47. flwr/common/inflatable_utils.py +508 -0
  48. flwr/common/message.py +110 -242
  49. flwr/common/record/__init__.py +2 -1
  50. flwr/common/record/array.py +402 -0
  51. flwr/common/record/arraychunk.py +59 -0
  52. flwr/common/record/arrayrecord.py +103 -225
  53. flwr/common/record/configrecord.py +59 -4
  54. flwr/common/record/conversion_utils.py +1 -1
  55. flwr/common/record/metricrecord.py +55 -4
  56. flwr/common/record/recorddict.py +69 -1
  57. flwr/common/recorddict_compat.py +2 -2
  58. flwr/common/retry_invoker.py +5 -1
  59. flwr/common/serde.py +59 -211
  60. flwr/common/serde_utils.py +175 -0
  61. flwr/common/typing.py +5 -3
  62. flwr/compat/__init__.py +15 -0
  63. flwr/compat/client/__init__.py +15 -0
  64. flwr/{client → compat/client}/app.py +28 -185
  65. flwr/compat/common/__init__.py +15 -0
  66. flwr/compat/server/__init__.py +15 -0
  67. flwr/compat/server/app.py +174 -0
  68. flwr/compat/simulation/__init__.py +15 -0
  69. flwr/proto/appio_pb2.py +43 -0
  70. flwr/proto/appio_pb2.pyi +151 -0
  71. flwr/proto/appio_pb2_grpc.py +4 -0
  72. flwr/proto/appio_pb2_grpc.pyi +4 -0
  73. flwr/proto/clientappio_pb2.py +12 -19
  74. flwr/proto/clientappio_pb2.pyi +23 -101
  75. flwr/proto/clientappio_pb2_grpc.py +269 -28
  76. flwr/proto/clientappio_pb2_grpc.pyi +114 -20
  77. flwr/proto/fleet_pb2.py +24 -27
  78. flwr/proto/fleet_pb2.pyi +19 -35
  79. flwr/proto/fleet_pb2_grpc.py +117 -13
  80. flwr/proto/fleet_pb2_grpc.pyi +47 -6
  81. flwr/proto/heartbeat_pb2.py +33 -0
  82. flwr/proto/heartbeat_pb2.pyi +66 -0
  83. flwr/proto/heartbeat_pb2_grpc.py +4 -0
  84. flwr/proto/heartbeat_pb2_grpc.pyi +4 -0
  85. flwr/proto/message_pb2.py +28 -11
  86. flwr/proto/message_pb2.pyi +125 -0
  87. flwr/proto/recorddict_pb2.py +16 -28
  88. flwr/proto/recorddict_pb2.pyi +46 -64
  89. flwr/proto/run_pb2.py +24 -32
  90. flwr/proto/run_pb2.pyi +4 -52
  91. flwr/proto/serverappio_pb2.py +9 -23
  92. flwr/proto/serverappio_pb2.pyi +0 -110
  93. flwr/proto/serverappio_pb2_grpc.py +177 -72
  94. flwr/proto/serverappio_pb2_grpc.pyi +75 -33
  95. flwr/proto/simulationio_pb2.py +12 -11
  96. flwr/proto/simulationio_pb2_grpc.py +35 -0
  97. flwr/proto/simulationio_pb2_grpc.pyi +14 -0
  98. flwr/server/__init__.py +1 -1
  99. flwr/server/app.py +69 -187
  100. flwr/server/compat/app_utils.py +50 -28
  101. flwr/server/fleet_event_log_interceptor.py +6 -2
  102. flwr/server/grid/grpc_grid.py +148 -41
  103. flwr/server/grid/inmemory_grid.py +5 -4
  104. flwr/server/serverapp/app.py +45 -17
  105. flwr/server/superlink/fleet/grpc_adapter/grpc_adapter_servicer.py +21 -3
  106. flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +102 -8
  107. flwr/server/superlink/fleet/grpc_rere/server_interceptor.py +2 -5
  108. flwr/server/superlink/fleet/message_handler/message_handler.py +130 -19
  109. flwr/server/superlink/fleet/rest_rere/rest_api.py +73 -13
  110. flwr/server/superlink/fleet/vce/vce_api.py +6 -3
  111. flwr/server/superlink/linkstate/in_memory_linkstate.py +138 -43
  112. flwr/server/superlink/linkstate/linkstate.py +53 -20
  113. flwr/server/superlink/linkstate/sqlite_linkstate.py +149 -55
  114. flwr/server/superlink/linkstate/utils.py +33 -29
  115. flwr/server/superlink/serverappio/serverappio_grpc.py +4 -1
  116. flwr/server/superlink/serverappio/serverappio_servicer.py +230 -84
  117. flwr/server/superlink/simulation/simulationio_grpc.py +1 -1
  118. flwr/server/superlink/simulation/simulationio_servicer.py +26 -2
  119. flwr/server/superlink/utils.py +9 -2
  120. flwr/server/utils/validator.py +2 -2
  121. flwr/serverapp/__init__.py +15 -0
  122. flwr/simulation/app.py +25 -0
  123. flwr/simulation/run_simulation.py +17 -0
  124. flwr/supercore/__init__.py +15 -0
  125. flwr/{server/superlink → supercore}/ffs/__init__.py +2 -0
  126. flwr/{server/superlink → supercore}/ffs/disk_ffs.py +1 -1
  127. flwr/supercore/grpc_health/__init__.py +22 -0
  128. flwr/supercore/grpc_health/simple_health_servicer.py +38 -0
  129. flwr/supercore/license_plugin/__init__.py +22 -0
  130. flwr/supercore/license_plugin/license_plugin.py +26 -0
  131. flwr/supercore/object_store/__init__.py +24 -0
  132. flwr/supercore/object_store/in_memory_object_store.py +229 -0
  133. flwr/supercore/object_store/object_store.py +170 -0
  134. flwr/supercore/object_store/object_store_factory.py +44 -0
  135. flwr/supercore/object_store/utils.py +43 -0
  136. flwr/supercore/scheduler/__init__.py +22 -0
  137. flwr/supercore/scheduler/plugin.py +71 -0
  138. flwr/{client/nodestate/nodestate.py → supercore/utils.py} +14 -13
  139. flwr/superexec/deployment.py +7 -4
  140. flwr/superexec/exec_event_log_interceptor.py +8 -4
  141. flwr/superexec/exec_grpc.py +25 -5
  142. flwr/superexec/exec_license_interceptor.py +82 -0
  143. flwr/superexec/exec_servicer.py +135 -24
  144. flwr/superexec/exec_user_auth_interceptor.py +45 -8
  145. flwr/superexec/executor.py +5 -1
  146. flwr/superexec/simulation.py +8 -3
  147. flwr/superlink/__init__.py +15 -0
  148. flwr/{client/supernode → supernode}/__init__.py +0 -7
  149. flwr/supernode/cli/__init__.py +24 -0
  150. flwr/{client/supernode/app.py → supernode/cli/flower_supernode.py} +3 -19
  151. flwr/supernode/cli/flwr_clientapp.py +88 -0
  152. flwr/supernode/nodestate/in_memory_nodestate.py +199 -0
  153. flwr/supernode/nodestate/nodestate.py +227 -0
  154. flwr/supernode/runtime/__init__.py +15 -0
  155. flwr/{client/clientapp/app.py → supernode/runtime/run_clientapp.py} +135 -89
  156. flwr/supernode/scheduler/__init__.py +22 -0
  157. flwr/supernode/scheduler/simple_clientapp_scheduler_plugin.py +49 -0
  158. flwr/supernode/servicer/__init__.py +15 -0
  159. flwr/supernode/servicer/clientappio/__init__.py +22 -0
  160. flwr/supernode/servicer/clientappio/clientappio_servicer.py +303 -0
  161. flwr/supernode/start_client_internal.py +589 -0
  162. {flwr-1.18.0.dist-info → flwr-1.20.0.dist-info}/METADATA +6 -4
  163. {flwr-1.18.0.dist-info → flwr-1.20.0.dist-info}/RECORD +171 -123
  164. {flwr-1.18.0.dist-info → flwr-1.20.0.dist-info}/WHEEL +1 -1
  165. {flwr-1.18.0.dist-info → flwr-1.20.0.dist-info}/entry_points.txt +2 -2
  166. flwr/client/clientapp/clientappio_servicer.py +0 -244
  167. flwr/client/heartbeat.py +0 -74
  168. flwr/client/nodestate/in_memory_nodestate.py +0 -38
  169. /flwr/{client → compat/client}/grpc_client/__init__.py +0 -0
  170. /flwr/{client → compat/client}/grpc_client/connection.py +0 -0
  171. /flwr/{server/superlink → supercore}/ffs/ffs.py +0 -0
  172. /flwr/{server/superlink → supercore}/ffs/ffs_factory.py +0 -0
  173. /flwr/{client → supernode}/nodestate/__init__.py +0 -0
  174. /flwr/{client → supernode}/nodestate/nodestate_factory.py +0 -0
flwr/cli/new/new.py CHANGED
@@ -271,28 +271,36 @@ def new(
271
271
 
272
272
  prompt = typer.style(
273
273
  "🎊 Flower App creation successful.\n\n"
274
- "To run your Flower App, use the following command:\n\n",
274
+ "To run your Flower App, first install its dependencies:\n\n",
275
275
  fg=typer.colors.GREEN,
276
276
  bold=True,
277
277
  )
278
278
 
279
279
  _add = " huggingface-cli login\n" if llm_challenge_str else ""
280
+
280
281
  prompt += typer.style(
281
- _add + f" flwr run {package_name}\n\n",
282
+ f" cd {package_name} && pip install -e .\n" + _add + "\n",
282
283
  fg=typer.colors.BRIGHT_CYAN,
283
284
  bold=True,
284
285
  )
285
286
 
286
287
  prompt += typer.style(
287
- "If you haven't installed all dependencies yet, follow these steps:\n\n",
288
+ "then, run the app:\n\n ",
288
289
  fg=typer.colors.GREEN,
289
290
  bold=True,
290
291
  )
291
292
 
292
293
  prompt += typer.style(
293
- f" cd {package_name}\n" + " pip install -e .\n" + _add + " flwr run .\n",
294
+ "\tflwr run .\n\n",
294
295
  fg=typer.colors.BRIGHT_CYAN,
295
296
  bold=True,
296
297
  )
297
298
 
299
+ prompt += typer.style(
300
+ "💡 Check the README in your app directory to learn how to\n"
301
+ "customize it and how to run it using the Deployment Runtime.\n",
302
+ fg=typer.colors.GREEN,
303
+ bold=True,
304
+ )
305
+
298
306
  print(prompt)
@@ -21,6 +21,8 @@ Project dependencies are defined in `pyproject.toml`. Install them in an activat
21
21
  pip install -e .
22
22
  ```
23
23
 
24
+ > **Tip:** Learn how to configure your `pyproject.toml` file for Flower apps in [this guide](https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html).
25
+
24
26
  ## Experimental setup
25
27
 
26
28
  The dataset is divided into $num_clients partitions in an IID fashion, a partition is assigned to each ClientApp.
@@ -2,10 +2,15 @@
2
2
 
3
3
  ## Install dependencies and project
4
4
 
5
+ The dependencies are listed in the `pyproject.toml` and you can install them as follows:
6
+
5
7
  ```bash
6
8
  pip install -e .
7
9
  ```
8
10
 
11
+ > **Tip:** Your `pyproject.toml` file can define more than just the dependencies of your Flower app. You can also use it to specify hyperparameters for your runs and control which Flower Runtime is used. By default, it uses the Simulation Runtime, but you can switch to the Deployment Runtime when needed.
12
+ > Learn more in the [TOML configuration guide](https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html).
13
+
9
14
  ## Run with the Simulation Engine
10
15
 
11
16
  In the `$project_name` directory, use `flwr run` to run a local simulation:
@@ -1,9 +1,9 @@
1
1
  """$project_name: A Flower Baseline."""
2
2
 
3
3
  import torch
4
-
5
4
  from flwr.client import ClientApp, NumPyClient
6
5
  from flwr.common import Context
6
+
7
7
  from $import_name.dataset import load_data
8
8
  from $import_name.model import Net, get_weights, set_weights, test, train
9
9
 
@@ -76,5 +76,5 @@ def get_weights(net):
76
76
  def set_weights(net, parameters):
77
77
  """Apply parameters to an existing model."""
78
78
  params_dict = zip(net.state_dict().keys(), parameters)
79
- state_dict = OrderedDict({k: torch.tensor(v) for k, v in params_dict})
79
+ state_dict = OrderedDict({k: torch.from_numpy(v) for k, v in params_dict})
80
80
  net.load_state_dict(state_dict, strict=True)
@@ -1,15 +1,14 @@
1
1
  """$project_name: A Flower Baseline."""
2
2
 
3
- from typing import List, Tuple
4
-
5
3
  from flwr.common import Context, Metrics, ndarrays_to_parameters
6
4
  from flwr.server import ServerApp, ServerAppComponents, ServerConfig
7
5
  from flwr.server.strategy import FedAvg
6
+
8
7
  from $import_name.model import Net, get_weights
9
8
 
10
9
 
11
10
  # Define metric aggregation function
12
- def weighted_average(metrics: List[Tuple[int, Metrics]]) -> Metrics:
11
+ def weighted_average(metrics: list[tuple[int, Metrics]]) -> Metrics:
13
12
  """Do weighted average of accuracy metric."""
14
13
  # Multiply accuracy of each client by number of examples used
15
14
  accuracies = [num_examples * float(m["accuracy"]) for num_examples, m in metrics]
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,11 +12,12 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets[vision]>=0.5.0",
13
- "torch==2.5.1",
14
- "torchvision==0.20.1",
19
+ "torch==2.7.1",
20
+ "torchvision==0.22.1",
15
21
  ]
16
22
 
17
23
  [tool.hatch.metadata]
@@ -23,28 +29,23 @@ dev = [
23
29
  "black==24.2.0",
24
30
  "docformatter==1.7.5",
25
31
  "mypy==1.8.0",
26
- "pylint==3.2.6",
27
- "flake8==5.0.4",
28
- "pytest==6.2.4",
32
+ "pylint==3.3.1",
33
+ "pytest==7.4.4",
29
34
  "pytest-watch==4.2.0",
30
- "ruff==0.1.9",
35
+ "ruff==0.4.5",
31
36
  "types-requests==2.31.0.20240125",
32
37
  ]
33
38
 
34
39
  [tool.isort]
35
40
  profile = "black"
36
- known_first_party = ["flwr"]
37
41
 
38
42
  [tool.black]
39
43
  line-length = 88
40
- target-version = ["py38", "py39", "py310", "py311"]
44
+ target-version = ["py310", "py311", "py312"]
41
45
 
42
46
  [tool.pytest.ini_options]
43
47
  minversion = "6.2"
44
48
  addopts = "-qq"
45
- testpaths = [
46
- "flwr_baselines",
47
- ]
48
49
 
49
50
  [tool.mypy]
50
51
  ignore_missing_imports = true
@@ -82,11 +83,8 @@ wrap-summaries = 88
82
83
  wrap-descriptions = 88
83
84
 
84
85
  [tool.ruff]
85
- target-version = "py38"
86
+ target-version = "py310"
86
87
  line-length = 88
87
- select = ["D", "E", "F", "W", "B", "ISC", "C4"]
88
- fixable = ["D", "E", "F", "W", "B", "ISC", "C4"]
89
- ignore = ["B024", "B027"]
90
88
  exclude = [
91
89
  ".bzr",
92
90
  ".direnv",
@@ -111,7 +109,12 @@ exclude = [
111
109
  "proto",
112
110
  ]
113
111
 
114
- [tool.ruff.pydocstyle]
112
+ [tool.ruff.lint]
113
+ select = ["D", "E", "F", "W", "B", "ISC", "C4", "UP"]
114
+ fixable = ["D", "E", "F", "W", "B", "ISC", "C4", "UP"]
115
+ ignore = ["B024", "B027", "D205", "D209"]
116
+
117
+ [tool.ruff.lint.pydocstyle]
115
118
  convention = "numpy"
116
119
 
117
120
  [tool.hatch.build.targets.wheel]
@@ -120,18 +123,23 @@ packages = ["."]
120
123
  [tool.flwr.app]
121
124
  publisher = "$username"
122
125
 
126
+ # Point to your ServerApp and ClientApp objects
127
+ # Format: "<module>:<object>"
123
128
  [tool.flwr.app.components]
124
129
  serverapp = "$import_name.server_app:app"
125
130
  clientapp = "$import_name.client_app:app"
126
131
 
132
+ # Custom config values accessible via `context.run_config`
127
133
  [tool.flwr.app.config]
128
134
  num-server-rounds = 3
129
135
  fraction-fit = 0.5
130
136
  local-epochs = 1
131
137
 
138
+ # Default federation to use when running the app
132
139
  [tool.flwr.federations]
133
140
  default = "local-simulation"
134
141
 
142
+ # Local simulation federation with 10 virtual SuperNodes
135
143
  [tool.flwr.federations.local-simulation]
136
144
  options.num-supernodes = 10
137
145
  options.backend.client-resources.num-cpus = 2
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,8 +12,9 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets>=0.5.0",
13
19
  "torch==2.4.0",
14
20
  "trl==0.8.1",
@@ -27,10 +33,13 @@ packages = ["."]
27
33
  [tool.flwr.app]
28
34
  publisher = "$username"
29
35
 
36
+ # Point to your ServerApp and ClientApp objects
37
+ # Format: "<module>:<object>"
30
38
  [tool.flwr.app.components]
31
39
  serverapp = "$import_name.server_app:app"
32
40
  clientapp = "$import_name.client_app:app"
33
41
 
42
+ # Custom config values accessible via `context.run_config`
34
43
  [tool.flwr.app.config]
35
44
  model.name = "mistralai/Mistral-7B-v0.3"
36
45
  model.quantization = 4
@@ -56,12 +65,15 @@ strategy.fraction-fit = $fraction_fit
56
65
  strategy.fraction-evaluate = 0.0
57
66
  num-server-rounds = 200
58
67
 
68
+ # Dataset config (static for FlowerTune LLM Leaderboard)
59
69
  [tool.flwr.app.config.static]
60
70
  dataset.name = "$dataset_name"
61
71
 
72
+ # Default federation to use when running the app
62
73
  [tool.flwr.federations]
63
74
  default = "local-simulation"
64
75
 
76
+ # Local simulation federation with $num_clients virtual SuperNodes
65
77
  [tool.flwr.federations.local-simulation]
66
78
  options.num-supernodes = $num_clients
67
79
  options.backend.client-resources.num-cpus = 6
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,10 +12,11 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets>=0.5.0",
13
- "torch==2.5.1",
19
+ "torch==2.7.1",
14
20
  "transformers>=4.30.0,<5.0",
15
21
  "evaluate>=0.4.0,<1.0",
16
22
  "datasets>=2.0.0, <3.0",
@@ -23,10 +29,13 @@ packages = ["."]
23
29
  [tool.flwr.app]
24
30
  publisher = "$username"
25
31
 
32
+ # Point to your ServerApp and ClientApp objects
33
+ # Format: "<module>:<object>"
26
34
  [tool.flwr.app.components]
27
35
  serverapp = "$import_name.server_app:app"
28
36
  clientapp = "$import_name.client_app:app"
29
37
 
38
+ # Custom config values accessible via `context.run_config`
30
39
  [tool.flwr.app.config]
31
40
  num-server-rounds = 3
32
41
  fraction-fit = 0.5
@@ -34,13 +43,23 @@ local-epochs = 1
34
43
  model-name = "prajjwal1/bert-tiny" # Set a larger model if you have access to more GPU resources
35
44
  num-labels = 2
36
45
 
46
+ # Default federation to use when running the app
37
47
  [tool.flwr.federations]
38
48
  default = "localhost"
39
49
 
50
+ # Local simulation federation with 10 virtual SuperNodes
40
51
  [tool.flwr.federations.localhost]
41
52
  options.num-supernodes = 10
42
53
 
54
+ # Local simulation federation with 10 virtual SuperNodes
55
+ # making use of GPUs
43
56
  [tool.flwr.federations.localhost-gpu]
44
57
  options.num-supernodes = 10
45
58
  options.backend.client-resources.num-cpus = 4 # each ClientApp assumes to use 4CPUs
46
59
  options.backend.client-resources.num-gpus = 0.25 # at most 4 ClientApps will run in a given GPU
60
+
61
+ # Remote federation example for use with SuperLink
62
+ [tool.flwr.federations.remote-federation]
63
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
64
+ insecure = true # Remove this line to enable TLS
65
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,8 +12,9 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "jax==0.4.30",
13
19
  "jaxlib==0.4.30",
14
20
  "scikit-learn==1.6.1",
@@ -20,16 +26,27 @@ packages = ["."]
20
26
  [tool.flwr.app]
21
27
  publisher = "$username"
22
28
 
29
+ # Point to your ServerApp and ClientApp objects
30
+ # Format: "<module>:<object>"
23
31
  [tool.flwr.app.components]
24
32
  serverapp = "$import_name.server_app:app"
25
33
  clientapp = "$import_name.client_app:app"
26
34
 
35
+ # Custom config values accessible via `context.run_config`
27
36
  [tool.flwr.app.config]
28
37
  num-server-rounds = 3
29
38
  input-dim = 3
30
39
 
40
+ # Default federation to use when running the app
31
41
  [tool.flwr.federations]
32
42
  default = "local-simulation"
33
43
 
44
+ # Local simulation federation with 10 virtual SuperNodes
34
45
  [tool.flwr.federations.local-simulation]
35
46
  options.num-supernodes = 10
47
+
48
+ # Remote federation example for use with SuperLink
49
+ [tool.flwr.federations.remote-federation]
50
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
51
+ insecure = true # Remove this line to enable TLS
52
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,10 +12,11 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets[vision]>=0.5.0",
13
- "mlx==0.21.1",
19
+ "mlx==0.26.5",
14
20
  ]
15
21
 
16
22
  [tool.hatch.build.targets.wheel]
@@ -19,10 +25,13 @@ packages = ["."]
19
25
  [tool.flwr.app]
20
26
  publisher = "$username"
21
27
 
28
+ # Point to your ServerApp and ClientApp objects
29
+ # Format: "<module>:<object>"
22
30
  [tool.flwr.app.components]
23
31
  serverapp = "$import_name.server_app:app"
24
32
  clientapp = "$import_name.client_app:app"
25
33
 
34
+ # Custom config values accessible via `context.run_config`
26
35
  [tool.flwr.app.config]
27
36
  num-server-rounds = 3
28
37
  local-epochs = 1
@@ -32,8 +41,16 @@ hidden-dim = 32
32
41
  batch-size = 256
33
42
  lr = 0.1
34
43
 
44
+ # Default federation to use when running the app
35
45
  [tool.flwr.federations]
36
46
  default = "local-simulation"
37
47
 
48
+ # Local simulation federation with 10 virtual SuperNodes
38
49
  [tool.flwr.federations.local-simulation]
39
50
  options.num-supernodes = 10
51
+
52
+ # Remote federation example for use with SuperLink
53
+ [tool.flwr.federations.remote-federation]
54
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
55
+ insecure = true # Remove this line to enable TLS
56
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,8 +12,9 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "numpy>=2.0.2",
13
19
  ]
14
20
 
@@ -18,15 +24,26 @@ packages = ["."]
18
24
  [tool.flwr.app]
19
25
  publisher = "$username"
20
26
 
27
+ # Point to your ServerApp and ClientApp objects
28
+ # Format: "<module>:<object>"
21
29
  [tool.flwr.app.components]
22
30
  serverapp = "$import_name.server_app:app"
23
31
  clientapp = "$import_name.client_app:app"
24
32
 
33
+ # Custom config values accessible via `context.run_config`
25
34
  [tool.flwr.app.config]
26
35
  num-server-rounds = 3
27
36
 
37
+ # Default federation to use when running the app
28
38
  [tool.flwr.federations]
29
39
  default = "local-simulation"
30
40
 
41
+ # Local simulation federation with 10 virtual SuperNodes
31
42
  [tool.flwr.federations.local-simulation]
32
43
  options.num-supernodes = 10
44
+
45
+ # Remote federation example for use with SuperLink
46
+ [tool.flwr.federations.remote-federation]
47
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
48
+ insecure = true # Remove this line to enable TLS
49
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,11 +12,12 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets[vision]>=0.5.0",
13
- "torch==2.5.1",
14
- "torchvision==0.20.1",
19
+ "torch==2.7.1",
20
+ "torchvision==0.22.1",
15
21
  ]
16
22
 
17
23
  [tool.hatch.build.targets.wheel]
@@ -20,17 +26,28 @@ packages = ["."]
20
26
  [tool.flwr.app]
21
27
  publisher = "$username"
22
28
 
29
+ # Point to your ServerApp and ClientApp objects
30
+ # Format: "<module>:<object>"
23
31
  [tool.flwr.app.components]
24
32
  serverapp = "$import_name.server_app:app"
25
33
  clientapp = "$import_name.client_app:app"
26
34
 
35
+ # Custom config values accessible via `context.run_config`
27
36
  [tool.flwr.app.config]
28
37
  num-server-rounds = 3
29
38
  fraction-fit = 0.5
30
39
  local-epochs = 1
31
40
 
41
+ # Default federation to use when running the app
32
42
  [tool.flwr.federations]
33
43
  default = "local-simulation"
34
44
 
45
+ # Local simulation federation with 10 virtual SuperNodes
35
46
  [tool.flwr.federations.local-simulation]
36
47
  options.num-supernodes = 10
48
+
49
+ # Remote federation example for use with SuperLink
50
+ [tool.flwr.federations.remote-federation]
51
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
52
+ insecure = true # Remove this line to enable TLS
53
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,8 +12,9 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets[vision]>=0.5.0",
13
19
  "scikit-learn>=1.6.1",
14
20
  ]
@@ -19,17 +25,28 @@ packages = ["."]
19
25
  [tool.flwr.app]
20
26
  publisher = "$username"
21
27
 
28
+ # Point to your ServerApp and ClientApp objects
29
+ # Format: "<module>:<object>"
22
30
  [tool.flwr.app.components]
23
31
  serverapp = "$import_name.server_app:app"
24
32
  clientapp = "$import_name.client_app:app"
25
33
 
34
+ # Custom config values accessible via `context.run_config`
26
35
  [tool.flwr.app.config]
27
36
  num-server-rounds = 3
28
37
  penalty = "l2"
29
38
  local-epochs = 1
30
39
 
40
+ # Default federation to use when running the app
31
41
  [tool.flwr.federations]
32
42
  default = "local-simulation"
33
43
 
44
+ # Local simulation federation with 10 virtual SuperNodes
34
45
  [tool.flwr.federations.local-simulation]
35
46
  options.num-supernodes = 10
47
+
48
+ # Remote federation example for use with SuperLink
49
+ [tool.flwr.federations.remote-federation]
50
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
51
+ insecure = true # Remove this line to enable TLS
52
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup
@@ -1,3 +1,8 @@
1
+ # =====================================================================
2
+ # For a full TOML configuration guide, check the Flower docs:
3
+ # https://flower.ai/docs/framework/how-to-configure-pyproject-toml.html
4
+ # =====================================================================
5
+
1
6
  [build-system]
2
7
  requires = ["hatchling"]
3
8
  build-backend = "hatchling.build"
@@ -7,8 +12,9 @@ name = "$package_name"
7
12
  version = "1.0.0"
8
13
  description = ""
9
14
  license = "Apache-2.0"
15
+ # Dependencies for your Flower App
10
16
  dependencies = [
11
- "flwr[simulation]>=1.18.0",
17
+ "flwr[simulation]>=1.20.0",
12
18
  "flwr-datasets[vision]>=0.5.0",
13
19
  "tensorflow>=2.11.1,<2.18.0",
14
20
  ]
@@ -19,18 +25,29 @@ packages = ["."]
19
25
  [tool.flwr.app]
20
26
  publisher = "$username"
21
27
 
28
+ # Point to your ServerApp and ClientApp objects
29
+ # Format: "<module>:<object>"
22
30
  [tool.flwr.app.components]
23
31
  serverapp = "$import_name.server_app:app"
24
32
  clientapp = "$import_name.client_app:app"
25
33
 
34
+ # Custom config values accessible via `context.run_config`
26
35
  [tool.flwr.app.config]
27
36
  num-server-rounds = 3
28
37
  local-epochs = 1
29
38
  batch-size = 32
30
39
  verbose = false
31
40
 
41
+ # Default federation to use when running the app
32
42
  [tool.flwr.federations]
33
43
  default = "local-simulation"
34
44
 
45
+ # Local simulation federation with 10 virtual SuperNodes
35
46
  [tool.flwr.federations.local-simulation]
36
47
  options.num-supernodes = 10
48
+
49
+ # Remote federation example for use with SuperLink
50
+ [tool.flwr.federations.remote-federation]
51
+ address = "<SUPERLINK-ADDRESS>:<PORT>"
52
+ insecure = true # Remove this line to enable TLS
53
+ # root-certificates = "<PATH/TO/ca.crt>" # For TLS setup