Skip to main content

Simulation framework for Private Federated Learning

Project description

pfl: Python framework for Private Federated Learning simulations

GitHub License CircleCI PyPI - Python Version

Documentation website: https://apple.github.io/pfl-research

pfl is a Python framework developed at Apple to empower researchers to run efficient simulations with privacy-preserving federated learning (FL) and disseminate the results of their research in FL. We are a team comprising engineering and research expertise, and we encourage researchers to publish their papers, with this code, with confidence.

The framework is not intended to be used for third-party FL deployments but the results of the simulations can be tremendously useful in actual FL deployments. We hope that pfl will promote open research in FL and its effective dissemination.

pfl provides several useful features, including the following:

  • Get started quickly trying out PFL for your use case with your existing model and data.
  • Iterate quickly with fast simulations utilizing multiple levels of distributed training (multiple processes, GPUs and machines).
  • Flexibility and expressiveness - when a researcher has a PFL idea to try, pfl has flexible APIs to express these ideas.
  • Scalable simulations for large experiments with state-of-the-art algorithms and models.
  • Support both PyTorch and TensorFlow.
  • Unified benchmarks for datasets that have been vetted for both PyTorch and TensorFlow.
  • Support other models in addition to neural networks, e.g. GBDTs. Switching between types of models is seamless.
  • Tight integration with privacy features, including common mechanisms for local and central differential privacy.

Results from benchmarks are maintained in this Weights & Biases report.

Installation

Installation instructions can be found here. pfl is available on PyPI and a full installation be done with pip:

pip install 'pfl[tf,pytorch,trees]'

Getting started - tutorial notebooks

To try out pfl immediately without installation, we provide several colab notebooks for learning the different components in pfl hands-on. <TODO push notebooks to colab>

Also available as Jupyter notebooks here.

Getting started - benchmarks

pfl aims to streamline the benchmarking process of testing hypotheses in the Federated Learning paradigm. The official benchmarks are available in the benchmarks directory, using a variety of realistic dataset-model combinations with and without differential privacy (yes, we do also have CIFAR10).

Copying these examples is a great starting point for doing your own research. See the quickstart on how to start converging a model on the simplest benchmark (CIFAR10) in just a few minutes.

Contributing

Researchers are invited to contribute to the framework. Please, see here for more details.

Citing pfl-research

@software{pfl2024,
  author = {Filip Granqvist and Congzheng Song and Áine Cahill and Rogier van Dalen and Martin Pelikan and Yi Sheng Chan and Xiaojun Feng and Natarajan Krishnaswami and Mona Chitnis and Vojta Jina},
  title = {{pfl}: simulation framework for accelerating research in Private Federated Learning},
  url = {https://github.com/apple/pfl-research},
  version = {0.0},
  year = {2024},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfl-0.2.0.tar.gz (161.8 kB view details)

Uploaded Source

Built Distribution

pfl-0.2.0-py3-none-any.whl (215.7 kB view details)

Uploaded Python 3

File details

Details for the file pfl-0.2.0.tar.gz.

File metadata

  • Download URL: pfl-0.2.0.tar.gz
  • Upload date:
  • Size: 161.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.6 Darwin/24.0.0

File hashes

Hashes for pfl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2dd1bd5dcbf094f30e6e64c1aac568838694a00b01bd1fe60a42373b6a68bbdb
MD5 207baabab8601318ef92efd0fee8ba87
BLAKE2b-256 664b1b661a548413881358d51832a7e3be52a7677ebe35783d25d8df38ae25f8

See more details on using hashes here.

File details

Details for the file pfl-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pfl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 215.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.6 Darwin/24.0.0

File hashes

Hashes for pfl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da71453eb488660f3336a26a00c3b186455e496c1694694fbd21205f406f9b7d
MD5 99fdb849462302f16417d4c79a5b27fc
BLAKE2b-256 3c4a82065e076b08752fd3db030f57379e89d85e00567049680dc51b5124ce83

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page