IntSGD: Adaptive Floatless Compression of Stochastic Gradients

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

TL;DR

IntSGD is a "floatless" compression framework for distributed training that replaces floating-point communication with adaptive integer rounding. By intelligently scaling gradients before rounding, it achieves the same theoretical convergence rates as full-precision SGD while remaining compatible with high-performance hardware primitives like all-reduce and in-network aggregation.

What Problem Does This Paper Address?

In distributed machine learning, the "communication bottleneck" is a well-known hurdle: as models grow larger, the time spent synchronizing gradients between workers often exceeds the time spent computing them.

To solve this, researchers use lossy compression (quantization or sparsification). However, most existing methods have a hidden catch: they aren't compatible with all-reduce, the most efficient communication protocol used in modern clusters. Instead, they often rely on all-gather, which doesn't scale as well. Furthermore, emerging hardware like programmable network switches (e.g., SwitchML) can aggregate data "in-flight" but only support simple integer arithmetic, not complex floating-point operations.

Prior attempts to use integer-only communication relied on heuristics to scale gradients, which often led to poor convergence or required expensive "profiling" steps to find the right scaling factors.

Comparison of distributed SGD algorithms and their supported features.

Methods

The authors introduce IntSGD, which follows a simple but powerful pipeline:

  1. Adaptive Scaling: Each worker multiplies its floating-point gradient by a scaling factor $\alpha_k$.
  2. Randomized Rounding: The scaled vector is rounded to the nearest integers.
  3. Integer Aggregation: These integers are summed across workers (via all-reduce or a programmable switch).
  4. Update: The model is updated using the averaged integer vector, scaled back down.

The "Secret Sauce": The key innovation is the adaptive scaling factor. Instead of a fixed value, IntSGD uses a moving average of the model's trajectory to estimate the gradient's magnitude. This ensures the rounded integers stay within a range that preserves precision without overflowing 32-bit or 8-bit integer limits.

The paper also introduces IntDIANA, an extension designed for "heterogeneous" (non-IID) data. It applies the integer compression to gradient differences rather than the gradients themselves, which prevents the integer values from exploding as the model approaches the optimum.

Datasets

The researchers evaluated their method on a variety of standard benchmarks:

  • Image Classification: ResNet18 trained on the CIFAR-10 dataset.
  • Language Modeling: A 3-layer LSTM trained on the Wikitext-2 dataset.
  • Logistic Regression: Four datasets from the LibSVM repository (a5a, mushrooms, w8a, real-sim) to test performance on heterogeneous data.

Key Insights and Ideas

  • Floatless is Feasible: You don't actually need to communicate a single floating-point number to train a state-of-the-art model. Integers are sufficient if you scale them correctly.
  • Theoretical Parity: Remarkably, the authors prove that IntSGD matches the iteration complexity of full-precision SGD (up to constant factors) for convex, non-convex, smooth, and non-smooth functions.
  • All-Reduce Compatibility: Unlike many quantization schemes (like QSGD) where every worker uses a different scaling factor, IntSGD uses a shared scaling factor. This allows workers to sum their integers directly, making it "plug-and-play" with the fastest networking hardware.
  • Handling Data Drift: The IntDIANA variant shows that by compressing the change in gradients, you can maintain high precision even when different workers have very different local data.

Key Results

  • Accuracy Preservation: On ResNet18 and LSTM tasks, IntSGD perfectly matched the final accuracy/perplexity of full-precision SGD. In contrast, previous heuristic integer methods often failed to converge or lost significant performance.
Performance of IntSGD versus heuristic integer scaling on ResNet18 and LSTM tasks.
  • Speedups: In a cluster of 16 GPUs, IntSGD was significantly faster than all-gather-based compressors. For ResNet18, IntSGD (Determ.) completed an iteration in ~65ms, compared to ~74ms for full-precision SGD and ~339ms for all-gather-based SGD.
  • Efficiency: In heterogeneous settings, IntDIANA was shown to require fewer than 3 bits per coordinate to maintain convergence, demonstrating extreme communication efficiency.

Limitations and Future Work

  • Compression Ceiling: While IntSGD is fast and compatible with all-reduce, its compression ratio is naturally limited by the bit-width of the integers used (e.g., 8-bit or 32-bit). It cannot reach the extreme 1-bit compression levels of some specialized (but all-reduce-incompatible) methods.
  • Scaling Coordination: The method assumes all workers can agree on the scaling factor $\alpha_k$. While the authors suggest using a shared random seed or historical data to do this without extra communication, implementing this robustly in complex production environments remains a practical challenge.
  • Future Directions: The authors suggest exploring even more aggressive compression ratios while maintaining the "floatless" and all-reduce-friendly properties.

Summary updated

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