"Scatter and Gather" is the standard workflow to implement Federated Averaging (FedAvg). This workflow follows the hub and spoke model for communicating the global model to each client for local training (i.e., "scattering") and aggregates the result to perform the global model update (i.e., "gathering").
NOTE: This example uses a Numpy-based trainer and will generate its data within the code.
You can follow the hello_world notebook or the following:
Follow the Installation instructions.
Use nvflare simulator to run the hello-examples:
nvflare simulator -w /tmp/nvflare/hello-numpy-sag -n 2 -t 2 hello-world/hello-numpy-sag/jobs/hello-numpy-sag
You can find the running logs and results inside the simulator's workspace/simulate_job
$ ls /tmp/nvflare/hello-numpy-sag/simulate_job/
app_server app_site-1 app_site-2 log.txt model models
For how to use the FLARE API to run this app, see this notebook.