Installation

Open Federated Learning consists of a core package set and 3 optional package sets:

  1. The core OpenFL packages require no machine learning frameworks (all numpy-based). This includes the logic for the aggregagtor, collaborator, network, and model/data interfaces.

  2. The PyTorch packages for model and data baseclasses to simplify porting PyTorch models to OpenFL. (Optional)

  3. The TensorFlow packages for model and data baseclasses to simplify porting TensorFlow models to OpenFL. (Optional)

  4. The FeTS-AI packages, as a submodule, that contains the FeTS-AI model and data classes. (Optional, requires submodule init)

Our scripts create a Python 3 virtual environment at ./venv which we use to run our python scripts. You can use the make file to either install these packages in this virtual-environment, or to create wheel files for you to install in another environment.

Requirements

On each machine in your federation, you will need:

  1. Python 3.5+

  2. Python virtual environments

Note

You can install virtual environment support in your Python3 installation via:

$ python3 -m pip install --user virtualenv

If you have trouble installing the virtual environment, make sure you have Python 3 installed on your OS. For example, on Ubuntu:

$ sudo apt-get install python3-pip

See the official Python website for more details.

Installing In The OpenFL Virtual environment

To install the core OpenFL package in ./venv, navigate to the root OpenFL directory and run:

$ make install_openfl

This will create the virtual environment install the core OpenFL packages.

Note

The Python version used will be the same Python version referenced as Python3 by your system.

For the optional PyTorch packages, run:

$ make install_openfl_pytorch

Note

You will need to install pytorch and torchvision as detailed here: Pytorch website. To install in the virtual environment, use pip as: venv/bin/pip

For the optional TensorFlow packages, run:

$ make install_openfl_tensorflow

Finally, to download the FeTS-AI algorithms, need to initialize the submodule and run the make recipe:

$ git submodule update --init --recursive
$ make install_fets

(Optional) Building Wheel Files

If you want to install OpenFL and related optional packages in another Python3 environment, you can build the wheel files with the make commands:

$ make openfl_whl
$ make openfl_pytorch_whl
$ make openfl_tensorflow_whl
$ make fets_whl

Note

Running OpenFL in containers (e.g. Docker, Singularity) is natural solution to simplify deployment, and fairly straight-forward. We welcome contributions towards such a solution.