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

Sever config should be passed to the client when retrieving the initial parameters #3770

Open
scarere opened this issue Jul 10, 2024 · 1 comment
Labels
feature request This issue or comment suggests an additional feature.

Comments

@scarere
Copy link

scarere commented Jul 10, 2024

Describe the type of feature and its functionality.

Currently, when the Server class initialises the global model parameters by randomly sampling a client, it provides an empty config. In my particular case, the client requires information from the server in order to initialise the model and hence the model parameters.

The proposed feature is to allow information to be passed from the server to the client during initialisation of global model parameters

Describe step by step what files and adjustments are you planning to include.

I see two ways of implementing this.

1. Create an optional argument to the Server class in server.py.

Either a dictionary (eg. init_params_config) or a function similar to on_fit_config_fn (eg. on_init_config_fn). Although a function might be overkill if we don't have any variables to pass to it. Use this argument to get a config for parameter initialization and on line 281 of server.py change ins = GetParametersIns(config={}) to ins = GetParametersIns(config=self.init_params_config)

2. Use the config from on_fit_config_fn

Replace line 281 of server.py with:

config = self.strategy.on_fit_config_fn(-1) # server round is -1
ins = GetParametersIns(config=config)

Is there something else you want to add?

This seems like a really easy feature to implement that provides a lot of immediate value. It also just seems natural. Whats the point of GetParameterIns if it is only used in Server._get_initial_parameters() where an empty dict is passed to it?

@scarere scarere added the feature request This issue or comment suggests an additional feature. label Jul 10, 2024
@scarere
Copy link
Author

scarere commented Jul 15, 2024

Probably would be good to add the 'good first issue' label as this is a simple change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request This issue or comment suggests an additional feature.
Projects
None yet
Development

No branches or pull requests

1 participant