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 runcommand.flwr runcan run different projects usingflwr run path/to/project, it enables you to easily switch between different federations usingflwr run . federationand 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 neware immediately runnable usingflwr run. Give it a try: useflwr newto 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
ServerAppandClientAppthat read configuration values at runtime. This enables you to specify config values likelearning-rate=0.01inpyproject.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 fromContextusinglr = context.run_config["learning-rate"]. Create a new project usingflwr newto see run config in action. -
Generalize
client_fnsignature toclient_fn(context: Context) -> Client(#3779, #3697, #3694, #3696)The
client_fnsignature has been generalized toclient_fn(context: Context) -> Client. It now receives aContextobject instead of the (now depreacated)cid: str.Contextallows accessingnode_id,node_configandrun_config, among other things. This enables you to build a configurableClientAppthat 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) -> Clienteverywhere. -
Introduce new
server_fn(context)(#3773, #3796, #3771)In addition to the new
client_fn(context:Context), a newserver_fn(context: Context) -> ServerAppComponentscan now be passed toServerApp(instead of passing, for example,Strategy, directly). This enables you to leverage the fullContexton the server-side to build a configurableServerApp. -
Relaunch all
flwr newtemplates (#3877, #3821, #3587, #3795, #3875, #3859, #3760)All
flwr newtemplates have been significantly updated to showcase new Flower features and best practices. This includes usingflwr runand the new run config feature. You can now easily create a new project usingflwr newand, after following the instructions to install it,flwr runit. -
Introduce
flower-supernode(preview) (#3353)The new
flower-supernodeCLI is here to replaceflower-client-app.flower-supernodebrings full multi-app support to the Flower client-side. It also allows to pass--node-configto the SuperNode, which is accessible in yourClientAppviaContext(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
ClientApprunning on that SuperNode. AClientAppcan 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
flwrCLI docs and an updated federated XGBoost code example.
Deprecations
-
Deprecate
client_fn(cid: str)client_fnused to have a signatureclient_fn(cid: str) -> Client. This signature is now deprecated. Use the new signatureclient_fn(context: Context) -> Clientinstead. The new argumentcontextallows accessingnode_id,node_config,run_configand otherContextfeatures. When running using the simulation engine (or usingflower-supernodewith a custom--node-config partition-id=...),context.node_config["partition-id"]will return anintpartition 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/ClientManagertoServerAppdirectlyCreating
ServerAppusingServerApp(config=config, strategy=strategy)is now deprecated. Instead of passingServer/ServerConfig/Strategy/ClientManagertoServerAppdirectly, pass them wrapped in aserver_fn(context: Context) -> ServerAppComponentsfunction, like this:ServerApp(server_fn=server_fn).ServerAppComponentscan hold references toServer/ServerConfig/Strategy/ClientManager. In addition to that,server_fnallows you to accessContext(for example, to read therun_config).
Incompatible changes
-
Remove support for
client_idsinstart_simulation(#3699)The (rarely used) feature that allowed passing custom
client_idsto thestart_simulationfunction 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-apiandflower-fleet-api(#3418)The two deprecated CLI commands
flower-driver-apiandflower-fleet-apiwere removed in an effort to streamline the SuperLink developer experience. Useflower-superlinkinstead.
