fedscale.cloud package

Subpackages

Submodules

fedscale.cloud.client_manager module

class fedscale.cloud.client_manager.ClientManager(mode, args, sample_seed=233)[source]

Bases: object

clientOnHost(client_ids, host_id)[source]
clientSampler(client_id)[source]
getAllClients()[source]
getAllClientsLength()[source]
getAllMetrics()[source]
getClient(client_id)[source]
getClientLenOnHost(host_id)[source]
getClientReward(client_id)[source]
getClientSize(client_id)[source]
getClientsInfo()[source]
getCurrentclient_ids(host_id)[source]
getDataInfo()[source]
getFeasibleClients(cur_time)[source]
getSampleRatio(client_id, host_id, even=False)[source]
getUniqueId(host_id, client_id)[source]
get_completion_time(client_id, batch_size, local_steps, upload_size, download_size)[source]
get_median_reward()[source]
get_score(host_id, client_id)[source]
isClientActive(client_id, cur_time)[source]
next_client_id_to_run(host_id)[source]
registerClientScore(client_id, reward)[source]
registerDuration(client_id, batch_size, local_steps, upload_size, download_size)[source]
registerScore(client_id, reward, auxi=1.0, time_stamp=0, duration=1.0, success=True)[source]
registerSpeed(host_id, client_id, speed)[source]
register_client(host_id: int, client_id: int, size: int, speed: Dict[str, float], duration: float = 1) None[source]

Register client information to the client manager.

Parameters:
  • host_id (int) – executor Id.

  • client_id (int) – client Id.

  • size (int) – number of samples on this client.

  • speed (Dict[str, float]) – device speed (e.g., compuutation and communication).

  • duration (float) – execution latency.

register_feedback(client_id: int, reward: float, auxi: float = 1.0, time_stamp: float = 0, duration: float = 1.0, success: bool = True) None[source]

Collect client execution feedbacks of last round.

Parameters:
  • client_id (int) – client Id.

  • reward (float) – execution utilities (processed feedbacks).

  • auxi (float) – unprocessed feedbacks.

  • time_stamp (float) – current wall clock time.

  • duration (float) – system execution duration.

  • success (bool) – whether this client runs successfully.

resampleClients(num_of_clients, cur_time=0)[source]
select_participants(num_of_clients: int, cur_time: float = 0) List[int][source]

Select participating clients for current execution task.

Parameters:
  • num_of_clients (int) – number of participants to select.

  • cur_time (float) – current wall clock time.

Returns:

indices of selected clients.

Return type:

List[int]

fedscale.cloud.commons module

fedscale.cloud.config_parser module

fedscale.cloud.fllibs module

fedscale.cloud.fllibs.import_libs()[source]
fedscale.cloud.fllibs.init_dataset()[source]
fedscale.cloud.fllibs.init_model()[source]

fedscale.cloud.resource_manager module

class fedscale.cloud.resource_manager.ResourceManager(experiment_mode)[source]

Bases: object

Schedule training tasks across GPUs/CPUs

get_next_task(client_id=None)[source]
get_task_length() int[source]

Number of tasks left in the queue

Returns:

Number of tasks left in the queue

Return type:

int

has_next_task(client_id=None)[source]
register_tasks(clientsToRun)[source]
remove_client_task(client_id)[source]

Module contents