The Flower Team is excited to announce the release of Flower 1.10 stable and it’s packed with updates! Flower is a friendly framework for collaborative AI and data science. It makes novel approaches such as federated learning, federated evaluation, federated analytics, and fleet learning accessible to a wide audience of researchers and engineers.
Thanks to our contributors
We would like to give our special thanks to all the contributors who made the new version of Flower possible (in git shortlog
order):
Adam Narozniak
, Charles Beauville
, Chong Shen Ng
, Daniel J. Beutel
, Daniel Nata Nugraha
, Danny
, Gustavo Bertoli
, Heng Pan
, Ikko Eltociear Ashimine
, Javier
, Jiahao Tan
, Mohammad Naseri
, Robert Steiner
, Sebastian van der Voort
, Taner Topal
, Yan Gao
What’s new?
-
Introduce
flwr run
(beta) (#3810, #3826, #3880, #3807, #3800, #3814, #3811, #3809, #3819)Flower 1.10 ships the first beta release of the new
flwr run
command.flwr run
can run different projects usingflwr run path/to/project
, it enables you to easily switch between different federations usingflwr run . federation
and it runs your Flower project using either local simulation or the new (experimental) SuperExec service. This allows Flower to scale federatated learning from fast local simulation to large-scale production deployment, seamlessly. All projects generated withflwr new
are immediately runnable usingflwr run
. Give it a try: useflwr new
to generate a project and then run it usingflwr run
. -
Introduce run config (#3751, #3750, #3845, #3824, #3746, #3728, #3730, #3725, #3729, #3580, #3578, #3576, #3798, #3732, #3815)
The new run config feature allows you to run your Flower project in different configurations without having to change a single line of code. You can now build a configurable
ServerApp
andClientApp
that read configuration values at runtime. This enables you to specify config values likelearning-rate=0.01
inpyproject.toml
(under the[tool.flwr.app.config]
key). These config values can then be easily overridden viaflwr run --run-config learning-rate=0.02
, and read fromContext
usinglr = context.run_config["learning-rate"]
. Create a new project usingflwr new
to see run config in action. -
Generalize
client_fn
signature toclient_fn(context: Context) -> Client
(#3779, #3697, #3694, #3696)The
client_fn
signature has been generalized toclient_fn(context: Context) -> Client
. It now receives aContext
object instead of the (now depreacated)cid: str
.Context
allows accessingnode_id
,node_config
andrun_config
, among other things. This enables you to build a configurableClientApp
that leverages the new run config system.The previous signature
client_fn(cid: str)
is now deprecated and support for it will be removed in a future release. Useclient_fn(context: Context) -> Client
everywhere. -
Introduce new
server_fn(context)
(#3773, #3796, #3771)In addition to the new
client_fn(context:Context)
, a newserver_fn(context: Context) -> ServerAppComponents
can now be passed toServerApp
(instead of passing, for example,Strategy
, directly). This enables you to leverage the fullContext
on the server-side to build a configurableServerApp
. -
Relaunch all
flwr new
templates (#3877, #3821, #3587, #3795, #3875, #3859, #3760)All
flwr new
templates have been significantly updated to showcase new Flower features and best practices. This includes usingflwr run
and the new run config feature. You can now easily create a new project usingflwr new
and, after following the instructions to install it,flwr run
it. -
Introduce
flower-supernode
(preview) (#3353)The new
flower-supernode
CLI is here to replaceflower-client-app
.flower-supernode
brings full multi-app support to the Flower client-side. It also allows to pass--node-config
to the SuperNode, which is accessible in yourClientApp
viaContext
(using the newclient_fn(context: Context)
signature). -
Introduce node config (#3782, #3780, #3695, #3886)
A new node config feature allows you to pass a static configuration to the SuperNode. This configuration is read-only and available to every
ClientApp
running on that SuperNode. AClientApp
can access the node config viaContext
(context.node_config
). -
Introduce SuperExec (experimental) (#3605, #3723, #3731, #3589, #3604, #3622, #3838, #3720, #3606, #3602, #3603, #3555, #3808, #3724, #3658, #3629)
This is the first experimental release of Flower SuperExec, a new service that executes your runs. It’s not ready for production deployment just yet, but don’t hesitate to give it a try if you’re interested.
-
Add new federated learning with tabular data example (#3568)
A new code example exemplifies a federated learning setup using the Flower framework on the Adult Census Income tabular dataset.
-
Create generic adapter layer (preview) (#3538, #3536, #3540)
A new generic gRPC adapter layer allows 3rd-party frameworks to integrate with Flower in a transparent way. This makes Flower more modular and allows for integration into other federated learning solutions and platforms.
-
Refactor Flower Simulation Engine (#3581, #3471, #3804, #3468, #3839, #3806, #3861, #3543, #3472, #3829, #3469)
The Simulation Engine was significantly refactored. This results in faster and more stable simulations. It is also the foundation for upcoming changes that aim to provide the next level of performance and configurability in federated learning simulations.
-
Optimize Docker containers (#3591)
Flower Docker containers were optimized and updated to use that latest Flower framework features.
-
Improve logging (#3776, #3789)
Improved logging aims to be more concise and helpful to show you the details you actually care about.
-
Refactor framework internals (#3621, #3792, #3772, #3805, #3583, #3825, #3597, #3802, #3569)
As always, many parts of the Flower framework and quality infrastructure were improved and updated.
Documentation improvements
-
Add Korean translations (#3680)
-
Update translations (#3586, #3679, #3570, #3681, #3617, #3674, #3671, #3572, #3631)
-
Update documentation (#3864, #3688, #3562, #3641, #3384, #3634, #3823, #3793, #3707)
Updated documentation includes new install instructions for different shells, a new Flower Code Examples documentation landing page, new
flwr
CLI docs and an updated federated XGBoost code example.
Deprecations
-
Deprecate
client_fn(cid: str)
client_fn
used to have a signatureclient_fn(cid: str) -> Client
. This signature is now deprecated. Use the new signatureclient_fn(context: Context) -> Client
instead. The new argumentcontext
allows accessingnode_id
,node_config
,run_config
and otherContext
features. When running using the simulation engine (or usingflower-supernode
with a custom--node-config partition-id=...
),context.node_config["partition-id"]
will return anint
partition ID that can be used with Flower Datasets to load a different partition of the dataset on each simulated or deployed SuperNode. -
Deprecate passing
Server/ServerConfig/Strategy/ClientManager
toServerApp
directlyCreating
ServerApp
usingServerApp(config=config, strategy=strategy)
is now deprecated. Instead of passingServer/ServerConfig/Strategy/ClientManager
toServerApp
directly, pass them wrapped in aserver_fn(context: Context) -> ServerAppComponents
function, like this:ServerApp(server_fn=server_fn)
.ServerAppComponents
can hold references toServer/ServerConfig/Strategy/ClientManager
. In addition to that,server_fn
allows you to accessContext
(for example, to read therun_config
).
Incompatible changes
-
Remove support for
client_ids
instart_simulation
(#3699)The (rarely used) feature that allowed passing custom
client_ids
to thestart_simulation
function was removed. This removal is part of a bigger effort to refactor the simulation engine and unify how the Flower internals work in simulation and deployment. -
Remove
flower-driver-api
andflower-fleet-api
(#3418)The two deprecated CLI commands
flower-driver-api
andflower-fleet-api
were removed in an effort to streamline the SuperLink developer experience. Useflower-superlink
instead.