Skip to content

Commit

Permalink
Document upgrade process to Flower 1.0 (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes committed Jul 18, 2022
1 parent 6654b6d commit c0f5b2d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Flower's design goals was to make this simple. Read on to learn more.
example-jax-from-centralized-to-federated
fedbn-example-pytorch-from-centralized-to-federated
recommended-env-setup
upgrade-to-flower-1.0
changelog
faq

Expand Down
28 changes: 28 additions & 0 deletions doc/source/upgrade-to-flower-1.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Upgrade to Flower 1.0
=====================

Flower 1.0 is finally here! Along with new features, Flower 1.0 provides a stable foundation for future growth. Compared to Flower 0.19 (and other 0.x series releases), there are a few breaking changes that might make it necessary to change the code of existing 0.x-series projects.

Install update
--------------

Install the latest version of Flower using `python -m pip install -U flwr` (or `python -m pip install -U flwr[simulation]`).

Required changes
----------------

A few breaking changes require small manual updates:

- Subclasses of ``NumPyClient``: change ``def get_parameters(self):``` to ``def get_parameters(self, config):``
- Subclasses of ``Client``: change ``def get_parameters(self):``` to ``def get_parameters(self, ins: GetParametersIns):``
- Rename ``parameters_to_weights`` to ``parameters_to_ndarrays`` and ``weights_to_parameters`` to ``ndarrays_to_parameters``
- ``start_simulation``: change ``num_rounds=1`` to ``config={"num_rounds": 1}``
- Strategy initialization: if the strategy relies on the default values for ``fraction_fit`` and ``fraction_eval``, set ``fraction_fit`` and ``fraction_eval`` manually to ``0.1``. Projects that do not manually create a strategy (by calling ``start_server`` or ``start_simulation`` without passing a strategy instance) should now initialize FedAvg with ``fraction_fit`` and ``fraction_eval`` set to ``0.1``.

Optional improvements
---------------------

Along with the necessary changes above, there are a number of potential improvements that just became possible:

- Remove "placeholder" methods from subclasses of ``Client`` or ``NumPyClient``. If you, for example, use server-side evaluation, then empy placeholder implementations of ``evaluate`` are no longer necessary.
- Configure the round timeout via ``start_simulation``: ``start_simulation(..., config={"num_rounds": 3, "round_timeout": 600.0}, ...)``

0 comments on commit c0f5b2d

Please sign in to comment.