:hide-toc:
.. APPFL documentation master file, created by
sphinx-quickstart on Fri Oct 29 15:16:47 2021.
The landing page layout is built from raw HTML blocks styled by the
``.appfl-landing`` rules in ``_static/css/custom.css``.
=====
APPFL
=====
.. container:: appfl-landing
.. raw:: html
Privacy-preserving federated learning, from simulation to deployment.
APPFL (Advanced Privacy-Preserving Federated Learning) is an open-source framework for
prototyping FL algorithms on a laptop, simulating them at scale on HPC clusters, and
deploying them across real institutions, with differential privacy, secure communication,
and plug-and-play components.
Built together with researchers across national labs and universities Prototype on a laptop, then simulate hundreds or thousands of clients on GPU clusters with serial, MPI, or batched-MPI runs. Train across institutions over gRPC with SSL and authentication, on Globus Compute endpoints, or with Ray in the cloud. Swap aggregators, schedulers, trainers, privacy mechanisms, and compressors from a YAML file, or plug in your own. Architecture A server agent and client agents are assembled from independent components. Pick one of each in your configuration, or extend the base classes. Combines one or more client models into the global model. Decides when to aggregate as client updates arrive at different times. Runs local training and evaluation on each client's private data. Adds protection against data leakage on the client and server sides. Moves models and metadata between the server and clients. Shrinks model updates with error-bounded lossy compression. Install APPFL requires Python 3.8 or later. We recommend installing it in a fresh conda environment.
# Install APPFL from source
$ git clone https://github.com/APPFL/APPFL.git
$ cd APPFL && pip install -e ".[mpi,examples]"
$ cd examples
# Simulate FedAvg with 5 clients, serially
$ python serial/run_serial.py --num_clients 5 \
--server_config resources/configs/mnist/server_fedavg.yaml \
--client_config resources/configs/mnist/client_1.yaml
# Run asynchronous FedCompass over MPI
$ mpiexec -n 6 python mpi/run_mpi.py \
--server_config resources/configs/mnist/server_fedcompass.yaml \
--client_config resources/configs/mnist/client_1.yaml
Simulate at scale
Deploy for real
Customize everything
Six composable building blocks
Aggregator
Scheduler
Trainer
Privacy
Communicator
Compressor
Up and running in a minute
Need CUDA, compressors, or help with MPI? See the installation guide.
Run anywhere
The same server and client agents run on every backend, so moving from simulation to deployment only changes the communicator.
All clients in one process. The fastest way to debug synchronous algorithms.
SimulationOne process per client (or batch of clients) on a workstation or HPC cluster.
DeploymentCross-site training with SSL, token or Globus authentication, polling, and model chunking.
DeploymentServer-driven runs on HPC and cloud endpoints, with S3 or ProxyStore for large models.
DeploymentSpin up clusters of clients on AWS, GCP, or Azure.
Learn by example
Serial, MPI, and gRPC runs on MNIST.
Exchange only the head layer across clients.
3D spleen segmentation with MONAI Bundles.
Simulations on Polaris and Delta, multi-GPU training.
Host a gRPC server on EC2 for remote clients.
SSL certificates and token authentication.
Detect and fix data issues before training.
Weights & Biases, custom actions, scaling tests, and more.
Community
Questions, ideas, and contributions are welcome.
Citation
If you find APPFL useful for your research or development, please cite the following papers.
This material is based upon work supported by the U.S. Department of Energy, Office of Science, under contract number DE-AC02-06CH11357.
.. toctree:: :hidden: :maxdepth: 1 install/index tutorials/index users/index community/index contribution/index publication/index changelog/index