How to run PPFL

APPFL provides users with the capabilities of simulating and training PPFL on either a single machine, a cluster, or multiple heterogeneous machines. We refer

  • simulation as running PPFL on a single machine or a cluster without actual data decentralization

  • training as running PPFL on multiple (heterogeneous) machines with actual decentralization of client datasets

Hence, we describe two types of PPFL run:

Simulating PPFL is useful for those who develop, test, and validate new models and algorithms for PPFL, whereas Training PPFL for those who consider actual PPFL settings in practice.

Sample template

Note

Before reading this section, please check out Tutorials for more detailed examples in notebooks.

For either simulation or training, a skeleton of the script for running PPFL can be written as follows:

 1from appfl import *
 2from appfl.config import *
 3
 4def main():
 5
 6    # load default configuration
 7    cfg: DictConfig = OmegaConf.structured(Config)
 8
 9    model = ... # user-defined model
10    data = ... # user-defined datasets
11
12    # The choice of PPFL runs
13
14if __name__ == "__main__":
15    main()

Some remarks are made as follows: