IntSGD: Floatless Compression of Stochastic Gradients

Konstantin Mishchenko, Bokun Wang, Dmitry Kovalev, Peter Richtárik

Abstract

IntSGD is a provably convergent, "floatless" gradient compression method designed to alleviate communication bottlenecks in distributed machine learning. By adaptively scaling floating-point gradients into integers before communication, IntSGD enables high-speed synchronization using efficient primitives like all-reduce and programmable network switches. Experimental results demonstrate that IntSGD matches the accuracy of full-precision SGD across various models, including ResNet18 and LSTM, while significantly reducing communication overhead and hardware requirements.

Introduction

Training massive AI models, such as BERT or ResNet, is often a multi-week endeavor. In distributed training environments, the primary bottleneck is frequently communication: every worker must share its computed gradients with all others. Standard compression techniques like quantization or sparsification often struggle with two critical issues:

  1. Compatibility: Efficient communication protocols like all-reduce (e.g., NVIDIA's NCCL) are often incompatible with complex compression schemes.
  2. Hardware Constraints: Emerging In-Network Aggregation (INA) technologies, such as SwitchML, utilize programmable network switches to sum gradients directly within the network. However, these switches typically support only integer arithmetic, not floating-point operations.

Previous integer-based rounding methods, such as Heuristic IntSGD, required expensive profiling steps to determine scaling factors and lacked mathematical guarantees for convergence.

Methodology

IntSGD replaces floating-point communication with a streamlined integer-based workflow:

  1. Adaptive Scaling: Instead of a fixed scale, each worker employs a scaling factor $\alpha_k$ that updates automatically based on a moving average of parameter changes from previous steps.
  2. Randomized Rounding: Gradients are multiplied by $\alpha_k$ and rounded to the nearest integer using an unbiased randomized process.
  3. Integer Aggregation: Since all workers share the same $\alpha_k$, integers can be summed directly by network switches or all-reduce primitives.
  4. Decoding: The aggregated sum is divided by the scale to return to the model's parameter space.

For heterogeneous data environments, the authors also introduced IntDIANA, which uses a "shift" mechanism to compress the difference between gradients, preventing integer overflow in 32-bit limits.

Key Insights and Ideas

IntSGD's primary contribution is bridging the gap between hardware-efficient integer arithmetic and the theoretical requirements of stochastic optimization.

Table 1: Comparison of IntSGD with other popular gradient compression algorithms. IntSGD is the only method that supports all-reduce, programmable switches, and adaptive scaling while maintaining provable convergence.
  • Provable Convergence: Unlike heuristic methods, the authors provide rigorous theory showing IntSGD matches the iteration complexity of standard SGD for convex, non-convex, smooth, and non-smooth functions.
  • The "Floatless" Advantage: By communicating only integers, the method is perfectly suited for programmable switches that lack floating-point support, making in-network aggregation practical.
  • Handling Persistent Variance: Unlike most compressors where variance vanishes at the optimum, integer rounding error persists. The authors developed a novel proof technique using a reserved error term to account for this persistent variance.

Experimental Results

The researchers evaluated IntSGD on standard benchmarks including ResNet18 (CIFAR-10) and a 3-layer LSTM (Wikitext-2).

Figure 1: Performance comparison on ResNet18 and LSTM. The top row shows the failure of Heuristic IntSGD to match SGD or converge on LSTM, while the bottom row shows IntSGD (8-bit and 32-bit) matching full-precision SGD performance.
  • Accuracy Parity: IntSGD (both 8-bit and 32-bit) perfectly matched the final accuracy of full-precision SGD. Notably, while Heuristic IntSGD failed to converge on the LSTM task, adaptive IntSGD converged smoothly.
  • Communication Speed: IntSGD was significantly faster than all-gather-based compressors. On ResNet18, IntSGD achieved an iteration time of ~65ms, compared to ~320ms for QSGD.
  • Bit-Width Efficiency: For large-scale models ($d \approx 10^{10}$), the authors demonstrated that coordinates can often be represented in fewer than 14 bits without accuracy loss.

Limitations and Future Work

While highly effective, IntSGD's compression ratio is naturally bounded by the bit-width of the integers used (e.g., 8-bit or 32-bit). It cannot reach the extreme compression ratios of "Top-K" sparsification, which may transmit only 0.1% of gradients. Additionally, performance relies on moving average hyperparameters ($\beta, \epsilon$). Future research will focus on increasing compression ratios while maintaining the "floatless" and all-reduce compatible properties.

Summary updated

BibTeX
@inproceedings{mishchenko2022intsgd,
  author = {Konstantin Mishchenko and Bokun Wang and Dmitry Kovalev and Peter Richtárik},
  title = {{IntSGD: Floatless Compression of Stochastic Gradients}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=pFyXqxChZc},
}
Figure