florist.api.servers.launch module

Functions and definitions to launch local servers.

launch_local_server(model, n_clients, server_address, n_server_rounds, batch_size, local_epochs, redis_host, redis_port)[source]

Launch a FL server locally.

Parameters:
  • model (Module) – (torch.nn.Module) The model to be used by the server. Should match the clients’ model.

  • n_clients (int) – (int) The number of clients that will report to this server.

  • server_address (str) – (str) The address the server should start at.

  • n_server_rounds (int) – (int) The number of rounds the training should run for.

  • batch_size (int) – (int) The size of the batch for training.

  • local_epochs (int) – (int) The number of epochs to run by the clients.

  • redis_host (str) – (str) the host name for the Redis instance for metrics reporting.

  • redis_port (str) – (str) the port for the Redis instance for metrics reporting.

Return type:

Tuple[str, Process]

Returns:

(Tuple[str, multiprocessing.Process]) the UUID of the server, which can be used to pull metrics from Redis, along with its local process object.