Skip to content

Commit 6d3e62e

Browse files
committed
Merge branch 'main' of https://github.com/SEED-VT/FedDebug into main
merging Dr Gulzar request
2 parents 52b4755 + c7f4c5c commit 6d3e62e

File tree

2 files changed

+37
-15
lines changed

2 files changed

+37
-15
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
The ArXiv version of the manuscript is avaibable at : [FedDebug](https://arxiv.org/abs/2301.03553)
66

7+
For any question regarding FedDebug's artifact should be directed to Waris Gill at [[email protected] ](mailto:[email protected])
8+
79
FedDebug enables interactive and automated fault localization in Federation Learning (FL) applications. It adapts conventional debugging practices in FL with its breakpoint and fix & replay featur and it offers a novel differential testing technique to automatically identify the precise faulty clients.FedDebug tool artifact comprises a two-step process
810
- Interactive Debugging Constructs integrated with IBMFL framework via **FL simulation in a Docker Image**
911
- Automated Faulty Client Localization via **Google Colab Notebooks**
@@ -127,13 +129,13 @@ To check the functionality of `resume` command, restart the aggregator (`python
127129

128130
# 2. FedDebug: Faulty Client Localization
129131

130-
`FedDebug's` novel automated fault localization approach precisely identifies the faulty client without ever needing any test data or labels. To have a measurable impact on the global model, a faulty client’s model must behave differently than the regular clients. Every client in an FL application has the same model architecture, so their internal behaviors are comparable. Based on this insight, generates random inputs adapts differential testing to FL domain. It captures differences in the models’ execution via neuron activations instead of output labels to identify diverging behavior of a faulty client. Note that auto-generated data does not include the class label and thus we cannot use it as an oracle.
132+
At a given faulty round in an FL campaign, `FedDebug` can automatically identify faulty clients without needing test data or labels. The following steps provide a walk-through of this feature using both reconfigurable computational notebooks as well as local python setup.
131133

132134
## 2.1 Installation
133135

134136
### Google Colab Setup
135137

136-
> ***Make sure you configure notebook with GPU: Click Edit->notebook settings->hardware accelerator->GPU***
138+
> ***Make sure you configure the notebook with GPU: Click Edit->notebook settings->hardware accelerator->GPU***
137139
138140

139141
Copy & paste the following commands in the ***first cell*** of notebook (e.g., `artifact.ipynb`) on `Google Colab`.
@@ -152,9 +154,19 @@ sys.path.append("FedDebug/fault-localization/")
152154

153155
Now you can run the `artifact.ipynb` (<a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/artifact.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>). You can run notebooks containing `FedDebug` code with the above instructions. **Note:** *You can uncomment the commands instead of copy & pasting if above commands are already in the given notebook.*
154156

155-
157+
The notebook is configured to use the following default settings, where the first client (client ID 0) is faulty (with noisy labels that distort the global FL model).
156158

157-
159+
```
160+
args.model = "resnet50" # [resnet18, resnet34, resnet50, densenet121, vgg16]
161+
args.epochs = 2 # range 10-25
162+
args.dataset = "cifar10" # ['cifar10', 'femnist']
163+
args.clients = 5 # keep under 30 clients and use Resnet18, Resnet34, or Densenet to evaluate on Colab
164+
args.faulty_clients_ids = "0" # can be multiple clients separated by comma e.g. "0,1,2" but keep under args.clients clients and at max less than 7
165+
args.noise_rate = 1 # noise rate 0 to 1
166+
args.sampling = "iid" # [iid, "niid"]
167+
```
168+
169+
Once the entire notebook is executed, the logs report the progress and eventually print the faulty client's id. This is printed in the form `+++ Faulty Clients {0}` where 0 is the client ID for each auto-generated input (default is 10). It also reports the final localization accuracy.
158170

159171

160172

@@ -195,7 +207,7 @@ cd FedDebug/fault-localization
195207

196208
See `INSTALL.md` for further instructions on how to setup your environment for fault localization.
197209

198-
***Note: To run locally, make sure you have an NVIDA GPU in your machine.***
210+
***Note: To run locally, make sure you have an NVIDIA GPU in your machine.***
199211

200212

201213
## 2.2 Evaluations
@@ -230,7 +242,7 @@ Although `artifact.ipynb` is sufficient to evaluate any configuration of `FedDeb
230242

231243

232244

233-
>***Note: We have scaled down the the experiments (e.g., reduce the number of epochs, small number of clients, etc) to assist reviewers to quickly validate the fundamentals of `FedDebug` and fit with `Google Colab` resources. However, you are welcome to test it with any configuration mentioned in `FedDebug` evolutions. Furthermore, if you see an unexpected result, please increase the number of `epochs` to the value mention in `Section V: Evaluations` and read `Section V.D Threat To Validity section`.***
245+
>***Note: We have scaled down the the experiments (e.g., reduce the number of epochs, small number of clients, etc) to assist reviewers to quickly validate the fundamentals of `FedDebug` and fit with `Google Colab` resources. However, you are welcome to test it with any valid FL configuration. Furthermore, if you see an unexpected result, please increase the number of `epochs` to the value mention in `Section V: Evaluations` and read `Section V.D Threat To Validity section`.***
234246
235247

236248

@@ -246,4 +258,4 @@ Although `artifact.ipynb` is sufficient to evaluate any configuration of `FedDeb
246258

247259

248260

249-
- **`Reproduce_Table1-Table2.ipynb` <a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/Reproduce_Table1-Table2.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>:** Table 1 and Table 2 show the performance of `FedDebug` in IID and Non-IID data distribution settings. This notebook contains the representative settings of these two tables. Feel free to test other configurations as well.
261+
- **`Reproduce_Table1-Table2.ipynb` <a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/Reproduce_Table1-Table2.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>:** Table 1 and Table 2 show the performance of `FedDebug` in IID and Non-IID data distribution settings. This notebook contains the representative settings of these two tables. Feel free to test other configurations as well.

fault-localization/README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# 2. FedDebug: Faulty Client Localization
1+
# FedDebug: Faulty Client Localization
22

3-
`FedDebug's` novel automated fault localization approach precisely identifies the faulty client without ever needing any test data or labels. To have a measurable impact on the global model, a faulty client’s model must behave differently than the regular clients. Every client in an FL application has the same model architecture, so their internal behaviors are comparable. Based on this insight, generates random inputs adapts differential testing to FL domain. It captures differences in the models’ execution via neuron activations instead of output labels to identify diverging behavior of a faulty client. Note that auto-generated data does not include the class label and thus we cannot use it as an oracle.
3+
At a given faulty round in an FL campaign, `FedDebug` can automatically identify faulty clients without needing test data or labels. The following steps provide a walk-through of this feature using both reconfigurable computational notebooks as well as local python setup.
44

55
## 2.1 Installation
66

77
### Google Colab Setup
88

9-
> ***Make sure you configure notebook with GPU: Click Edit->notebook settings->hardware accelerator->GPU***
9+
> ***Make sure you configure the notebook with GPU: Click Edit->notebook settings->hardware accelerator->GPU***
1010
1111

1212
Copy & paste the following commands in the ***first cell*** of notebook (e.g., `artifact.ipynb`) on `Google Colab`.
@@ -25,9 +25,19 @@ sys.path.append("FedDebug/fault-localization/")
2525

2626
Now you can run the `artifact.ipynb` (<a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/artifact.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>). You can run notebooks containing `FedDebug` code with the above instructions. **Note:** *You can uncomment the commands instead of copy & pasting if above commands are already in the given notebook.*
2727

28-
28+
The notebook is configured to use the following default settings, where the first client (client ID 0) is faulty (with noisy labels that distort the global FL model).
2929

30-
30+
```
31+
args.model = "resnet50" # [resnet18, resnet34, resnet50, densenet121, vgg16]
32+
args.epochs = 2 # range 10-25
33+
args.dataset = "cifar10" # ['cifar10', 'femnist']
34+
args.clients = 5 # keep under 30 clients and use Resnet18, Resnet34, or Densenet to evaluate on Colab
35+
args.faulty_clients_ids = "0" # can be multiple clients separated by comma e.g. "0,1,2" but keep under args.clients clients and at max less than 7
36+
args.noise_rate = 1 # noise rate 0 to 1
37+
args.sampling = "iid" # [iid, "niid"]
38+
```
39+
40+
Once the entire notebook is executed, the logs report the progress and eventually print the faulty client's id. This is printed in the form `+++ Faulty Clients {0}` where 0 is the client ID for each auto-generated input (default is 10). It also reports the final localization accuracy.
3141

3242

3343

@@ -68,7 +78,7 @@ cd FedDebug/fault-localization
6878

6979
See `INSTALL.md` for further instructions on how to setup your environment for fault localization.
7080

71-
***Note: To run locally, make sure you have an NVIDA GPU in your machine.***
81+
***Note: To run locally, make sure you have an NVIDIA GPU in your machine.***
7282

7383

7484
## 2.2 Evaluations
@@ -103,7 +113,7 @@ Although `artifact.ipynb` is sufficient to evaluate any configuration of `FedDeb
103113

104114

105115

106-
>***Note: We have scaled down the the experiments (e.g., reduce the number of epochs, small number of clients, etc) to assist reviewers to quickly validate the fundamentals of `FedDebug` and fit with `Google Colab` resources. However, you are welcome to test it with any configuration mentioned in `FedDebug` evolutions. Furthermore, if you see an unexpected result, please increase the number of `epochs` to the value mention in `Section V: Evaluations` and read `Section V.D Threat To Validity section`.***
116+
>***Note: We have scaled down the the experiments (e.g., reduce the number of epochs, small number of clients, etc) to assist reviewers to quickly validate the fundamentals of `FedDebug` and fit with `Google Colab` resources. However, you are welcome to test it with any valid FL configuration. Furthermore, if you see an unexpected result, please increase the number of `epochs` to the value mention in `Section V: Evaluations` and read `Section V.D Threat To Validity section`.***
107117
108118

109119

@@ -119,4 +129,4 @@ Although `artifact.ipynb` is sufficient to evaluate any configuration of `FedDeb
119129

120130

121131

122-
- **`Reproduce_Table1-Table2.ipynb` <a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/Reproduce_Table1-Table2.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>:** Table 1 and Table 2 show the performance of `FedDebug` in IID and Non-IID data distribution settings. This notebook contains the representative settings of these two tables. Feel free to test other configurations as well.
132+
- **`Reproduce_Table1-Table2.ipynb` <a target="_blank" href="https://colab.research.google.com/github/SEED-VT/FedDebug/blob/main/fault-localization/Reproduce_Table1-Table2.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>:** Table 1 and Table 2 show the performance of `FedDebug` in IID and Non-IID data distribution settings. This notebook contains the representative settings of these two tables. Feel free to test other configurations as well.

0 commit comments

Comments
 (0)