From f19f3e71a9bd92afc3f3978881180b587f3bf36c Mon Sep 17 00:00:00 2001 From: Xiao-Chenguang <973990275@qq.com> Date: Tue, 22 Oct 2024 17:56:57 +0100 Subject: [PATCH] add instruction to readme --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6dee6f..bc5a472 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,28 @@ Make a copy of both the [config.yaml](./config.yaml) and [fedavg_demo.py](./exam python fedavg_demo.py ``` +Here we recommend you to use the [UV](https://docs.astral.sh/uv/) as a python environment manager to create a clean environment for the experiments. + +After install `uv`, you can create a new environment and run a `FedMind` example with the following command: +```bash +uv init FL-demo +cd FL-demo +source .uv/bin/activate + +uv add fedmind torchvision +wget https://raw.githubusercontent.com/Xiao-Chenguang/FedMind/refs/heads/main/examples/fedavg_demo.py +wget https://raw.githubusercontent.com/Xiao-Chenguang/FedMind/refs/heads/main/config.yaml + +uv run python fedavg_demo.py +``` + + ## Features -- Parallel training speed up. -- Serialization for limited resources. \ No newline at end of file +This FL framework provides two client simulation modes depending on your resources: +- Parallel training speed up for powerful resources. +- Serialization for limited resources. + +This is controlled by the parameter `NUM_PROCESS` which can be set in the [config.yaml](./config.yaml). +Setting `NUM_PROCESS` to 0 will use the serialization mode where each client trains sequentially in same global round. +Setting `NUM_PROCESS > 0` will use the parallel mode where `NUM_PROCESS` workers consume the clients tasks in parallel. +The recommended value for `NUM_PROCESS` is the number of **CPU cores** available.