Clients
type
The type of the server.
simplea basic client who sends weight updates to the server.split_learninga client following the Split Learning algorithm. When this client is used,clients.do_testin configuration should be set asFalsebecause in split learning, we conduct the test on the server.fedavg_personalizeda client saves its local layers before sending the shared global model to the server after local training.self_supervised_learninga client to prepare the datasource for personalized learning based on self-supervised learning.mpca client that encrypts outbound model updates using multiparty computation processors.
total_clients
The total number of clients in a training session.
per_round
The number of clients selected in each round. It should be lower than total_clients.
do_test
Whether or not the clients compute test accuracies locally using local testsets. Computing test accuracies locally may be useful in certain cases, such as personalized federated learning.
Valid values: true or false
Note
If this setting is true and the configuration file has a results section, test accuracies of every selected client in each round will be logged in a .csv file.
comm_simulation
Whether client-server communication should be simulated with reading and writing files. This is useful when the clients and the server are launched on the same machine and share a filesystem.
Default value: true
compute_comm_time
When client-server communication is simulated, whether or not the transmission time — the time it takes for the payload to be completely transmitted to the server — should be computed with a pre-specified server bandwidth.
speed_simulation
Whether or not the training speed of the clients are simulated. Simulating the training speed of the clients is useful when simulating client heterogeneity, where asynchronous federated learning may outperform synchronous federated learning.
Valid values: true or false
If speed_simulation is true, we need to specify the probability distribution used for generating a sleep time (in seconds per epoch) for each client, using the following settings:
random_seed
This random seed is used exclusively for generating the sleep time (in seconds per epoch).
Default value: 1
max_sleep_time
This is used to specify the longest possible sleep time in seconds.
Default value: 60
simulation_distribution
Parameters for simulating client heterogeneity in training speed. It has an embedded parameter distribution, which can be set to normal for the normal distribution, zipf for the Zipf distribution (which is discrete), or pareto for the Pareto distribution (which is continuous).
For the normal distribution, we can specify mean for its mean value and sd for its standard deviation; for the Zipf distribution, we can specify s; and for the Pareto distribution, we can specify alpha to adjust how heavy-tailed it is. Here is an example:
speed_simulation = true
[clients.simulation_distribution]
distribution = "pareto"
alpha = 1
sleep_simulation
Should clients really go to sleep (false), or should we just simulate the sleep times (true)?
Default value: false
Simulating the sleep times — rather than letting clients go to sleep and measure the actual local training times including the sleep times — will be helpful to increase the speed of running the experiments, and to improve reproducibility, since every time the experiments run, the average training time will remain the same, and specified using the avg_training_time setting below.
avg_training_time
If we are simulating client training times, what is the average training time? When we are simulating the sleep times rather than letting clients go to sleep, we will not be able to use the measured wall-clock time for local training. As a result, we need to specify this value in lieu of the measured training time.
outbound_processors
A list of processors for the client to apply on the payload before sending it out to the server. Multiple processors are permitted.
outbound_feature_ndarraysConvert PyTorch tensor features into NumPy arrays before sending to the server, for the benefit of saving a substantial amount of communication overhead if the feature dataset is large. Must be placed afterfeature_unbatch.model_deepcopyReturn a deepcopy of the state_dict to prevent changing internal parameters of the model within clients.model_randomized_responseActivate randomized response on model parameters, must also setalgorithm.epsilonto activate.model_quantizeQuantize model parameters.model_quantize_qsgdQuantize model parameters with QSGD.unstructured_pruningProcess unstructured pruning on model weights. Themodel_compressprocessor needs to be applied after it in the configuration file or the communication overhead will not be reduced.structured_pruningProcess structured pruning on model weights. Themodel_compressprocessor needs to be applied after it in the configuration file or the communication overhead will not be reduced.model_compressCompress model parameters withZstandardcompression algorithm. Must be placed as the last processor if applied.model_encryptEncrypts the model parameters using homomorphic encryption.mpc_model_encrypt_additiveEncrypts model parameters using additive secret sharing for MPC.mpc_model_encrypt_shamirEncrypts model parameters using Shamir secret sharing for MPC (adds misbehaving-client detection).
mpc_debug_artifacts
When set to true, raw and encrypted client payloads are dumped to mpc_data/ for inspection. Defaults to false.
inbound_processors
A list of processors for the client to apply on the payload before receiving it from the server.
model_decompressDecompress model parameters. Must be placed as the first processor ifmodel_compressis applied on the server side.model_decryptDecrypts the model parameters using homomorphic encryption.
participating_clients_ratio
Percentage of clients participating in federated training out of all clients. The value should range from 0 to 1.