Libra: In-network Gradient Aggregation for Speeding up Distributed Sparse Deep Training

Heng Pan, Penglai Cui, Zhenyu Li, Ru Jia, Penghao Zhang, Leilei Zhang, Ye Yang, Jiahao Wu, Jianbo Dong, Zheng Cao, Qiang Li, Hongqiang Harry Liu, Laurent Mathy, Gaogang Xie

Abstract

Deep learning has been used in a wide range of areas and made a huge breakthrough. With the ever-increasing model size and training data volume, distributed deep learning emerges which utilizes a cluster to train a model in parallel. Unfortunately, the performance is often far from linear speedup due to the communication overhead between cluster nodes. To address this challenge, this paper designs and implements Libra, a network aggregator, that utilizes in-network computation to optimize the communication for distributed DL training in two aspects: 1) reduce active connections and 2) aggregate exchanged network packets. We implemented our Libra on Intel Tofino switches, customized a lightweight host stack and integrated it into an open-source training framework PS-lite. The experimental result shows that our Libra can achieve 1.5~4 times speedup.

Introduction

Distributed Deep Learning (DL) has become the cornerstone of modern AI, enabling the training of massive models on vast datasets. However, as clusters scale, the communication overhead between workers and parameter servers often becomes a bottleneck, preventing linear performance gains. While In-Network Aggregation (INA) has emerged as a promising solution by offloading gradient summation to programmable switches, existing implementations are primarily optimized for dense models.

In industrial applications like search engines and recommendation systems, models are inherently sparse. In these scenarios, only a small fraction of the billions of parameters—typically those in embedding layers—are updated during any given iteration. Traditional INA systems struggle with this sparsity, as they are designed for continuous streams of dense data. They either waste bandwidth by transmitting zero-valued gradients or fail to efficiently manage the unpredictable, key-value nature of sparse updates.

Sparse gradient updates in distributed training, where workers push specific parameter indices to the model.

The Libra Architecture

To address these challenges, we present Libra, an in-network aggregator specifically designed for sparse DL training. Libra optimizes communication by reducing active connections and aggregating network packets directly within the switch fabric.

Hot-Cold Separation

A key observation driving Libra's design is the "heavy-tail" distribution of parameter updates in sparse models. Empirical analysis shows that a tiny fraction of parameters, termed "hot" parameters, account for a significant majority of the total update traffic. By identifying these parameters through a brief sampling phase (typically 4-8% of the dataset), Libra can offload the most frequent updates to the switch while leaving the remaining "cold" updates to be handled by traditional parameter servers. This strategy allows offloading just 0.02% of a model's parameters to eliminate over half of the aggregation traffic.

Cumulative proportion of updates for top 'hot' parameters in Recommendation and Search tasks, demonstrating the skewed distribution that Libra exploits.

Technical Innovations

Libra overcomes the hardware limitations of programmable switches (such as the lack of native floating-point support) through several novel techniques:

  1. On-the-fly Floating-Point Summation: Libra implements a logarithmic number system and Taylor series approximations within the switch pipeline. This allows for high-precision 32-bit float addition (99.8% precision) without specialized hardware.
  2. Heat-Based Parameter Orchestration: To maximize switch throughput and avoid register access conflicts (pipeline stalls), Libra uses a placement strategy that maps parameters to hardware registers based on their update frequency ("heat").
  3. Reliability and Integration: Libra includes a per-packet acknowledgement mechanism and is integrated into the PS-lite framework, ensuring it can be used with existing DL workflows while maintaining training progress during failures.

Experimental Results

We evaluated Libra using both industrial benchmarks (Online Advertising and Search Engines) and open-source models (DeepLight, LSTM, NCF). Our results demonstrate that Libra achieves a 1.5x to 4x speedup in aggregation throughput compared to standard parameter server architectures like PS-lite. Notably, Libra is extremely lightweight, consuming only 3.21% of the on-chip memory on an Intel Tofino switch, leaving ample room for standard routing functions.

Conclusion

Libra demonstrates that sparse-aware in-network aggregation can significantly accelerate distributed DL training. By focusing on "hot" parameters and implementing efficient switch-side math, Libra bridges the gap between the requirements of modern sparse models and the constraints of programmable network hardware. Future work will explore scaling Libra to multi-rack topologies and integrating it with high-performance networking standards like RDMA.

Summary updated

BibTeX
@misc{pan2022libra,
  author = {Heng Pan and Penglai Cui and Zhenyu Li and Ru Jia and Penghao Zhang and Leilei Zhang and Ye Yang and Jiahao Wu and Jianbo Dong and Zheng Cao and Qiang Li and Hongqiang Harry Liu and Laurent Mathy and Gaogang Xie},
  title = {{Libra: In-network Gradient Aggregation for Speeding up Distributed Sparse Deep Training}},
  year = {2022},
  eprint = {2205.05243},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.05243},
}
Figure