Closed iamyifan closed 1 year ago
@iamyifan
Thank you for your finding! The cause of this error is the wrong comment. I assumed that the type of clients
is ALWAYS a list of FedAvgClient
for the single-process version, while we have to use a list of ids for the MPI-backend version.
Could you update the comment?
@iamyifan
Thank you for your finding! The cause of this error is the wrong comment. I assumed that the type of
clients
is ALWAYS a list ofFedAvgClient
for the single-process version, while we have to use a list of ids for the MPI-backend version.Could you update the comment?
Yes, I've opened a PR and this Issue will be closed.
Hi developer.
When I am running FedAVG, setting
use_gradient=False
inFedAVGAPI
(a.k.a. updating the global model with clients' parameters) and initializing aFedAVGServer
object with a list of clients' IDs (according to the comment in source code,client
can be assigned with clients' IDs). A bug clearly emerged because in the functionreceive_local_parameters()
fromFedAVGServer
, the lines96-98
:The function above only supports the client object itself (
for c in self.clients
, wherec
is a client object). The same bug will happen inreceive_local_gradients()
, the lines90-94
, even thought I haven't try it with clients' IDs.For a temporary fix-up, I modified the source code in
FedAVGAPI
, the lines67-81
, from:to
In this way, the initialization in
FedAVGServer.clients
seems a little redundant, becauseFedAVGAPI
will reinitialize the whole list of clients in theFedAVGServer
object.