nvflare.app_common.ccwf.swarm_server_ctl module

class SwarmServerController(num_rounds: int, start_round: int = 0, task_name_prefix='swarm', start_task_timeout=10, configure_task_timeout=300, task_check_period: float = 0.5, job_status_check_interval: float = 2.0, participating_clients=None, result_clients=None, starting_client: str = '', max_status_report_interval: float = 90.0, progress_timeout: float = 3600.0, private_p2p: bool = True, aggr_clients=None, train_clients=None)[source]

Bases: ServerSideController

Constructor

Parameters:
  • 1. (num_rounds - the number of rounds to be performed. This is a workflow config parameter. Defaults to)

  • parameter. (start_round - the starting round number. This is a workflow config)

  • workflow. (task_name_prefix - the prefix for task names of this) – The workflow requires multiple tasks (e.g. config and start) between the server controller and the client. The full names of these tasks are <prefix>_config and <prefix>_start. Subclasses may send additional tasks. Naming these tasks with a common prefix can make it easier to configure task executors for FL clients.

  • clients. (participating_clients - the names of the clients that will participate in the job. None means all)

  • results. (result_clients - names of the clients that will receive final learning)

  • specified. (starting_client_policy - how to determine the starting client if the name is not explicitly) –

    Possible values are:

    ALL - all participating clients ANY - any one of the participating clients EMPTY - no result_clients DISALLOW - does not allow implicit - result_clients must be explicitly specified

  • timeout. (configure_task_timeout - time to wait for clients’ responses to the config task before)

  • client. (starting_client - name of the starting)

  • specified.

    Possible values are:

    ANY - any one of the participating clients (the first client) RANDOM - a random client EMPTY - no starting client DISALLOW - does not allow implicit - starting_client must be explicitly specified

  • task. (start_task_timeout - how long to wait for the starting client to finish the “start”) – If timed out, the job will be aborted. If the starting_client is not specified, then no start task will be sent. max_status_report_interval - the maximum amount of time allowed for a client to miss a status report. In other words, if a client fails to report its status for this much time, the client will be considered in trouble and the job will be aborted.

  • progress. (progress_timeout- the maximum amount of time allowed for the workflow to not make any) – In other words, at least one participating client must have made progress during this time. Otherwise, the workflow will be considered to be in trouble and the job will be aborted.

  • message. (end_workflow_timeout - timeout for ending workflow)

  • private. (private_p2p - whether to make peer-to-peer communications) – When set to True, P2P communications will be encrypted. Private P2P communication is an additional level of protection on basic communication security (such as SSL). Each pair of peers have their own encryption keys to ensure that only they themselves can understand their messages, even if the messages may be relayed through other sites (e.g. server). Different pairs of peers have different keys. Currently, private P2P is enabled only when the system is in secure mode. This is because key exchange between peers requires both sides to have PKI certificates and keys, which requires the project to be provisioned in secure mode.

prepare_config()[source]
start_controller(fl_ctx: FLContext)[source]

Starts the controller.

This method is called at the beginning of the RUN.

Parameters:
  • fl_ctx – the FL context. You can use this context to access services provided by the

  • example (framework. For)

  • your (you can get Command Register from it and register)

  • modules. (admin command)