Closed hiyuchang closed 3 years ago
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: https://github.com/FedML-AI/FedML/blob/79825b44f3860e6b4aa077326a964c585c8f1e9b/fedml_api/distributed/fedavg/FedAvgServerManager.py#L66
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.
Thank you for your clear explanation.
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?