fedscale.core package

Subpackages

Submodules

fedscale.core.client_manager module

class fedscale.core.client_manager.clientManager(mode, args, sample_seed=233)[source]

Bases: object

clientOnHost(clientIds, hostId)[source]
clientSampler(clientId)[source]
getAllClients()[source]
getAllClientsLength()[source]
getAllMetrics()[source]
getClient(clientId)[source]
getClientLenOnHost(hostId)[source]
getClientReward(clientId)[source]
getClientSize(clientId)[source]
getClientsInfo()[source]
getCompletionTime(clientId, batch_size, upload_step, upload_size, download_size)[source]
getCurrentClientIds(hostId)[source]
getDataInfo()[source]
getFeasibleClients(cur_time)[source]
getSampleRatio(clientId, hostId, even=False)[source]
getScore(hostId, clientId)[source]
getUniqueId(hostId, clientId)[source]
get_median_reward()[source]
isClientActive(clientId, cur_time)[source]
nextClientIdToRun(hostId)[source]
registerClient(hostId, clientId, size, speed, duration=1)[source]
registerClientScore(clientId, reward)[source]
registerDuration(clientId, batch_size, upload_step, upload_size, download_size)[source]
registerScore(clientId, reward, auxi=1.0, time_stamp=0, duration=1.0, success=True)[source]
registerSpeed(hostId, clientId, speed)[source]
register_client(hostId: int, clientId: int, size: int, speed: Dict[str, float], duration: float = 1) None[source]

Register client information to the client manager.

Parameters:
  • hostId (int) – executor Id.

  • clientId (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(clientId: 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:
  • clientId (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(numOfClients, 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.core.commons module

fedscale.core.config_parser module

fedscale.core.fllibs module

fedscale.core.fllibs.init_dataset()[source]
fedscale.core.fllibs.init_model()[source]

fedscale.core.resource_manager module

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

Bases: object

Schedule training tasks across GPUs/CPUs

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

Module contents