Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

FederalLab/OpenFed

Repository files navigation

OpenFed: A Comprehensive and Versatile Open-Source Federated Learning Framework

GitHub last commit Documentation Status PyPI PyPI - Python Version badge codecov license arXiv

News

OpenFed has been accepted to CVPRW23! (The Second Workshop on Federated Learning for Computer Vision)

Introduction

OpenFed is a foundational library for federated learning research and supports many research projects. It reduces the barrier to entry for both researchers and downstream users of Federated Learning by the targeted removal of existing pain points. For researchers, OpenFed provides a framework wherein new methods can be easily implemented and fairly evaluated against an extensive suite of benchmarks. For downstream users, OpenFed allows Federated Learning to be plug and play within different subject-matter contexts, removing the need for deep expertise in Federated Learning.

Install

PyTorch >= 1.5.1, python>=3.6

Build latest version from source with conda:

conda create -n openfed python=3.7 -y
conda activate openfed
git clone https://github.com/FederalLab/OpenFed.git
cd OpenFed
pip install -e .

Stable version: pip install openfed

Start Federated Learning in an Unprecedented Simple Way

  1. Install extra package:
pip install torchvision numpy
  1. Download MNIST dataset:
python examples/run.py --download
  1. Start a simulation (nproc means the total number of federated nodes):
python -m openfed.tools.simulator --nproc 6 examples/run.py
100%|██████████████████████████████████████████| 10/10 [00:01<00:00,  6.49it/s]

Citation

If you find this project useful in your research, please consider cite:

@misc{chen2021openfed,
      title={OpenFed: A Comprehensive and Versatile Open-Source Federated Learning Framework},
      author={Dengsheng Chen and Vince Tan and Zhilin Lu and Jie Hu},
      year={2021},
      eprint={2109.07852},
      archivePrefix={arXiv},
      primaryClass={cs.CR}
}

Contributing

We appreciate all contributions to improve OpenFed. Please refer to CONTRIBUTING.md for the contributing guideline.

License

OpenFed is released under the MIT License.