Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Reason of Changing Total Number of Clients #95

Closed
hiyuchang opened this issue Jan 22, 2021 · 2 comments
Closed

The Reason of Changing Total Number of Clients #95

hiyuchang opened this issue Jan 22, 2021 · 2 comments

Comments

@hiyuchang
Copy link

Thank you for your nice codes.

I have a question about main_fedavg.py#L115:

args.client_num_in_total = client_num

While loading data, why should we change args.client_num_in_total = client_numinto 1000? What is the intuition behind this?

@chaoyanghe
Copy link
Member

chaoyanghe commented Jan 25, 2021

for cross-device FL, the client number is normally much larger than the worker number (the processes that execute the local SGD), so as the original FedAvg paper suggested, we need to do a client sampling to tackle the scalability issue. So here we set the client number equal to the number in the dataset and then do client sampling:

client_indexes = self.preprocessed_client_lists[self.round_idx]

Let's think about a concrete example in practice. We may have 1 million users in our cloud service, but you cannot ask all of them to join a round of federated training because of straggler, device failure, time zone gap, out of battery, user rejection, etc. So we sample those users who have a reliable connection and high intention to help the training. As for research, we can use random sampling to mimic this practice.

@hiyuchang
Copy link
Author

Thank you for your clear explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants