Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity

Richeng Jin, Xiaofan He, Caijun Zhong, Zhaoyang Zhang, Tony Q. S. Quek, Huaiyu DaiarXiv 2023

Abstract

Communication overhead has become one of the major bottlenecks in the distributed training of deep neural networks. To alleviate the concern, various gradient compression methods have been proposed, and sign-based algorithms are of surging interest. However, SIGNSGD fails to converge in the presence of data heterogeneity, which is commonly observed in the emerging federated learning (FL) paradigm. Error feedback has been proposed to address the non-convergence issue. Nonetheless, it requires the workers to locally keep track of the compression errors, which renders it not suitable for FL since the workers may not participate in the training throughout the learning process. In this paper, we propose a magnitude-driven sparsification scheme, which addresses the non-convergence issue of SIGNSGD while further improving communication efficiency. Moreover, the local update scheme is further incorporated to improve the learning performance, and the convergence of the proposed method is established. The effectiveness of the proposed scheme is validated through experiments on Fashion-MNIST, CIFAR-10, and CIFAR-100 datasets.

Introduction

In distributed deep learning, communication overhead is a significant bottleneck. To mitigate this, sign-based algorithms like SIGNSGD have gained popularity. By transmitting only the sign of gradient coordinates (e.g., +1 or -1), SIGNSGD reduces message sizes by 32x compared to standard 32-bit floating-point representations.

However, SIGNSGD suffers from a critical failure mode: it often fails to converge under data heterogeneity (non-IID data), a common characteristic of Federated Learning (FL). In FL, different devices possess diverse datasets, and the magnitude of their local gradients carries vital information about these distributions. Discarding magnitude entirely prevents the server from correctly balancing updates from different workers. While error feedback can mitigate this, it typically requires workers to maintain local state, which is impractical in FL environments where worker participation is intermittent.

Deterministic SIGNSGD fails to converge in heterogeneous settings, while the proposed magnitude-aware scheme (with budget $B$) ensures convergence.

Methodology

To address these challenges, we introduce the sparsign compressor and two associated algorithms: SPARSIGNSGD and EF-SPARSIGNSGD.

The Sparsign Compressor

Unlike binary sign compressors, sparsign maps each gradient coordinate to a ternary set $\{-1, 0, 1\}$. The mapping is stochastic: a coordinate is set to its sign with a probability proportional to its magnitude $|g_{m,i}|$ and a budget parameter $B$. Coordinates with smaller magnitudes are more likely to be sparsified (set to 0). This magnitude-aware approach ensures that "important" gradients—those with larger magnitudes—are prioritized for transmission, effectively filtering data heterogeneity.

EF-SPARSIGNSGD

We further enhance the scheme by incorporating local updates (similar to FedAvg) and server-side error feedback. By confining error feedback to the server, we maintain "stateless" workers, making the algorithm robust to the dynamic participation patterns of cross-device FL. We provide theoretical guarantees that this ternary-based approach converges even with heterogeneous data, a property standard SIGNSGD lacks.

Experiments and Results

We evaluated our methods on Fashion-MNIST (3-layer FCN), CIFAR-10 (VGG-9), and CIFAR-100 (VGG-11). Data heterogeneity was simulated using a Dirichlet distribution $Dir(\alpha)$, where smaller $\alpha$ indicates higher heterogeneity.

Performance of the sparsign scheme across different sparsification levels (5%, 10%, 50%). Even with high sparsification, the method maintains convergence.

Key Performance Metrics

  • Convergence Speed: On Fashion-MNIST, EF-SPARSIGNSGD reached 74% accuracy in 65 rounds, significantly faster than the 193 rounds required by SIGNSGD.
  • Communication Efficiency: To achieve 74% accuracy on CIFAR-10, EF-SPARSIGNSGD required only $4.24 \times 10^8$ bits, outperforming TernGrad ($5.38 \times 10^8$ bits) and Noisy SIGNSGD ($9.89 \times 10^9$ bits).
  • Robustness to Heterogeneity: In highly non-IID CIFAR-100 scenarios ($\alpha=0.1$), EF-SPARSIGNSGD achieved ~46.8% accuracy, surpassing FedCom's ~40.6%.

Discussion

Our findings highlight that magnitude is a proxy for importance in non-IID settings. While signs suffice for IID data, magnitude allows the server to weigh "stronger opinions" from specific workers. The ternary representation $\{-1, 0, 1\}$ serves as a "sweet spot," capturing both direction and significance without the overhead of full precision. Furthermore, the inherent stochasticity of SGD helps the algorithm avoid zero-gradient traps during sparsification.

Conclusion

The proposed magnitude-aware sparsification scheme effectively fixes the convergence issues of SIGNSGD in heterogeneous environments while improving communication efficiency. While the budget parameter $B$ requires some tuning, the method's ability to support stateless workers makes it highly suitable for real-world Federated Learning. Future work will explore applying this magnitude-aware logic to other compression types and larger-scale models.

Summary updated

BibTeX
@misc{jin2023magnitude,
  author = {Richeng Jin and Xiaofan He and Caijun Zhong and Zhaoyang Zhang and Tony Q. S. Quek and Huaiyu Dai},
  title = {{Magnitude Matters: Fixing SIGNSGD Through Magnitude-Aware Sparsification in the Presence of Data Heterogeneity}},
  year = {2023},
  eprint = {2302.09634},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.09634},
}
Figure