Abstract
Federated Learning (FL) has emerged as a promising technique for edge devices to collaboratively learn a shared machine learning model while keeping training data locally on the device, thereby removing the need to store and access the full data in the cloud. However, FL is difficult to implement, test and deploy in practice considering heterogeneity in common edge device settings, making it fundamentally hard for researchers to efficiently prototype and test their optimization algorithms. In this work, our aim is to alleviate this problem by introducing FL_PyTorch : a suite of open-source software written in python that builds on top of one the most popular research Deep Learning (DL) framework PyTorch. We built FL_PyTorch as a research simulator for FL to enable fast development, prototyping and experimenting with new and existing FL optimization algorithms. Our system supports abstractions that provide researchers with a sufficient level of flexibility to experiment with existing and novel approaches to advance the state-of-the-art. Furthermore, FL_PyTorch is a simple to use console system, allows to run several clients simultaneously using local CPUs or GPU(s), and even remote compute devices without the need for any distributed implementation provided by the user. FL_PyTorch also offers a Graphical User Interface. For new methods, researchers only provide the centralized implementation of their algorithm. To showcase the possibilities and usefulness of our system, we experiment with several well-known state-of-the-art FL algorithms and a few of the most common FL datasets.
Introduction
Federated Learning (FL) allows multiple edge devices to collaboratively train a model without sharing their raw data. However, for researchers, FL is notoriously difficult to prototype. Existing frameworks (like FedML or Flower) are often designed for production deployment, which introduces significant complexity in networking and distributed systems. This creates a "high entry bar" where researchers spend more time debugging the "plumbing" of a distributed system than the actual optimization math. Furthermore, many frameworks lack built-in tools for fine-grained analysis or easy debugging of multi-threaded processes.
FL_PyTorch is a new open-source research simulator built on PyTorch designed to streamline the development and benchmarking of FL optimization algorithms. By prioritizing a "research-first" approach, it offers a low entry barrier, a built-in GUI for real-time analysis, and high-performance parallelization on local hardware.
System Architecture and Methods
The core of FL_PyTorch centers on a Generalized Federated Averaging abstraction. Instead of writing complex distributed code, a researcher only needs to implement specific "template methods" (e.g., LocalGradient, ServerOpt, ClientState).
Key technical features include:
- Asynchronous Execution: The system uses thread pools and separate GPU CUDA streams for each worker, allowing a single machine to simulate many clients in parallel without the overhead of a full distributed implementation. This ensures hardware is fully saturated, addressing the under-utilization problem common when running small local datasets sequentially.
- Hybrid Interface: It provides both a Command Line Interface (CLI) and a comprehensive PyQt5 Graphical User Interface (GUI) for configuring experiments, monitoring progress, and interactive plotting.
- Extensive Algorithm Library: It comes pre-loaded with state-of-the-art FL algorithms including FedAVG, SCAFFOLD, FedProx, DIANA, and MARINA.
- Advanced Compression: It natively supports various gradient compression techniques (Rand-K, Top-K, Bernoulli, etc.) to study communication-efficient FL.
Experimental Setup
The paper evaluates the simulator using standard benchmarks:
- CIFAR-10: A federated version split uniformly among 100 clients.
- Synthetic Quadratic Problems: Used for debugging and verifying theoretical convergence rates in controlled settings (e.g., varying condition numbers and dimensionality).
- Standard PyTorch Support: The framework is designed to work with any dataset loadable via PyTorch’s
DataLoaders.
Results and Analysis
By focusing on simulation rather than deployment, FL_PyTorch offers a "Single Thread Mode" for easy debugging, which is nearly impossible in production-grade distributed frameworks. The authors show that almost all modern FL algorithms can be mapped to their 8-step template, allowing researchers to "plug-and-play" different server-side optimizers with various client-side local update strategies.
Key experimental findings include:
- SCAFFOLD with Compression: In synthetic quadratic experiments, dropping 60% of gradient coordinates (using Rand-K compression) had a negligible impact on convergence, suggesting that SCAFFOLD is highly amenable to compression.
- Local Update Diminishing Returns: For algorithms like MARINA and DIANA, experiments showed that increasing the number of local updates did not necessarily speed up convergence in strongly convex regimes.
- Metric Tracking: The simulator successfully tracks over 51 parameters, including wall-clock time, GPU memory usage, and the exact number of bits sent from workers to the master.
Conclusion and Future Work
While FL_PyTorch supports remote compute nodes via TCP/IP, it is primarily optimized for local simulation on workstations or small clusters. Future work includes expanding the model library to include NLP tasks and integrating more community-contributed algorithms. The framework aims to remain a "research-first" tool that lowers the barrier to entry for developing the next generation of federated optimization algorithms.
Summary updated