This framework enables to use a FL system with Pytorch.
It is being carried as my final thesis @ King's College London.
It currently works with the Human grasp dataset. Repo here.
Orchestrator process:
You can see the results of the experiments done here.
- Run the following commands:
wget http://stag.csail.mit.edu/datasets/classification_lite.zip -O temp.zip unzip temp.zip -d data/classification/ rm temp.zip
-
Spawning Python with the shell script (Recommended).
- Note: screen must be installed.
- Change the
PYTHON_PATH
in theinitialize.sh
file to point to your python where all the requirements are installed. - Add or remove as many clients as desired in the
initialize.sh
file. - Attention! The number and ports of clients in the
initialize.sh
file should match thehosts.yml
file. - Run the command:
DELETE_OLD_LOGS=1 RESTART_SCREEN=1 SPLIT_TYPE=<split_type> ./initialize.sh
- There are 3 env variables which can be set:
DELETE_OLD_LOGS
: if set to 1, removes all logs inlogs/
folder. Useful for new run.RESTART_SCREEN
: if set to 1, kills all current screens. Useful for new run.N_FRAMES
: Number of input frames.SPLIT_TYPE
: Can be set to 3 values (more information in dissemination):no_split
: No split in the dataset is performed.iid
: IID split type is performed.non-iid-a
: non-IID split type is performed.
- There are 3 env variables which can be set:
- If you want to attach to a running screen, run the command
screen -S <screen_name>
. - If you want to dettach from a screen, when attached, run the commands
ctrl+A ctrl+D
. - If you want to kill to an exiting screen, when attached, run the commands
ctrl+A ctrl+K Y
. - All connections and training status will be visible here.
-
Spawning Python manually (If screen not installed or more control desired).
- Induce the functionality from the
initialize.sh
file.
- Induce the functionality from the
-
Using Docker (Currently not compatible with GPU acceleration):
- Create the image by running:
make build
. - Run the image:
make run
. This will spawn the main server, secure aggregator and two clients. In order to increase the number of clients, modify thedocker-compose.yml
andhosts.yml
files.
- Create the image by running:
To start the frontend just run the command: python frontend/app.py
.
It is recommended to attach it to a service file and deploy it to a server in order to be always running.
To restart the frontend just perform the request: http://95.179.192.253:8002/restart
.
Here is a screenshot of the frontend currently running on http://95.179.192.253:8002/frontend.
- Create an 'orchestrator' with a frontend to manage all the connections and processes.
- Make proper documentation explaining how to select no split, IID or NON-IID dataset distributions.
- Repeat experiments with 5 clients.
- RAM optimizations.
- Perform aggregation even if one client is down for a certain period of time.
- RSA Encryption.
- Documentation of the frontend.
- Repeat experiments with multiple machines
- Limit resources of each client in order to be able to perform comparisons.
- Split dataset in multiple clients doesn't work for iid and non-iid