I am using the Flower and noticed that the number of clients selected for each round varies. For instance, in one of the logs I collected, I observed that in the first round, 5 clients were selected, while in the next round, 10 clients were selected, even though all clients were available. I would like to better understand the criteria or metrics Flower uses to select clients for each round. Is this controlled by specific parameters (such as fraction_fit
or min_fit_clients
)? Additionally, is there any randomness involved or factors based on the state of the clients (e.g., their availability or execution status)? I couldn’t find this information clearly explained in the documentation. Attached is an example of the log for context.
Hi,
Yes, the sampling is determined by the parameters in the strategies e.g. here’s an explanation from FedAvg docs FedAvg - Flower Framework.
Generally, the whole FL won’t start before there are enough min_available_clients. Once it’s met, the number of clients is the fraction, e.g. fraction_fit or min_fit_clients if the fraction_fit * available_clients is smaller than the min_fit_clients.
So, in the case of the first round, the number of clients can be smaller if not all of them have been registered yet, but the min_available_clients are available. (THB, in my personal opinion, is not a clear design choice, and I hope it’ll change in the future for a more clean solution).
The randomness in ClientManger is from the random module, so you can set the seed via random.seed
.