Bliss is a lightweight, deployment‑ready client selection strategy for federated learning (FL) that minimizes wall‑clock time‑to‑accuracy. Sourced from and built on [FedScale], keeping the same CLI and runtime so you can run jobs exactly as you would on FedScale.
Bliss co‑designs predictive sampling, adaptive local training, and server‑side coordination:
- Before each round, the server gathers real‑time system features (CPU, network, battery) and historical feedback (past utility, past success) per client, feeds them to a regressor, and predicts next‑round utility to guide sampling.
- Selected clients run adaptive local training that trades communication for computation, removing the need for post‑hoc system penalties in the utility function.
- We integrate Oort‑style robustness (server pacer for round deadlines, utility clipping, outlier removal) so the components reinforce one another.
Bliss lives alongside FedScale so you can use all of FedScale’s datasets, models, and runtime while swapping in Bliss for client selection.
Bliss provides two environments: CPU and GPU. Pick one.
# From the repo root (this project alongside FedScale code)
conda env create -f environment_CPU.yml # CPU-only setup
# or
conda env create -f environment_GPU.yml # GPU-enabled setup
# Activate (the YAML sets the environment name, typically "bliss")
conda activate bliss
# Install FedScale (editable) from the checked-out source
pip install -e .If you plan to use GPUs, install a compatible NVIDIA CUDA toolkit/driver for your hardware.
Run:
bash benchmark/dataset/download.sh download <name_of_dataset>Inspect benchmark/dataset/download.sh to configure the download and to see the available dataset names.
From the FedScale repo root, submit a job with your config:
python docker/driver.py submit configs/<your_config>.yml- Your
configs/*.ymlfile holds runtime args and hyperparameters (e.g.,ps_ip,worker_ips, GPU counts,batch_size,sampling_strategy,gradient_policy, and related hparams). - To use Bliss sampling, set the sampling strategy to Bliss in your config (see examples in
configs/).
When adaptive_training: false in your config, the execution is:
-
docker/driver.py- Loads config, extracts hardware args (
ps_ip,worker_ips, GPU counts), buildsexecutor_configs, launches executors on the distributed machines, then launchesaggregator.py.
- Loads config, extracts hardware args (
-
aggregator.py(server)-
Creates queues to communicate with executors (a global round queue and per‑client callback queue via
event_monitor()). -
Runs the main loop tracking simulated wall‑clock time.
-
Uses
ClientManager(fromclient_manager.py) to:- Check client availability per round,
- Select participants,
- Track per‑round performance and metadata via
client_metadata.py.
-
Interacts with
thirdparty/bliss/oort.py(Oort implementation) andthirdparty/bliss/bliss.py(Bliss selection logic).
-
-
executor.py(clients)- Initializes frameworks (PyTorch/TensorFlow wrappers), partitions data, connects to the server over gRPC.
- Enters an event loop: sleeps,
client_ping()when idle, and executes server‑sent events to update/train/test/shutdown. - For PyTorch runs (
conf.engine == commons.PYTORCH), creates aTorchClientfromtorch_client.pywhich performs the actual local train/test.
Adaptive mode: when
adaptive_training: true, some responsibilities shift toadaptive_torch_client.py. (Out of scope here; see code comments for details.)
Repo Root
|---- configs/ # All configuration files used for experiments
|---- notebooks/ # Notebooks for analysis and figure generation
|---- images/ # Figures used in the report/README
|---- run_global_loggings/ # Aggregated logs from evaluation runs
# FedScale runtime (selected)
|---- docker/
|---- fedscale/
| |---- cloud/ # Aggregator, Executors, Client manager, etc.
| |---- edge/
| |---- utils/
| |---- dataloaders/
| |---- utils
|---- thirdparty/bliss/
|---- bliss.py # Bliss sampling
|---- oort.py # Oort strategy (for robustness mechanisms)
-
Start from the provided files in
configs/and customize:- Cluster:
ps_ip,worker_ips,num_gpusper host. - Training:
dataset,model,batch_size,lr,rounds,deadline. - Selection:
sampling_strategy: bliss(or oort, random, etc.), related hparams. - Execution:
engine: pytorch,adaptive_training: false(for the flow above).
- Cluster:
Run with:
python docker/driver.py submit configs/<experiment>.ymlLogs and metrics will appear in your run‑specific directories, and global summaries in run_global_loggings/.
- Figures: see
images/(generated from the notebooks). - Notebooks: see
notebooks/for end‑to‑end analysis and plot generation. - Logs: see
run_global_loggings/for consolidated evaluation logs.
This project is sourced from FedScale and integrates with its runtime and datasets.
Issues and PRs are welcome - open a GitHub issue in this repo.
Happy federating! 🎉