Source-linked AI summary

SparCML: High-Performance Sparse Communication for Machine Learning

Cedric Renggli, Saleh Ashkboos, Mehdi Aghagolzadeh, Dan Alistarh, Torsten Hoefler

arXiv:1802.08021v3cs.DCstat.ML

TL;DR

Distributed machine learning relies on global gradient summation, making communication a scalability concern, while exploiting sparsity in that summation remains largely unexplored. SPARCML develops sparse communication protocols and reports faster convergence and URL classification in real applications.

  • Problem

    How to exploit sparsity in global summation remains largely unexplored, despite the communication cost of maintaining a consistent model across distributed nodes.

    Source: §1 · p. 2, §2.1 · p. 4
  • Method

    SPARCML analyzes and implements protocols that exploit sparsity in global summation, supporting sparse and low-precision communication within machine-learning algorithms.

    Source: §1 · p. 2, §10 · p. 20
  • Results

    SPARCML reduced end-to-end convergence time 6× for a state-of-the-art natural-language-understanding network and completed URL classification 31× faster than its Cray MPI-based variant.

    Source: §1 · p. 3
  • Takeaways & Limitations

    The authors conclude that the described sparsity schemes can play a significant role in reducing communication cost in future machine-learning systems.

    Source: §10 · p. 20

    Above 99% sparsity requires careful momentum and learning-rate tuning, while 5–10% sparsity per node can yield dense reduced vectors across many nodes and negate compression benefits.

    Source: §3 · p. 5

Abstract

from arXiv · show

Applying machine learning techniques to the quickly growing data in science and industry requires highly-scalable algorithms. Large datasets are most commonly processed "data parallel" distributed across many nodes. Each node's contribution to the overall gradient is summed using a global allreduce. This allreduce is the single communication and thus scalability bottleneck for most machine learning workloads. We observe that frequently, many gradient values are (close to) zero, leading to sparse of sparsifyable communications. To exploit this insight, we analyze, design, and implement a set of communication-efficient protocols for sparse input data, in conjunction with efficient machine learning algorithms which can leverage these primitives. Our communication protocols generalize standard collective operations, by allowing processes to contribute arbitrary sparse input data vectors. Our generic communication library, SparCML, extends MPI to support additional features, such as non-blocking (asynchronous) operations and low-precision data representations. As such, SparCML and its techniques will form the basis of future highly-scalable machine learning frameworks.

1 Introduction and Motivation

SparCML targets allreduce’s fixed-size gradient-communication bottleneck with sparse collective communication, exploiting sparse updates and relaxed consistency to scale machine learning training.

1 Introduction and Motivation

  • In data-parallel training, allreduce becomes the main communication bottleneck because every step sums a model-sized gradient, even as the number of nodes grows.At large scale, hundreds of megabytes of parameters may need to be summed globally every few microseconds.Source: §1 · p. 1
  • SparCML proposes a general communication library for sparse reductions, using sparse or principled sparsifiable updates and relaxed parameter consistency to reduce communication and synchronization costs.The paper notes that efficient sparse communication and compression were not supported in standard or specialized machine-learning communication libraries.Source: §1 · p. 2
  • SparCML’s adaptive collective algorithms address unknown overlap among nonzero indices and support reduced-precision and non-blocking operations, including 4-bit sparse gradient exchange overlapped with computation.For some workload parameters, the implementation is within constant factors of optimal in bandwidth and latency cost.Source: §1 · p. 2
  • SPARCML reduced end-to-end convergence time by 6× for a natural-language-understanding network and completed URL classification 31× faster than its Cray MPI-based variant.The reported speedups were more significant on less performant cloud networks.Source: §1 · p. 3
  • On 64 GPUs, SPARCML cut ImageNet wide-residual-network training time by ≃2× with <0.5% Top5 validation accuracy loss; ASR training fell from 14 to 1.78 days (almost 10×).The standard ResNet50 benchmark saw negligible gains; the ImageNet result required no additional hyperparameter tuning, and ASR training had no significant accuracy loss.Source: §1 · p. 3

2 Preliminaries

The preliminaries frame data-parallel SGD as local gradient computation followed by global summation to keep model copies synchronized, then introduce sparsification and quantization as communication-reduction techniques.

2.1 Data Parallelism and Communication Costs

  • In data-parallel SGD, nodes compute minibatch gradients locally and globally sum updates to synchronize model copies, trading P-fold sample processing for reduction communication [1, 59].Each node processes part of the dataset; with P nodes, each iteration processes P times more samples, but requires a sum reduction to maintain a consistent model.Source: §2.1 · pp. 3–4

2.2 Communication-Reduction Techniques

  • Top-k SGD sends each node’s k largest-magnitude gradient components, accumulating omitted values for the next iteration; k may be below 1% [2] [38].This forces sparsity at each node, although the selected components may vary across nodes.Source: §2.2 · p. 4
  • Quantization reduces gradient precision via element-wise operator Q; zero-mean quantization noise preserves convergence in principle but added variance can slow it [54].Quantization lowers the number of bits used to represent each update value.Source: §2.2 · p. 4

3 Communication-Reduction: A Critical View

The section argues that communication reduction has important limits at large scale: aggressive sparsification can preserve convergence but requires careful tuning, while milder sparsity can yield dense reduced vectors as node count grows. Quantization avoids node-count-dependent compression but offers only limited compression before end accuracy suffers.

Structured Sparsification

  • At 5−10% per-node sparsity, reductions across many nodes can make the result dense again, restoring communication as a bottleneck.Figure 1 plots reduced-result density against node count and per-node density for ResNet20 on CIFAR-10 at epoch 5; the authors report consistent results across training stages and ResNet and DenseNet models.Source: Figure 1 · p. 5, §3 · p. 5
  • Structured sparsification can preserve convergence [5] and allow nodes to send less than 1% of their local gradient update without losing convergence [38], but achieving above 99% sparsity requires careful momentum and learning-rate tuning.The paper characterizes this tuning as error-prone and time-consuming.Source: §3 · pp. 4–5

Quantization

  • Quantization compression is independent of node count, but compression beyond 4−8× can add enough variance to affect end accuracy.The section says this limit is suggested by both theory and experiments.Source: §3 · p. 5

4 Communication Reduction in SPARCML

SPARCML combines sparsification and stochastic quantization in its reduction method, and the paper proves convergence for this combination under standard assumptions.

Sparse Quantized Reduction

  • SPARCML is the first to combine sparsification with stochastic quantization, using residual error, sparsity-aware allreduce, and optional intermediate QSGD when the truncated-gradient sum becomes dense.Each node carries forward unapplied gradient components as residual error; the allreduce sums truncated gradients and may quantize the resulting dense vector.Source: §4 · pp. 5–6

Convergence Proof

  • For SPARCML SGD minimizing a smooth, non-convex function f, there exists a learning-rate schedule (αt)t=1,T such that min_{t∈{1,2,...,T}} E[||∇f(xt)||²] → 0 as T→∞.Source: §4 · p. 6

Discussion

  • The guarantee is ergodic convergence to a stationary point of expected zero gradient, not a global minimum, and specifies no practical hyperparameters beyond diminishing learning rates.The passage characterizes this limitation as consistent with state-of-the-art results for the problem setting, even without quantization [37].Source: §4 · p. 6

5 Supporting Sparsity in SPARCML

SparCML represents vectors as sparse streams and adapts their representation as reductions fill in. It builds sparse allreduce algorithms for small, large, and dynamically dense results, with communication costs analyzed under an α-β model.

5.1 Data Representation: Sparse Streams

  • Sparse streams store nonzero index-value pairs, but switch to dense when fill-in makes sparse storage wasteful or exceeds the communication-efficient threshold δ.The threshold compares sparse volume, nnz(c + isize), with dense volume, N × isize; computation costs can make the practical threshold lower.Source: §5.1 · pp. 6–7

5.2 Efficient Collectives on Sparse Streams

  • SparCML extends MPI allgather and allreduce to sparse vectors, supporting coordinate-wise associative reductions with a neutral element and analyzing costs in the α-β model.The stated analysis assumes equal initial nonzero counts, power-of-two P > 4, and N divisible by P.Source: §5.2 · pp. 7–8

5.3 Communication Algorithms

  • The algorithms require no global knowledge of contributions or index distributions, but users need a rough estimate of final result size K to choose static or dynamic sparse allreduce.SSAR keeps K below δ; DSAR starts sparse and switches to dense when K ≥ δ. The analysis bounds sparse allreduce communication between disjoint-index and fully overlapping extremes.Source: §5.3 · p. 8

5.3.1 The Small Data Case

  • For sparse allreduce, recursive doubling gives latency log2(P)α, independent of data size, while transmitted volume depends on overlap among nonzero indices.Fully overlapping indices keep intermediate results at k items; disjoint indices increase the amount of data at each stage.Source: §5.3.1 · p. 9

5.3.2 The Large Data Case

  • Sparse allreduce can use a split phase that routes index ranges to partition owners, followed by a concatenating sparse allgather to distribute the reduced result.Non-blocking sends and receives mitigate the higher latency of direct sparse communication in the split phase.Source: §5.3.2 · p. 9

5.3.3 The Dynamic Case: Switching to Dense

  • DSAR requires at least log2(P)α + δβd time, and sparsity alone limits speedup to at most 2/κ over dense allreduce (4× when κ = 0.5).DSAR receives sparse data in its first phase, then switches to dense representation for an optimized dense allgather in its second phase.Source: §5.3.3 · pp. 10–11

6 Supporting Low-Precision Communication

Because dynamic sparse communication can still require a constant fraction of dense-reduction bandwidth, SparCML uses low-precision outputs to further reduce communication cost. It applies stochastic QSGD quantization in the dense portion of DSAR Split allgather, preserving SGD convergence.

6 Supporting Low-Precision Communication

  • Dynamic-case bandwidth is lower bounded by a constant fraction of dense-reduction bandwidth, motivating further reduction through low-precision communication.The paper also reports experimental evidence that this dynamic case is likely in large-scale deployments.Source: §6 · p. 11
  • SparCML supports 2-, 4-, and 8-bit output representations using stochastic QSGD quantization, which provably preserves SGD convergence.The paper presents only an outline of the scheme and its implementation due to space constraints.Source: §6 · p. 11
  • QSGD independently stochastically quantizes dense-stream buckets of about 1024 entries, packing low-precision items with a full-precision scaling factor.SparCML uses this representation only in DSAR Split allgather’s second, dense part, reducing that step’s bandwidth by a constant corresponding to the quantization.Source: §6 · p. 11

7 Artifact and Additional Features

SparCML offers an MPI-like interface that makes sparse-communication ports minor and supports nonblocking collectives. The paper also describes MPI-OPT for distributed optimization and a CNTK v2.0 modification using SparCML for communication.

Interface and Code

  • Porting MPI-enabled code to SparCML requires minor changes; its native C++11 implementation is around 2,000 lines, and integrating it into CNTK required around 100 lines.The implementation count excludes benchmark and test infrastructure, which increases the line count by an order of magnitude.Source: §7 · p. 11

Non-Blocking Operations

  • SparCML implements nonblocking collectives that let a thread continue local computation while communication proceeds in the background.The nonblocking operations follow the model specified for MPI-3 nonblocking collectives.Source: §7 · p. 11

MPI-OPT

  • MPI-OPT supports distributed SGD, gradient descent, and coordinate descent across compute nodes, with configurable learning-rate adaptation and sparse, dense, synchronous, or asynchronous aggregation.It provides MPI-IO dataset partitioning, data-parallel optimization, and multithreading within each node.Source: §7 · pp. 11–12

The Microsoft Cognitive Toolkit (CNTK)

  • The authors modified CNTK v2.0 to use SparCML for communication in large-scale neural-network training.CNTK supports parallelization across multiple GPUs and servers with MPI-based communication.Source: §7 · p. 12

8 Experiments

Experiments test SparCML on synthetic benchmarks, classification, deep-learning tasks, and large workloads across supercomputing and cloud settings. Sparse communication improves performance in several settings, but benefits depend on workload and convergence constraints.

8.1 Micro-Benchmarks

  • Micro-benchmarks show SSAR Recursive double performs best for small data, while SSAR Split allgather outperforms DSAR Split allgather when nonzero indices are relatively few.At higher node counts, SSAR Recursive double gains less over other variants; ring-based MPI is fastest on fast networks with few nodes but gives no speedup at high node counts, while DSAR Split allgather offers only constant-factor improvement. Relative ordering is comparable on Piz Daint and Greina GigE, with less reduction time on high-performance networks.Source: §8.1 · p. 13

8.2 Large-Scale Classification

  • For URL logistic regression on 8 Piz Daint nodes, sparse allgather reduces epoch time from 49 to 26 seconds and communication time from 24 to 4.5 seconds.This is an overall speedup of 1.8× and a communication speedup of 5.3× versus dense allgather.Source: §8.2 · p. 14
  • On Piz Daint with 8 nodes, MPI-OPT with SparCML reduces URL time to convergence by 63× and communication time by 185× versus dense MPI.Against Spark, MPI-OPT with standard Cray-optimized dense allreduce achieves 31× speedup to convergence and 43× communication speedup; the paper cautions that Spark provides additional features, including fault-tolerance.Source: §8.2 · pp. 14–15

8.3 Training Deep Neural Networks

  • Full-convergence speedups versus the full-precision baseline are 1.12× for CIFAR-10, 5.99× for ATIS, and 1.5× for Hansard.CIFAR-10 matches baseline accuracy at k = 16/512 and is 1% above the 32-bit variant at k = 8/512; ATIS and Hansards metrics are within 1% of full-precision baselines.Source: §8.3 · p. 16

8.4 Large Workload Experiments

  • For ResNet50, layer sparsification to 99% yields only ≃6% runtime improvement: 1950 seconds per epoch versus 2071 for the Cray MPI baseline.Gradients become dense during aggregation, and higher sparsity hurts convergence; sparsification and densification overhead and the lack of Cray-specific tuning also limit gains.Source: §8.4 · pp. 16–17
  • For 4×ResNet18, SPARCML is ≃2× faster than the Cray MPI baseline, with final accuracy differences below 0.9% top-1 and 0.5% top-5.For 4×ResNet34, speedup is approximately ≃1.85× versus the Cray MPI baseline, with accuracy differences of 0.8% top-1 and less than 0.4% top-5. Speedup comes almost entirely from reduced aggregation time on the last fully connected layer.Source: §8.4 · p. 17
  • At 32 nodes (128 GPUs), sparse ASR training reaches similar accuracy in < 1.8 days, with validation word-error rates less than 1% higher than full-precision training.The comparison baseline is unscalable; SparCML models can sometimes improve accuracy by up to 1%. Sparse gradients, batch size, and convergence interact, and the ASR experiment kept a small global batch size to preserve convergence.Source: §8.4 · p. 18

9 Related Work

Related work spans gradient compression, lossless communication reduction, distributed frameworks, and sparse reductions. SparCML combines stochastic quantization and sparsification with efficient sparse-communication support.

Reduced Communication Techniques

  • Prior work introduced quantized SGD and top-k gradient sparsification [2], with sparsity below 0.1% reported to preserve accuracy in convolutional and recurrent networks but requiring hyperparameter tuning.SparCML combines stochastic quantization and sparsification, proves the resulting technique converges, and reports consistent runtime gains in large-scale supercomputing and cloud settings.Source: §9 · pp. 18–19

Lossless Methods

  • Factorization and very large batches are lossless alternatives, while SparCML's compression is orthogonal at fixed batch size.At large node counts, aggregated gradients can become dense, making large-batch sparse-gradient tuning necessary; SparCML also implements tensor fusion and non-blocking operations.Source: §9 · p. 19

Communication Frameworks

  • NCCL reduces communication on NVIDIA GPUs with NVLINK but has restricted reductions, while application-specific frameworks generally do not use reduced-communication techniques or sparsity.The passage gives LBANN and S-Caffe as examples of frameworks tailored to specific application scenarios.Source: §9 · p. 19

Sparse Reduction

  • SparCML extends sparse-reduction work with density-aware representations, specified sparse-allreduce algorithms, performance analysis, and machine-learning-oriented low-precision support.Hofmann and Rünger use runlength encoding, while Träff describes general MPI sparsity; Kylix assumes known data distribution and multiple passes, and Dryden et al. preserve local residuals specific to Top-k SGD.Source: §9 · p. 19

10 Conclusions and Further Work · A Relaxation of Assumption in Section 4

SPARCML enables sparse and low-precision communication for machine learning, integrating into existing frameworks and achieving order-of-magnitude speedups in several real-world applications. The authors outline future research directions and explain how the analysis can accommodate relaxed assumptions from Section 4.

10 Conclusions and Further Work

  • SPARCML supports sparse and low-precision communication for machine learning and integrates easily into existing computational frameworks.Source: §10 · p. 20
  • SPARCML can provide order-of-magnitude speedups in several real-world applications.Source: §10 · p. 20
  • Future work will investigate distributed machine learning applications that benefit from sparsity.Source: §10 · p. 20
  • Future work will also examine how sparsity interacts with other parallelization approaches, such as large-batch training.Source: §10 · p. 20

A Relaxation of Assumption in Section 4

B Stochastic Density Analysis · B.1 Uniform Distribution

The analysis models the expected number of nonzero entries after reduction using the probability that indices appear in contributed sets, then specializes the bound to uniform sampling. The uniform case is presented as a worst-case scenario for probabilistic growth of intermediate results.

B Stochastic Density Analysis

  • The general analysis uses N indicator variables for index membership in the union of contributed sets; their sum is the reduced result’s nonzero count, whose expectation follows by linearity.The difficulty is that contributed-item counts and intermediate or final result sizes are not known in advance, and result sizes also depend on the positions of non-neutral indices.Source: B Stochastic Density Analysis · p. 25
  • For any underlying distribution, the union bound gives an upper bound on the expected number of nonzero entries by summing index-membership probabilities across the contributed sets.The probability that an index belongs to a distinct set is determined by the underlying distribution.Source: B Stochastic Density Analysis · p. 25
  • The general bound is tight when the contributed sets are pairwise disjoint, the special case that reduces the problem to an allgather.Source: B Stochastic Density Analysis · p. 25

B.1 Uniform Distribution

  • Uniform sampling is a reasonable assumption when every index has a nonzero chance of being hit, and it gives a worst-case scenario for probabilistic growth of intermediate results.Source: §B.1 · p. 26
  • For uniform sampling, the analysis gives an exact expected result size via a closed-form function and an upper bound of P × k, matching the earlier non-probabilistic bound.Each node contributes k independent uniform samples over N indices.Source: §B.1 · p. 26
  • Figure 7 illustrates multiplicative growth in expected reduced-result size with both node count P and nonzero entries k per node, for N = 512.Source: §B.1 · p. 26, Figure 7 · p. 26

C Convergence Proof

The proof analyzes Quantized TopK SGD by controlling the gap between an ideal accumulated-gradient iterate and the iterate seen by the algorithm, then targeting ergodic convergence to zero gradient under stated assumptions.

Preliminaries

  • The proof assumes L-smooth nonconvex f and a bounded second moment for averages of independent stochastic gradients; quantization variance is folded into M with factor (1 + d^2/s).The bound takes expectation over both stochastic quantization and stochastic sampling.Source: C Convergence Proof · pp. 26–27

Analysis Preliminaries

  • An auxiliary iterate x_t tracks gradients generated without truncation or quantization, letting the proof bound its difference from the algorithm's observed iterate v_t at each step.The text says an inductive argument establishes a per-time bound, with expectation over quantization randomness.Source: C Convergence Proof · p. 27

Commutativity of sum and TopK

  • Following [5], the analysis assumes a constant ξ bounds the proportion of generated gradients preserved by summing the nodes' TopK outputs at every iteration.This is an analytic assumption about commutativity of sum and TopK, not a general consequence established by the proof.Source: C Convergence Proof · pp. 27–28

Analysis

  • The analysis targets ergodic convergence to a point with zero gradient, and Theorem C.4 states its result for learning-rate and K choices satisfying a per-iteration condition.The supplied theorem passages do not expose the displayed bound, so its rate or numerical terms cannot be reported here.Source: C Convergence Proof · p. 28

D Hyperparameter Values used for DNN Experiments

DNN experiments followed CNTK’s standard hyperparameters and learning-rate schedules, with specified schedules and batch size for wide residual networks and the proprietary ASR model.

Loading 1802.08021v3…