Flower 1.0.0
Highlights
- Stable Virtual Client Engine (accessible via
start_simulation
) - All
Client
/NumPyClient
methods are now optional - Configurable
get_parameters
- Tons of small API cleanups resulting in a more coherent developer experience
Thanks to our contributors
We would like to give our special thanks to all the contributors who made Flower 1.0 possible (in reverse GitHub Contributors order):
@rtaiello, @g-pichler, @rob-luke, @andreea-zaharia, @kinshukdua, @nfnt, @tatiana-s, @TParcollet, @vballoli, @negedng, @RISHIKESHAVAN, @hei411, @SebastianSpeitel, @AmitChaulwar, @Rubiel1, @FANTOME-PAN, @Rono-BC, @lbhm, @sishtiaq, @remde, @Jueun-Park, @architjen, @PratikGarai, @mrinaald, @zliel, @MeiruiJiang, @sandracl72, @gubertoli, @Vingt100, @MakGulati, @cozek, @jafermarq, @sisco0, @akhilmathurs, @CanTuerk, @mariaboerner1987, @pedropgusmao, @tanertopal, @danieljanes.
Incompatible changes
-
All arguments must be passed as keyword arguments (#1338)
Pass all arguments as keyword arguments, positional arguments are not longer supported. Code that uses positional arguments (e.g.,
start_client("127.0.0.1:8080", FlowerClient())
) must add the keyword for each positional argument (e.g.,start_client(server_address="127.0.0.1:8080", client=FlowerClient())
). -
Introduce configuration object
ServerConfig
instart_server
andstart_simulation
(#1317)Instead of a config dictionary
{"num_rounds": 3, "round_timeout": 600.0}
,start_server
andstart_simulation
now expect a configuration object of typeflwr.server.ServerConfig
.ServerConfig
takes the same arguments that as the previous config dict, but it makes writing type-safe code easier and the default parameters values more transparent. -
Rename built-in strategy parameters for clarity (#1334)
The following built-in strategy parameters were renamed to improve readability and consistency with other API's:
fraction_eval
-->fraction_evaluate
min_eval_clients
-->min_evaluate_clients
eval_fn
-->evaluate_fn
-
Update default arguments of built-in strategies (#1278)
All built-in strategies now use
fraction_fit=1.0
andfraction_evaluate=1.0
, which means they select all currently available clients for training and evaluation. Projects that relied on the previous default values can get the previous behaviour by initializing the strategy in the following way:strategy = FedAvg(fraction_fit=0.1, fraction_evaluate=0.1)
-
Add
server_round
toStrategy.evaluate
(#1334)The
Strategy
methodevaluate
now receives the current round of federated learning/evaluation as the first parameter. -
Add
server_round
andconfig
parameters toevaluate_fn
(#1334)The
evaluate_fn
passed to built-in strategies likeFedAvg
now takes three parameters: (1) The current round of federated learning/evaluation (server_round
), (2) the model parameters to evaluate (parameters
), and (3) a config dictionary (config
). -
Rename
rnd
toserver_round
(#1321)Several Flower methods and functions (
evaluate_fn
,configure_fit
,aggregate_fit
,configure_evaluate
,aggregate_evaluate
) receive the current round of federated learning/evaluation as their first parameter. To improve reaability and avoid confusion with random, this parameter has been renamed fromrnd
toserver_round
. -
Move
flwr.dataset
toflwr_baselines
(#1273)The experimental package
flwr.dataset
was migrated to Flower Baselines. -
Remove experimental strategies (#1280)
Remove unmaintained experimental strategies (
FastAndSlow
,FedFSv0
,FedFSv1
). -
Rename
Weights
toNDArrays
(#1258, #1259)flwr.common.Weights
was renamed toflwr.common.NDArrays
to better capture what this type is all about. -
Remove antiquated
force_final_distributed_eval
fromstart_server
(#1258, #1259)The
start_server
parameterforce_final_distributed_eval
has long been a historic artefact, in this release it is finally gone for good. -
Make
get_parameters
configurable (#1242)The
get_parameters
method now accepts a configuration dictionary, just likeget_properties
,fit
, andevaluate
. -
Replace
num_rounds
instart_simulation
with newconfig
parameter (#1281)The
start_simulation
function now accepts a configuration dictionaryconfig
instead of thenum_rounds
integer. This improves the consistency betweenstart_simulation
andstart_server
and makes transitioning between the two easier.
New features
-
Support Python 3.10 (#1320)
The previous Flower release introduced experimental support for Python 3.10, this release declares Python 3.10 support as stable.
-
Make all
Client
andNumPyClient
methods optional (#1260, #1277)The
Client
/NumPyClient
methodsget_properties
,get_parameters
,fit
, andevaluate
are all optional. This enables writing clients that implement, for example, onlyfit
, but no other method. No need to implementevaluate
when using centralized evaluation! -
Enable passing a
Server
instance tostart_simulation
(#1281)Similar to
start_server
,start_simulation
now accepts a fullServer
instance. This enables users to heavily customize the execution of eperiments and opens the door to running, for example, async FL using the Virtual Client Engine. -
Update code examples (#1291, #1286, #1282)
Many code examples received small or even large maintenance updates, among them are
scikit-learn
simulation_pytorch
quickstart_pytorch
quickstart_simulation
quickstart_tensorflow
advanced_tensorflow
-
Remove the obsolete simulation example (#1328)
Removes the obsolete
simulation
example and renamesquickstart_simulation
tosimulation_tensorflow
so it fits withs the naming ofsimulation_pytorch
-
Update documentation (#1223, #1209, #1251, #1257, #1267, #1268, #1300, #1304, #1305, #1307)
One substantial documentation update fixes multiple smaller rendering issues, makes titles more succinct to improve navigation, removes a deprecated library, updates documentation dependencies, includes the
flwr.common
module in the API reference, includes support for markdown-based documentation, migrates the changelog from.rst
to.md
, and fixes a number of smaller details! -
Minor updates