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

Client-side model parameters NOT updated during the FedEx training #688

Open
krishnakanthnakka opened this issue Sep 4, 2023 · 1 comment

Comments

@krishnakanthnakka
Copy link

krishnakanthnakka commented Sep 4, 2023

In

self.trainer.cfg = self._cfg

the sampled hyperparams at the client are updated to self.trainer.cfg but they don't seem to take actual effect in client-side trainer.

For example, the dropout in the model (at https://github.com/alibaba/FederatedScope/blob/6dfe8d4474451c07cd7d69690a2df33a1f455f19/federatedscope/cv/model/cnn.py#L45C15-L45C22) is maintained by self.dropout but this variable is never updated during the FedEx training but instead model_config.dropout is updated which is never reused except during the initialization stage.

In other words, I think, similar to trainer.update() at

self.trainer.update(model_params)

we should have some function to update the dynamic hyperparameters in torch_trainer.py.

Please correct me if I missed something.

Edit:

The optimizer related hyperparams are indeed updated at

ctx.optimizer = get_optimizer(ctx.model,
but kindly check if model related hyperparams (dropout) updated somewhere...

@krishnakanthnakka krishnakanthnakka changed the title Client-side parameters NOT updated during the FedEx training Client-side model parameters NOT updated during the FedEx training Sep 4, 2023
@rayrayraykk
Copy link
Collaborator

Thanks for the suggestion, we noticed that if the cfg changes, the correct implementation is that the model (and the corresponding optimizer) should be re-instantiated. We will fix it ASAP.

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