NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

FL_PyTorch: optimization research simulator for federated learning

Konstantin Burlachenko, Samuel Horváth, Peter Richtárik

TL;DR

FL_PyTorch is a new open-source research simulator built on PyTorch designed to streamline the development and benchmarking of Federated Learning (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.

What Problem Does This Paper Address?

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 (like tracking the number of bits communicated) or easy debugging of multi-threaded processes.

Methods

The authors introduce FL_PyTorch, which 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: It 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.
  • 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.

Datasets

The paper evaluates the simulator using:

  • 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.

Key Insights and Ideas

  • Simulation vs. Deployment: By focusing on simulation rather than deployment, FL_PyTorch can offer a "Single Thread Mode" for easy debugging, which is nearly impossible in production-grade distributed frameworks.
  • The "Aha" of Abstraction: The authors show that almost all modern FL algorithms can be mapped to their 8-step template. This allows researchers to "plug-and-play" different server-side optimizers with various client-side local update strategies.
  • Hardware Utilization: The system addresses the "under-utilization" problem. Since FL clients often have small local datasets, running them sequentially on a powerful GPU is wasteful. FL_PyTorch's parallel worker threads ensure the hardware is fully saturated.

Key Results

  • SCAFFOLD with Compression: In a synthetic quadratic experiment, the authors found that 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, the experiments showed that increasing the number of local updates did not necessarily speed up convergence in strongly convex regimes, providing a cautionary note for "naive" combinations of local updates and compressed gradients.
  • Metric Tracking: The simulator successfully tracks 51+ parameters, including wall-clock time, GPU memory usage, and—crucially for FL—the exact number of bits sent from workers to the master.

Limitations and Future Work

  • Scale: While FL_PyTorch supports remote compute nodes via TCP/IP, it is primarily optimized for local simulation on workstations or small clusters, not for massive deployments to millions of actual mobile devices.
  • Model Library: The current implementation focuses on image classification (ResNets, VGGs) and quadratic losses. The authors plan to expand the library of pre-implemented models and datasets (e.g., NLP tasks).
  • Community Integration: As an open-source project, the authors expect the number of supported algorithms to grow through community contributions to their GitHub repository.

Summary updated

BibTeX
@inproceedings{burlachenko2021fl,
  author = {Konstantin Burlachenko and Samuel Horváth and Peter Richtárik},
  title = {{FL\_PyTorch: optimization research simulator for federated learning}},
  booktitle = {DistributedML@CoNEXT},
  year = {2021},
  doi = {10.1145/3488659.3493775},
}

Loading related content...

Figure