Skip to content

Commit

Permalink
Update readme and run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-gao-GY committed Nov 14, 2023
1 parent c91f7ad commit 054f17f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
22 changes: 17 additions & 5 deletions examples/quickstart-xgboost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,36 @@ pip install -r requirements.txt

## Run Federated Learning with XGBoost and Flower

Afterwards you are ready to start the Flower server as well as the clients. You can simply start the server in a terminal as follows:
Afterwards you are ready to start the Flower server as well as the clients.
You can simply start the server in a terminal as follows:

```shell
python3 server.py
```

Now you are ready to start the Flower clients which will participate in the learning. To do so simply open two more terminal windows and run the following commands.
Now you are ready to start the Flower clients which will participate in the learning.
To do so simply open two more terminal windows and run the following commands.

Start client 1 in the first terminal:

```shell
python3 client.py
python3 client.py partition_id=0
```

Start client 2 in the second terminal:

```shell
python3 client.py
python3 client.py partition_id=1
```

You will see that XGBoost is starting a federated training. Look at the [code](https://github.com/adap/flower/tree/main/examples/quickstart-xgboost) and [tutorial](https://flower.dev/docs/framework/tutorial-quickstart-xgboost.html) for a detailed explanation.
You will see that XGBoost is starting a federated training.

Alternatively, you can use `run.sh` to run the same experiment in a single terminal as follows:

```shell
bash run.sh
```

Besides, we provide options to customise the experimental settings, including data partitioning and centralised/distributed evaluation (see `utils.py`).
Look at the [code](https://github.com/adap/flower/tree/main/examples/quickstart-xgboost)
and [tutorial](https://flower.dev/docs/framework/tutorial-quickstart-xgboost.html) for a detailed explanation.
2 changes: 1 addition & 1 deletion examples/quickstart-xgboost/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/

echo "Starting server"
python server.py &
sleep 3 # Sleep for 3s to give the server enough time to start
sleep 15 # Sleep for 15s to give the server enough time to start

for i in `seq 0 1`; do
echo "Starting client $i"
Expand Down

0 comments on commit 054f17f

Please sign in to comment.