Flower: A Friendly Federated Learning Research Framework

Daniel J. Beutel, Taner Topal, Akhil Mathur, Xinchi Qiu, Titouan Parcollet, Nicholas D. LanearXiv 2020

Abstract

Federated Learning (FL) has emerged as a promising technique for edge devices to collaboratively learn a shared prediction model, while keeping their training data on the device, thereby decoupling the ability to do machine learning from the need to store the data in the cloud. However, FL is difficult to implement realistically, both in terms of scale and systems heterogeneity. In this paper, we present Flower -- a comprehensive FL framework that distinguishes itself from existing platforms by offering new facilities to execute large-scale FL experiments and consider richly heterogeneous FL device scenarios. Our experiments show Flower can perform FL experiments up to 15M in client size using only a pair of high-end GPUs. Researchers can then seamlessly migrate experiments to real devices to examine other parts of the design space. We believe Flower provides the community with a critical new tool for FL study and development.

Introduction: Bridging the FL Reality Gap

While the theoretical promise of Federated Learning is significant, a substantial "reality gap" exists between research simulations and real-world deployments. Most existing research is conducted in highly controlled, small-scale simulations, often involving fewer than 100 homogeneous clients. In contrast, production-grade FL involves millions of devices with vastly different hardware capabilities, varying network speeds, and diverse software stacks.

Existing tools like TensorFlow Federated (TFF) or LEAF are excellent for simulation but struggle to scale to massive numbers or run on actual physical edge devices. Flower addresses these limitations by providing a unified infrastructure that handles everything from single-GPU simulations to massive deployments on heterogeneous fleets of smartphones and embedded devices.

Comparison of Flower against existing FL frameworks across key research and deployment dimensions.

Architecture and Core Abstractions

Flower’s architecture is built on core abstractions that decouple the algorithmic logic from the underlying execution environment:

  • The Strategy Abstraction: This defines the FL algorithm (e.g., FedAvg, FedProx). By isolating the logic for client selection and model aggregation, researchers can swap algorithms without modifying the underlying networking code.
  • Virtual Client Engine (VCE): This is the key to Flower's scalability. It allows a single machine to simulate thousands of concurrent clients by intelligently managing resources (CPU/VRAM) and only loading a client's model and data into memory when they are actively training.
  • Edge Client Engine: For real-world deployment, Flower provides a low-level protocol over gRPC that allows clients written in different languages (Java for Android, C++, Python) to communicate with a central Python server, ensuring framework and language agnosticism.
  • FedFS (Federating: Fast and Slow): This algorithm handles systems heterogeneity by using importance sampling and dynamic timeouts to ensure that slow devices (stragglers) contribute to the global model without stalling the training process.

Evaluation and Scalability

Flower was evaluated using a diverse range of datasets, including Amazon Book Reviews (15 million users), FEMNIST, and ImageNet (ILSVRC-2012).

Massive-Scale Performance

The framework successfully scaled to 15 million clients on the Amazon dataset, demonstrating convergence at mega-scales. The Virtual Client Engine allows these experiments to run on as little as a pair of high-end GPUs, proving that large-scale FL research does not require a massive server farm if memory is managed efficiently.

Flower supports significantly higher total and concurrent client counts than other research frameworks.

Real-Device Deployment

The authors demonstrated seamless migration from simulation to a heterogeneous fleet of Nvidia Jetson devices and Raspberry Pis. Profiling on real devices (e.g., Pixel 4, Galaxy S9) showed that while local training is the primary bottleneck, Flower's framework overhead is remarkably low (<100ms per round). Furthermore, the study quantified the trade-offs of heterogeneity: using CPU-based clients over GPU-based ones can increase training time by 27% but reduce energy consumption by 60%.

Conclusion

Flower provides the community with a critical tool for FL development, bridging the gap between simulation and reality. By enabling large-scale, framework-agnostic experiments on heterogeneous hardware, it paves the way for more realistic FL research, such as the first-ever reported federated training of ImageNet (achieving 59.1% Top-1 accuracy).

Summary updated

BibTeX
@misc{beutel2020flower,
  author = {Daniel J. Beutel and Taner Topal and Akhil Mathur and Xinchi Qiu and Titouan Parcollet and Nicholas D. Lane},
  title = {{Flower: A Friendly Federated Learning Research Framework}},
  year = {2020},
  eprint = {2007.14390},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.14390},
}
Figure