You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update flwr example
### Description
Update flwr example and cherry-pick #3495 and #3550
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Quick tests passed locally by running `./runtest.sh`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated.
---------
Co-authored-by: Georg Slamanig <[email protected]>
Co-authored-by: Chester Chen <[email protected]>
Copy file name to clipboardExpand all lines: docs/publications_and_talks.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Publications: 2022
32
32
* **2022-10** `Auto-FedRL: Federated Hyperparameter Optimization for Multi-institutional Medical Image Segmentation <https://arxiv.org/abs/2203.06338>`__ (`ECCV 2022 <https://eccv2022.ecva.net/>`__)
33
33
* **2022-10** `Joint Multi Organ and Tumor Segmentation from Partial Labels Using Federated Learning <https://link.springer.com/chapter/10.1007/978-3-031-18523-6_6>`__ (`DeCaF @ MICCAI 2022 <https://decaf-workshop.github.io/decaf-2022/>`__)
34
34
* **2022-10** `Split-U-Net: Preventing Data Leakage in Split Learning for Collaborative Multi-modal Brain Tumor Segmentation <https://arxiv.org/abs/2208.10553>`__ (`DeCaF @ MICCAI 2022 <https://decaf-workshop.github.io/decaf-2022/>`__)
35
-
* **2022-06** `Closing the Generalization Gap of Cross-silo Federated Medical Image Segmentation <https://openaccess.thecvf.com/content/CVPR2022/papers/Xu_Closing_the_Generalization_Gap_of_Cross-Silo_Federated_Medical_Image_Segmentation_CVPR_2022_paper.pdf>`__ (`CVPR 2022<https://cvpr2022.thecvf.com/>`__)
35
+
* **2022-06** `Closing the Generalization Gap of Cross-silo Federated Medical Image Segmentation <https://openaccess.thecvf.com/content/CVPR2022/papers/Xu_Closing_the_Generalization_Gap_of_Cross-Silo_Federated_Medical_Image_Segmentation_CVPR_2022_paper.pdf>`__ (CVPR 2022)
Note, this code is adapted from Flower's [app-pytorch](https://github.com/adap/flower/tree/main/examples/app-pytorch) example.
19
+
20
+
To be run inside NVFlare, we need to add the following sections to "pyproject.toml":
21
+
```
22
+
[tool.flwr.app.config]
23
+
num-server-rounds = 3
24
+
25
+
[tool.flwr.federations]
26
+
default = "local-simulation"
27
+
28
+
[tool.flwr.federations.local-simulation]
29
+
options.num-supernodes = 2
30
+
address = "127.0.0.1:9093"
31
+
insecure = true
32
+
```
33
+
34
+
You can adjust the num-server-rounds.
35
+
The number `options.num-supernodes` should match the number of NVFlare clients defined in [job.py](./job.py), e.g., `job.simulator_run(args.workdir, gpu="0", n_clients=2)`.
19
36
20
37
## 1. Install dependencies
21
38
If you haven't already, we recommend creating a virtual environment.
22
39
```bash
23
40
python3 -m venv nvflare_flwr
24
41
source nvflare_flwr/bin/activate
42
+
pip install -r ./requirements.txt
25
43
```
26
-
We recommend installing an older version of NumPy as torch/torchvision doesn't support NumPy 2 at this time.
27
-
```bash
28
-
pip install numpy==1.26.4
29
-
```
30
-
## 2.1 Run a simulation
31
44
32
-
To run flwr-pt job with NVFlare, we first need to install its dependencies.
33
-
```bash
34
-
pip install ./flwr-pt/
35
-
```
45
+
## 2.1 Run flwr-pt with NVFlare simulation
36
46
37
-
Next, we run 2 Flower clients and Flower Server in parallel using NVFlare's simulator.
47
+
We run 2 Flower clients and Flower Server in parallel using NVFlare's simulator.
Make sure your `pyproject.toml` files in the Flower apps contain an "address" field. This needs to be present as the `--federation-config` option of the `flwr run` command tries to override the `“address”` field.
64
-
Your `pyproject.toml` should include a section similar to this:
An NVFlare job will be generated at "./jobs" folder.
78
+
79
+
Then you can copy it inside the admin console's transfer folder and then run:
80
+
```bash
81
+
submit_job flwr-pt
73
82
```
74
-
The number `options.num-supernodes` should match the number of NVFlare clients defined in [job.py](./job.py), e.g., `job.simulator_run(args.workdir, gpu="0", n_clients=2)`.
0 commit comments