refactor(baselines): Updated Floco baseline to Flower 1.26.0#6657
refactor(baselines): Updated Floco baseline to Flower 1.26.0#6657birnbaum wants to merge 4 commits intoflwrlabs:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Floco baseline to Flower 1.26.0 by migrating the baseline to the current message-/app-based API (ServerApp/ClientApp, Message, RecordDict, ArrayRecord/MetricRecord) and aligning the baseline’s config, scripts, and documentation accordingly.
Changes:
- Migrated Floco client/server/strategy to the Flower 1.26 app + message-based APIs.
- Updated baseline dependency/config in
pyproject.tomland added an experiment runner script. - Refreshed plots/results tooling and surfaced the baseline in the repo’s top-level README.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| baselines/floco/run.sh | Adds a convenience script to run all Floco/FedAvg experiments for both splits. |
| baselines/floco/pyproject.toml | Bumps Flower dependency to >=1.26.0, updates tooling targets, and updates config keys (e.g. fraction-train). |
| baselines/floco/floco/strategy.py | Ports Floco strategy to flwr.serverapp.strategy.FedAvg and message-based training/eval configuration + aggregation. |
| baselines/floco/floco/server_app.py | Refactors to ServerApp entrypoint, centralized eval callback, and result serialization. |
| baselines/floco/floco/client_app.py | Refactors to ClientApp train/evaluate handlers using Message + records; keeps Floco+ personalization via context.state. |
| baselines/floco/floco/model.py | Refactors model creation/state handling and updates simplex classifier implementation for the new API. |
| baselines/floco/floco/dataset.py | Adjusts Context import and typing updates for dataloader helpers. |
| baselines/floco/floco/plot_results.py | Updates results parsing/plotting to match the new JSON output layout and metric keys. |
| baselines/floco/_static/CIFAR10_Fold.png | Updated plot artifact for the Fold split. |
| baselines/floco/_static/CIFAR10_Dirichlet.png | Updated plot artifact for the Dirichlet split. |
| baselines/floco/README.md | Minor formatting tweaks and updated run instructions context. |
| README.md | Adds Floco to the top-level list of Flower baselines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._weights = torch.nn.ParameterList( | ||
| [_initialize_weight(self.weight) for _ in range(endpoints)] |
There was a problem hiding this comment.
In _SimplexLinear.__init__, _initialize_weight(self.weight) accesses self.weight, but weight is overridden as a property which depends on self._weights (not yet initialized). This will raise an AttributeError during initialization. Consider not overriding weight (override forward instead), or initialize _weights using the underlying Linear parameter via self._parameters["weight"]/a separately stored tensor shape before defining/using the computed weight.
| self._weights = torch.nn.ParameterList( | |
| [_initialize_weight(self.weight) for _ in range(endpoints)] | |
| base_weight = self._parameters["weight"] | |
| self._weights = torch.nn.ParameterList( | |
| [_initialize_weight(base_weight) for _ in range(endpoints)] |
|
Not sure about the two failing checks, the PR title seems to be in the right format and if I run |
Issue
Description
The Floco baseline was still based on Flower 1.18.0 and e.g. not using the new Message API.
Related issues/PRs
#4941
Proposal
Explanation
This PR updates the Floco baseline to Flower 1.26.0 by migrating client/server/strategy code to the current app/message-based API and aligning config/dependencies accordingly.
Main changes:
baselines/floco/run.shexecutable