feat(baselines) Add GHBM implementation#7002
feat(baselines) Add GHBM implementation#7002RickZack wants to merge 30 commits intoflwrlabs:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Flower Baseline implementing the GHBM-family FL algorithms (GHBM, LocalGHBM, FedHBM) and provides scripts/documentation to reproduce CIFAR-10/100 non-IID experiments and comparisons.
Changes:
- Introduces a new
ghbmFlower app (ServerApp/ClientApp), model/dataset utilities, and custom strategies for GHBM momentum handling. - Adds experiment launch scripts for CIFAR-10 extreme non-IID (
alpha=0) across multiple algorithms. - Adds baseline-specific
pyproject.tomland a detailedREADME.mddescribing setup and reproduction steps.
Reviewed changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| baselines/ghbm/scripts/run_cifar10_noniid_localghbm.sh | Adds LocalGHBM CIFAR-10 extreme non-IID launcher configuration |
| baselines/ghbm/scripts/run_cifar10_noniid_ghbm.sh | Adds GHBM CIFAR-10 extreme non-IID launcher configuration |
| baselines/ghbm/scripts/run_cifar10_noniid_fedhbm.sh | Adds FedHBM CIFAR-10 extreme non-IID launcher configuration |
| baselines/ghbm/scripts/run_cifar10_noniid_fedcm.sh | Adds FedCM reproduction launcher using GHBM with tau=1 |
| baselines/ghbm/scripts/run_cifar10_noniid_fedavg.sh | Adds FedAvg launcher configuration for comparison |
| baselines/ghbm/pyproject.toml | Defines baseline packaging, dependencies, and Flower app configuration defaults |
| baselines/ghbm/ghbm/utils.py | Adds shared type aliases and a state-dict cloning helper |
| baselines/ghbm/ghbm/trainer.py | Adds local train/test loops plus gradient modifiers for momentum corrections |
| baselines/ghbm/ghbm/strategy.py | Adds evaluation scheduling/logging strategy and GHBM server-momentum strategy |
| baselines/ghbm/ghbm/server_app.py | Adds ServerApp entry point, W&B logging, evaluation summaries, and checkpoint saving |
| baselines/ghbm/ghbm/model.py | Adds LeNet and CIFAR ResNet(-20 etc.) implementations and a model factory |
| baselines/ghbm/ghbm/dataset.py | Adds CIFAR partitioning (Dirichlet and shard-based alpha=0), transforms, and loaders |
| baselines/ghbm/ghbm/config.py | Adds enums and parsing helpers for run-config values |
| baselines/ghbm/ghbm/client_app.py | Adds ClientApp train/evaluate handlers and algorithm-specific modifier preparation |
| baselines/ghbm/ghbm/algorithm.py | Adds client-side algorithm state handling for GHBM/LocalGHBM/FedHBM |
| baselines/ghbm/ghbm/init.py | Adds baseline package marker docstring |
| baselines/ghbm/README.md | Adds baseline documentation and reproduction instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba2023c245
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4badd74f14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f6e7a5de6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cde6820ba4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdf2c12358
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e93b8fd7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Updated loss calculation to use dataset size instead of batch size for more accurate validation results.
Issue
Description
Related issues/PRs
Proposal
This PR implements a Flower Baseline for the FL algorithms proposed in Zaccone et al., Communication-Efficient Federated Learning with Generalized Heavy-Ball Momentum
Explanation
The code implements GHBM, LocalGHBM and FedHBM as proposed in the official paper. The supported datasets are CIFAR-10/100 from Flower datasets, and a couple of CNNs (Lenet5-like and a ResNet-20), with the standard Dirichlet splitting and also the extreme non-iid splitting used in the paper (corresponding to setting the
alpha=0).Some bash scripts are included to run the simulation for the new algorithms and a couple of baselines, FedCM and FedAvg, for the extreme non-iid setting on ResNet-20. The corresponding plots are reported in the
README.md, reproducing the results proposed in Fig. 2 (middle) of the paper.Checklist
Any other comments?