flwr-nightly 1.11.0.dev20240823__py3-none-any.whl → 1.12.0.dev20240906__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.
Potentially problematic release.
This version of flwr-nightly might be problematic. Click here for more details.
- flwr/cli/app.py +0 -2
- flwr/cli/new/new.py +24 -10
- flwr/cli/new/templates/app/LICENSE.tpl +202 -0
- flwr/cli/new/templates/app/README.baseline.md.tpl +127 -0
- flwr/cli/new/templates/app/README.flowertune.md.tpl +16 -6
- flwr/cli/new/templates/app/code/__init__.baseline.py.tpl +1 -0
- flwr/cli/new/templates/app/code/client.baseline.py.tpl +58 -0
- flwr/cli/new/templates/app/code/dataset.baseline.py.tpl +36 -0
- flwr/cli/new/templates/app/code/flwr_tune/{client.py.tpl → client_app.py.tpl} +50 -40
- flwr/cli/new/templates/app/code/flwr_tune/dataset.py.tpl +32 -2
- flwr/cli/new/templates/app/code/flwr_tune/models.py.tpl +0 -3
- flwr/cli/new/templates/app/code/flwr_tune/server_app.py.tpl +95 -0
- flwr/cli/new/templates/app/code/flwr_tune/strategy.py.tpl +83 -0
- flwr/cli/new/templates/app/code/model.baseline.py.tpl +80 -0
- flwr/cli/new/templates/app/code/server.baseline.py.tpl +46 -0
- flwr/cli/new/templates/app/code/strategy.baseline.py.tpl +1 -0
- flwr/cli/new/templates/app/code/utils.baseline.py.tpl +1 -0
- flwr/cli/new/templates/app/pyproject.baseline.toml.tpl +138 -0
- flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl +34 -7
- flwr/cli/run/run.py +2 -2
- flwr/client/__init__.py +0 -4
- flwr/client/grpc_rere_client/client_interceptor.py +13 -4
- flwr/client/supernode/app.py +3 -1
- flwr/common/config.py +14 -11
- flwr/common/telemetry.py +36 -30
- flwr/server/__init__.py +0 -4
- flwr/server/app.py +13 -13
- flwr/server/compat/app.py +0 -5
- flwr/server/driver/grpc_driver.py +1 -3
- flwr/server/run_serverapp.py +15 -1
- flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +19 -8
- flwr/server/superlink/fleet/grpc_rere/server_interceptor.py +11 -11
- flwr/server/superlink/state/in_memory_state.py +15 -15
- flwr/server/superlink/state/sqlite_state.py +10 -10
- flwr/server/superlink/state/state.py +8 -8
- flwr/simulation/run_simulation.py +23 -6
- flwr/superexec/__init__.py +0 -6
- flwr/superexec/app.py +3 -1
- {flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/METADATA +3 -3
- {flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/RECORD +43 -35
- flwr_nightly-1.12.0.dev20240906.dist-info/entry_points.txt +10 -0
- flwr/cli/new/templates/app/code/flwr_tune/app.py.tpl +0 -89
- flwr/cli/new/templates/app/code/flwr_tune/config.yaml.tpl +0 -34
- flwr/cli/new/templates/app/code/flwr_tune/server.py.tpl +0 -48
- flwr/cli/new/templates/app/code/flwr_tune/static_config.yaml.tpl +0 -11
- flwr_nightly-1.11.0.dev20240823.dist-info/entry_points.txt +0 -10
- {flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/WHEEL +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"""$project_name: A Flower / FlowerTune app."""
|
|
2
|
-
|
|
3
|
-
from $import_name.client_app import set_parameters
|
|
4
|
-
from $import_name.models import get_model
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Get function that will be executed by the strategy's evaluate() method
|
|
8
|
-
# Here we use it to save global model checkpoints
|
|
9
|
-
def get_evaluate_fn(model_cfg, save_every_round, total_round, save_path):
|
|
10
|
-
"""Return an evaluation function for saving global model."""
|
|
11
|
-
|
|
12
|
-
def evaluate(server_round: int, parameters, config):
|
|
13
|
-
# Save model
|
|
14
|
-
if server_round != 0 and (
|
|
15
|
-
server_round == total_round or server_round % save_every_round == 0
|
|
16
|
-
):
|
|
17
|
-
# Init model
|
|
18
|
-
model = get_model(model_cfg)
|
|
19
|
-
set_parameters(model, parameters)
|
|
20
|
-
|
|
21
|
-
model.save_pretrained(f"{save_path}/peft_{server_round}")
|
|
22
|
-
|
|
23
|
-
return 0.0, {}
|
|
24
|
-
|
|
25
|
-
return evaluate
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def get_on_fit_config():
|
|
29
|
-
"""
|
|
30
|
-
Return a function that will be used to construct the config
|
|
31
|
-
that the client's fit() method will receive.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
def fit_config_fn(server_round: int):
|
|
35
|
-
fit_config = {"current_round": server_round}
|
|
36
|
-
return fit_config
|
|
37
|
-
|
|
38
|
-
return fit_config_fn
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def fit_weighted_average(metrics):
|
|
42
|
-
"""Aggregate (federated) evaluation metrics."""
|
|
43
|
-
# Multiply accuracy of each client by number of examples used
|
|
44
|
-
losses = [num_examples * m["train_loss"] for num_examples, m in metrics]
|
|
45
|
-
examples = [num_examples for num_examples, _ in metrics]
|
|
46
|
-
|
|
47
|
-
# Aggregate and return custom metric (weighted average)
|
|
48
|
-
return {"train_loss": sum(losses) / sum(examples)}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Federated Instruction Tuning (static)
|
|
2
|
-
---
|
|
3
|
-
dataset:
|
|
4
|
-
name: $dataset_name
|
|
5
|
-
|
|
6
|
-
# FL experimental settings
|
|
7
|
-
num_clients: $num_clients # total number of clients
|
|
8
|
-
num_rounds: 200
|
|
9
|
-
partitioner:
|
|
10
|
-
_target_: flwr_datasets.partitioner.IidPartitioner
|
|
11
|
-
num_partitions: $num_clients
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[console_scripts]
|
|
2
|
-
flower-client-app=flwr.client:run_client_app
|
|
3
|
-
flower-server-app=flwr.server:run_server_app
|
|
4
|
-
flower-simulation=flwr.simulation.run_simulation:run_simulation_from_cli
|
|
5
|
-
flower-superexec=flwr.superexec:run_superexec
|
|
6
|
-
flower-superlink=flwr.server:run_superlink
|
|
7
|
-
flower-supernode=flwr.client:run_supernode
|
|
8
|
-
flwr=flwr.cli.app:app
|
|
9
|
-
flwr-clientapp=flwr.client.clientapp:flwr_clientapp
|
|
10
|
-
|
{flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/LICENSE
RENAMED
|
File without changes
|
{flwr_nightly-1.11.0.dev20240823.dist-info → flwr_nightly-1.12.0.dev20240906.dist-info}/WHEEL
RENAMED
|
File without changes
|