forked from NVIDIA/NVFlare
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
beb280b
commit 7ed0660
Showing
12 changed files
with
1,219 additions
and
1,100 deletions.
There are no files selected for viewing
1,580 changes: 585 additions & 995 deletions
1,580
examples/advanced/flower/fedprox/flower_fedprox.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
.../advanced/flower/fedprox/jobs/flwr_cifar10_tb_streaming/app/config/config_fed_client.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
{ | ||
# version of the configuration | ||
format_version = 2 | ||
|
||
# Client Computing Executors. | ||
executors = [ | ||
{ | ||
# tasks the executors are defined to handle | ||
tasks = ["train"] | ||
|
||
# This particular executor | ||
executor { | ||
|
||
# Executor name : ClientAPILauncherExecutor | ||
# This is an executor for Client API. The underline data exchange is using Pipe. | ||
path = "nvflare.app_common.executors.client_api_launcher_executor.ClientAPILauncherExecutor" | ||
|
||
args { | ||
|
||
# This executor take an component named "launcher" | ||
launcher_id = "launcher" | ||
|
||
# This executor needs Pipe component | ||
pipe_id = "pipe" | ||
|
||
# Timeout in seconds for waiting for a heartbeat from the training script. Defaults to 30 seconds. | ||
# Please refer to the class docstring for all available arguments | ||
heartbeat_timeout = 60 | ||
|
||
# format of the exchange parameters | ||
params_exchange_format = "numpy" | ||
|
||
# if the transfer_type is FULL, then it will be sent directly | ||
# if the transfer_type is DIFF, then we will calculate the | ||
# difference VS received parameters and send the difference | ||
params_transfer_type = "FULL" | ||
|
||
# if train_with_evaluation is true, the executor will expect | ||
# the custom code need to send back both the trained parameters and the evaluation metric | ||
# otherwise only trained parameters are expected | ||
train_with_evaluation = true | ||
|
||
} | ||
} | ||
} | ||
], | ||
|
||
# this defined an array of task data filters. If provided, it will control the data from server controller to client executor | ||
task_data_filters = [] | ||
|
||
# this defined an array of task result filters. If provided, it will control the result from client executor to server controller | ||
task_result_filters = [] | ||
|
||
components = [ | ||
{ | ||
# component id is "launcher" | ||
id = "launcher" | ||
|
||
# the class path of this component | ||
path = "nvflare.app_common.launchers.subprocess_launcher.SubprocessLauncher" | ||
|
||
args { | ||
# the launcher will invoke the script | ||
script = "python3 custom/client.py --node-id 0" | ||
# if launch_once is true, the SubprocessLauncher will launch once for the whole job | ||
# if launch_once is false, the SubprocessLauncher will launch a process for each task it receives from server | ||
launch_once = true | ||
} | ||
}, | ||
{ | ||
id = "pipe" | ||
path = "nvflare.fuel.utils.pipe.cell_pipe.CellPipe" | ||
args { | ||
mode = "PASSIVE" | ||
site_name = "{SITE_NAME}" | ||
token = "{JOB_ID}" | ||
root_url = "{ROOT_URL}" | ||
secure_mode = "{SECURE_MODE}" | ||
workspace_dir = "{WORKSPACE}" | ||
} | ||
}, | ||
{ | ||
id = "metrics_pipe" | ||
path = "nvflare.fuel.utils.pipe.cell_pipe.CellPipe" | ||
args { | ||
mode = "PASSIVE" | ||
site_name = "{SITE_NAME}" | ||
token = "{JOB_ID}" | ||
root_url = "{ROOT_URL}" | ||
secure_mode = "{SECURE_MODE}" | ||
workspace_dir = "{WORKSPACE}" | ||
} | ||
}, | ||
{ | ||
id = "metric_relay" | ||
path = "nvflare.app_common.widgets.metric_relay.MetricRelay" | ||
args { | ||
pipe_id = "metrics_pipe" | ||
event_type = "fed.analytix_log_stats" | ||
# how fast should it read from the peer | ||
read_interval = 0.1 | ||
} | ||
}, | ||
{ | ||
# we use this component so the client api `flare.init()` can get required information | ||
id = "client_api_config_preparer" | ||
path = "nvflare.app_common.widgets.external_configurator.ExternalConfigurator" | ||
args { | ||
component_ids = ["metric_relay"] | ||
} | ||
} | ||
] | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
.../advanced/flower/fedprox/jobs/flwr_cifar10_tb_streaming/app/config/config_fed_server.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
format_version = 2 | ||
task_data_filters = [] | ||
task_result_filters = [] | ||
workflows = [ | ||
{ | ||
id = "controller_launcher" | ||
path = "controller_launcher.ControllerLauncher" | ||
args { | ||
launcher_id = "launcher" | ||
} | ||
} | ||
] | ||
components = [ | ||
{ | ||
id = "launcher" | ||
path = "nvflare.app_common.launchers.subprocess_launcher.SubprocessLauncher" | ||
args { | ||
script = "python3 custom/server.py" | ||
launch_once = true | ||
} | ||
}, | ||
{ | ||
id = "tb_analytics_receiver" | ||
path = "nvflare.app_opt.tracking.tb.tb_receiver.TBAnalyticsReceiver" | ||
args.events = ["fed.analytix_log_stats"] | ||
} | ||
] | ||
} |
Oops, something went wrong.