Title: NUQSGD: PROVABLY COMMUNICATION-EFFICIENT DATA-PARALLEL SGD VIA NONUNIFORM QUANTIZA-TION

Abstract: As the size and complexity of models and datasets grow, so does the need for communication-efficient variants of stochastic gradient descent that can be deployed on clusters to perform parallel model training. Alistarh et al. (2017) describe two variants of data-parallel SGD that quantize and encode gradients to lessen communication costs. For the first variant, QSGD, they provide strong theoretical guarantees. For the second variant, which we call QSGDinf, they demonstrate impressive empirical gains for distributed training of large neural networks. Building on their work, we propose an alternative scheme for quantizing gradients and show that it yields stronger theoretical guarantees than exist for QSGD while matching the empirical performance of QSGDinf.
Under review as a conference paper at ICLR 2020 and then compressed by quantizing each element to a uniform grid of quantization levels using a randomized method. While most lossy compression schemes do not provide convergence guarantees, QSGD's quantization scheme, is designed to be unbiased, which implies that the quantized stochastic gradient is itself a stochastic gradient, only with higher variance determined by the dimension and number of quantization levels. As a result, Alistarh et al. (2017) are able to establish a number of theoretical guarantees for QSGD, including that it converges under standard assumptions. By changing the number of quantization levels, QSGD allows the user to trade-off communication bandwidth and convergence time.
Despite their theoretical guarantees based on quantizing after L 2 normalization, Alistarh et al. opt to present empirical results using L ∞ normalization. We call this variation QSGDinf. While the empirical performance of QSGDinf is strong, their theoretical guarantees on the number of bits transmitted no longer apply. Indeed, in our own empirical evaluation of QSGD, we find the variance induced by quantization is substantial, and the performance is far from that of SGD and QSGDinf.
Given the popularity of this scheme, it is natural to ask one can obtain guarantees as strong as those of QSGD while matching the practical performance of the QSGDinf heuristic. In this work, we answer this question in the affirmative by providing a new quantization scheme which fits into QSGD in a way that allows us to establish stronger theoretical guarantees on the variance, bandwidth, and cost to achieve a prescribed gap. Instead of QSGD's uniform quantization scheme, we use an unbiased nonuniform logarithmic scheme, similar to those introduced in telephony systems for audio compression (Cattermole, 1969) . We call the resulting algorithm nonuniformly quantized stochastic gradient descent (NUQSGD). Like QSGD, NUQSGD is a quantized data-parallel SGD algorithm with strong theoretical guarantees that allows the user to trade off communication costs with convergence speed. Unlike QSGD, NUQSGD has strong empirical performance on deep models and large datasets, matching that of QSGDinf. In particular, we provide a new efficient implementation for these schemes using a modern computational framework (Pytorch), and benchmark it on classic large-scale image classification tasks.
The intuition behind the nonuniform quantization scheme underlying NUQSGD is that, after L 2 normalization, many elements of the normalized stochastic gradient will be near-zero. By concentrating quantization levels near zero, we are able to establish stronger bounds on the excess variance. In the overparametrized regime of interest, these bounds decrease rapidly as the number of quantization levels increases. Combined with a bound on the expected code-length, we obtain a bound on the total communication costs of achieving an expected suboptimality gap. The resulting bound is slightly stronger than the one provided by QSGD.
To study how quantization affects convergence on state-of-the-art deep models, we compare NUQSGD, QSGD, and QSGDinf, focusing on training loss, variance, and test accuracy on standard deep models and large datasets. Using the same number of bits per iteration, experimental results show that NUQSGD has smaller variance than QSGD, as expected by our theoretical results. This smaller variance also translates to improved optimization performance, in terms of both training loss and test accuracy. We also observe that NUQSGD matches the performance of QSGDinf in terms of variance and loss/accuracy. Further, our distributed implementation shows that the resulting algorithm considerably reduces communication cost of distributed training, without adversely impacting accuracy. Our empirical results show that NUQSGD can provide faster end-to-end parallel training relative to data-parallel SGD, QSGD, and Error-Feedback SignSGD (Karimireddy et al., 2019) on the ImageNet dataset.
• We establish stronger theoretical guarantees for the excess variance and communication costs of our gradient quantization method than those available for QSGD's uniform quantization method.
• We then establish stronger convergence guarantees for the resulting algorithm, NUQSGD, under standard assumptions.
• We demonstrate that NUQSGD has strong empirical performance on deep models and large datasets, both in terms of accuracy and scalability. Thus, NUQSGD closes the gap between the theoretical guarantees of QSGD and the empirical performance of QSGDinf.
Receive c i,t from processor i for each i;
9
Decode ĝi (w t ) ← DECODE c i,t ;
Aggregate w t+1 ← P Ω (w t -α K ∑ K i=1 ĝi (w t ));
Algorithm 1: Data-parallel (synchronized) SGD.
Following (Alistarh et al., 2017) , we consider data-parallel SGD, a synchronous distributed framework consisting of K processors that partition a large dataset among themselves. This framework models real-world systems with multiple GPU resources. Each processor keeps a local copy of the parameter vector and has access to independent and private stochastic gradients of f .

1. INTRODUCTION:

Deep learning is booming thanks to enormous datasets and very large models, leading to the fact that the largest datasets and models can no longer be trained on a single machine. One common solution to this problem is to use distributed systems for training. The most common algorithms underlying deep learning are stochastic gradient descent (SGD) and its variants, which led to a significant amount of research on building and understanding distributed versions of SGD.

Implementations of SGD on distributed systems and data-parallel versions of SGD are scalable and take advantage of multi-GPU systems. Data-parallel SGD, in particular, has received significant attention due to its excellent scalability properties (Zinkevich et al., 2010; Bekkerman et al., 2011; Recht et al., 2011; Dean et al., 2012; Coates et al., 2013; Chilimbi et al., 2014; Li et al., 2014; Duchi et al., 2015; Xing et al., 2015; Zhang et al., 2015; Alistarh et al., 2017) . In data-parallel SGD, a large dataset is partitioned among K processors. These processors work together to minimize an objective function. Each processor has access to the current parameter vector of the model. At each SGD iteration, each processor computes an updated stochastic gradient using its own local data. It then shares the gradient update with its peers. The processors collect and aggregate stochastic gradients to compute the updated parameter vector.

Increasing the number of processing machines reduces the computational costs significantly. However, the communication costs to share and synchronize huge gradient vectors and parameters increases dramatically as the size of the distributed systems grows. Communication costs may thwart the anticipated benefits of reducing computational costs. Indeed, in practical scenarios, the communication time required to share stochastic gradients and parameters is the main performance bottleneck (Recht et al., 2011; Li et al., 2014; Seide et al., 2014; Strom, 2015; Alistarh et al., 2017) . Reducing communication costs in data-parallel SGD is an important problem.

One promising solution to the problem of reducing communication costs of data-parallel SGD is gradient compression, e.g., through gradient quantization (Dean et al., 2012; Seide et al., 2014; Sa et al., 2015; Gupta et al., 2015; Abadi et al., 2016; Zhou et al., 2016; Alistarh et al., 2017; Wen et al., 2017; Bernstein et al., 2018) . (This should not be confused with weight quantization/sparsification, as studied by Wen et al. (2016) ; Hubara et al. (2016) ; Park et al. (2017) ; Wen et al. (2017) , which we do not discuss here.) Unlike full-precision data-parallel SGD, where each processor is required to broadcast its local gradient in full-precision, i.e., transmit and receive huge full-precision vectors at each iteration, quantization requires each processor to transmit only a few communication bits per iteration for each component of the stochastic gradient.

One popular such proposal for communication-compression is quantized SGD (QSGD), due to Alistarh et al. (2017) . In QSGD, stochastic gradient vectors are normalized to have unit L 2 norm, 1.1 RELATED WORK Seide et al. (2014) proposed signSGD, an efficient heuristic scheme to reduce communication costs drastically by quantizing each gradient component to two values. Bernstein et al. (2018) later provided convergence guarantees for signSGD. Note that the quantization employed by signSGD is not unbiased, and so a new analysis was required. As the number of levels is fixed, SignSGD does not provide any trade-off between communication costs and convergence speed. Sa et al. (2015) introduced Buckwild!, a lossy compressed SGD with convergence guarantees. The authors provided bounds on the error probability of SGD, assuming convexity and gradient sparsity. Wen et al. (2017) proposed TernGrad, a stochastic quantization scheme with three levels. TernGrad also significantly reduces communication costs and obtains reasonable accuracy with a small degradation to performance compared to full-precision SGD. Convergence guarantees for TernGrad rely on a nonstandard gradient norm assumption. As discussed, Alistarh et al. (2017) proposed QSGD, a more general stochastic quantization scheme, for which they provide both theoretical guarantees and experimental validation (although for different variants of the same algorithm). We note that their implementation was only provided in Microsoft CNTK; by contrast, here we provide a more generic implementation in Horovod (Sergeev and Del Balso, 2018) , a communication back-end which can support a range of modern frameworks such as Tensorflow, Keras, Pytorch, and MXNet.

NUQSGD uses a logarithmic quantization scheme. Such schemes have long been used in telephony systems for audio compression (Cattermole, 1969) . Logarithmic quantization schemes have appeared in other contexts recently: Hou and Kwok (2018) studied weight distributions of long short-term memory networks and proposed to use logarithm quantization for network compression. Zhang et al. (2017) proposed a gradient compression scheme and introduced an optimal quantization scheme, but for the setting where the points to be quantized are known in advance. As a result, their scheme is not applicable to the communication setting of quantized data-parallel SGD.

2. PRELIMINARIES: DATA-PARALLEL SGD AND CONVERGENCE:

We consider a high-dimensional machine learning model, parametrized by a vector w ∈ R d . Let Ω ⊆ R d denote a closed and convex set. Our objective is to minimize f : Ω → R, which is an unknown, differentiable, convex, and β -smooth function. The following summary is based on (Alistarh et al., 2017) .

Recall that a function f is β -smooth if, for all u, v ∈ Ω, we have ∇ f (u) -∇ f (v) ≤ β u -v ,

where • denotes the Euclidean norm. Let (S , Σ, µ) be a probability space (and let E denote expectation). Assume we have access to stochastic gradients of f , i.e., we have access to a function g : Ω × S → R d such that, if s ∼ µ, then E[g(w, s)] = ∇ f (w) for all w ∈ Ω. In the rest of the paper, we let g(w) denote the stochastic gradient for notational simplicity. The update rule for conventional full-precision projected SGD is w t+1 = P Ω (w tαg(w t )), where w t is the current parameter input, α is the learning rate, and P Ω is the Euclidean projection onto Ω.

We say the stochastic gradient has a second-moment upper bound B when E[ g(w) 2 ] ≤ B for all w ∈ Ω. Similarly, the stochastic gradient has a variance upper bound σ 2 when E[ g(w) -∇ f (w) 2 ] ≤ σ 2 for all w ∈ Ω. Note that a second-moment upper bound implies a variance upper bound, because the stochastic gradient is unbiased.

We have classical convergence guarantees for conventional full-precision SGD given access to stochastic gradients at each iteration: Theorem 1 (Bubeck 2015, Theorem 6.3) . Let f : Ω → R denote a convex and β -smooth function and let R 2 sup w∈Ω ww 0 2 . Suppose that the projected SGD update is executed for T iterations with α = 1/(β + 1/γ) where γ = r 2/T /σ . Given repeated and independent access to stochastic gradients with a variance upper bound σ 2 , projected SGD satisfies

EQUATION

Minibatched (with larger batch sizes) and data-parallel SGD are two common SGD variants used in practice to reduce variance and improve computational efficiency of conventional SGD.

Input: local data, local copy of the parameter vector w t , learning rate α, and K for t = 1 to T do for i = 1 to K do // each transmitter processor (in parallel)

Compute g i (w t ) ; // stochastic gradient Encode c i,t ← ENCODE g i (w t ) ;

Broadcast c i,t to all processors;

for l = 1 to K do // each receiver processor (in parallel)

for i = 1 to K do // each transmitter processor

At each iteration, each processor computes its own stochastic gradient based on its local data and then broadcasts it to all peers. Each processor receives and aggregates the stochastic gradients from all peers to obtain the updated parameter vector. In detail, the update rule for full-precision dataparallel SGD is w t+1 = P Ω (w t -α K ∑ K l=1 g l (w t )) where g l (w t ) is the stochastic gradient computed and broadcasted by processor l. Provided that g l (w t ) is a stochastic gradient with a variance upper bound σ 2 for all l, then 1 K ∑ K l=1 g l (w t ) is a stochastic gradient with a variance upper bound σ 2 K . Thus, aggregation improves convergence of SGD by reducing the first term of the upper bound in (1). Assume each processor computes a minibatch gradient of size B. Then, this update rule is essentially a minibatched update with size BK.

Data-parallel SGD is described in Algorithm 1. Full-precision data-parallel SGD is a special case of Algorithm 1 with identity encoding and decoding mappings. Otherwise, the decoded stochastic gradient ĝi (w t ) is likely to be different from the original local stochastic gradient g i (w t ).

By Theorem 1, we have the following convergence guarantees for full-precision data-parallel SGD: Corollary 1 (Alistarh et al. 2017, Corollary 2.2) . Let f , R, and γ be as defined in Theorem 1 and let ε > 0. Suppose that the projected SGD update is executed for T iterations with α = 1/(β + √ K/γ) on K processors, each with access to independent stochastic gradients of f with a second-moment bound B. The smallest T for the full-precision data-parallel SGD that guarantees

E f ( 1 T ∑ T t=0 w t ) -min w∈Ω f (w) ≤ ε is T ε = O R 2 max( 2B Kε 2 , β ε ) .

3. NONUNIFORMLY QUANTIZED STOCHASTIC GRADIENT DESCENT:

Data-parallel SGD reduces computational costs significantly. However, the communication costs of broadcasting stochastic gradients is the main performance bottleneck in large-scale distributed systems. In order to reduce communication costs and accelerate training, Alistarh et al. (2017) introduced a compression scheme that produces a compressed and unbiased stochastic gradient, suitable for use in SGD.

At each iteration of QSGD, each processor broadcasts an encoding of its own compressed stochastic gradient, decodes the stochastic gradients received from other processors, and sums all the quantized vectors to produce a stochastic gradient. In order to compress the gradients, every coordinate (with respect to the standard basis) of the stochastic gradient is normalized by the Euclidean norm of the gradient and then stochastically quantized to one of a small number quantization levels distributed uniformly in the unit interval. The stochasticity of the quantization is necessary to not introduce bias. Alistarh et al. (2017) give a simple argument that provides a lower bound on the number of coordinates that are quantized to zero in expectation. Encoding these zeros efficiently provides communication savings at each iteration. However, the cost of their scheme is greatly increased variance in the gradient, and thus slower overall convergence. In order to optimize overall performance, we must balance communication savings with variance. By simple counting arguments, the distribution of the (normalized) coordinates cannot be uniform. Indeed, this is the basis of the lower bound on the number of zeros. These arguments make no assumptions on the data distribution, and rely entirely on the fact that the quantities being quantized are the coordinates of a unit-norm vector. Uniform quantization does not capture the properties of such vectors, leading to substantial gradient variance.

3.1. NONUNIFORM QUANTIZATION:

In this paper, we propose and study a new scheme to quantize normalized gradient vectors. Instead of uniformly distributed quantization levels, as proposed by Alistarh et al. (2017) , we consider quantization levels that are nonuniformly distributed in the unit interval, as depicted in Figure 1 . In order to obtain a quantized gradient that is suitable for SGD, we need the quantized gradient to remain unbiased. Alistarh et al. (2017) achieve this via a randomized quantization scheme, which can be easily generalized to the case of nonuniform quantization levels.

Using a carefully parametrized generalization of the unbiased quantization scheme introduced by Alistarh et al., we can control both the cost of communication and the variance of the gradient. Compared to a uniform quantization scheme, our scheme reduces quantization error and variance by better matching the properties of normalized vectors. In particular, by increasing the number of quantization levels near zero, we obtain a stronger variance bound. Empirically, our scheme also better matches the distribution of normalized coordinates observed on real datasets and networks.

We now describe the nonuniform quantization scheme: Let s ∈ {1, 2, • • • } be the number of internal quantization levels, and let L = (l 0 , l 1 , • • • , l s+1 ) denote the sequence of quantization levels, where l 0 = 0 < l 1 < • • • < l s+1 = 1. For r ∈ [0, 1], let s(r) and p(r) satisfy l s(r) ≤ r ≤ l s(r)+1 and r = 1p(r) l s(r) + p(r)l s(r)+1 , respectively. Define τ(r) = l s(r)+1l s(r) . Note that s(r

EQUATION

where, letting

r i = |v i |/ v , the h i (v, s)'s are independent random variables such that h i (v, s) = l s(r i ) with probability 1 -p(r i ) and h i (v, s) = l s(r i )+1 otherwise.

We note that the distribution of h i (v, s) satisfies E[h i (v, s)] = r i and achieves the minimum variance over all distributions that satisfy E[h i (v, s)] = r i with support L . In the following, we focus on a special case of nonuniform quantization with L = (0, 1/2 s , • • • , 2 s-1 /2 s , 1) as the quantization levels.

The intuition behind this quantization scheme is that it is very unlikely to observe large values of r i in the stochastic gradient vectors of machine learning models. Stochastic gradients are observed to be dense vectors (Bernstein et al., 2018) . Hence, it is natural to use fine intervals for small r i values to reduce quantization error and control the variance.

After quantizing the stochastic gradient with a small number of discrete levels, each processor must encode its local gradient into a binary string for broadcasting. We describe this encoding in Appendix A.

4. THEORETICAL GUARANTEES:

In this section, we provide theoretical guarantees for NUQSGD, giving variance and code-length bounds, and using these in turn to compare NUQSGD and QSGD. Please note that the proofs of Theorems 2, 3, 4, and 5 are provided in Appendices B, C, D, and E respectively.

Theorem 2 (Variance bound). Let v ∈ R d . The nonuniform quantization of v satisfies E[Q s (v)] = v.

Furthermore, provided that s ≤ log(d)/2, we have

E[ Q s (v) -v 2 ] ≤ ε Q v 2 (3)

where

ε Q = min{min{2 -2s (d -2 2s ), 2 -s √ d -2 2s } + O(s), d/3(2 -2s+1 + 1)}.

The result in Theorem 2 implies that if g(w) is a stochastic gradient with a second-moment bound η, then Q s (g(w)) is a stochastic gradient with a variance upper bound ε Q η. In the range of interest where d is sufficiently large, i.e., s = o(log(d)), the variance upper bound decreases with the number of quantization levels. To obtain this data-independent bound, we establish upper bounds on the number of coordinates of v falling into intervals defined by L .

EQUATION

where

C = b -(1 + o(1)) and n s,d = 2 2s + 2 s √ d.

Theorem 3 provides a bound on the expected number of communication bits to encode the quantized stochastic gradient. Note that 2 2s + √ d2 s ≤ d/e is a mild assumption in practice. As one would expect, the bound, (4), increases monotonically in d and s. In the sparse case, if we choose s = o(log d) levels, then the upper bound on the expected code-length is

O 2 s √ d log √ d 2 s .

Combining the upper bounds above on the variance and code-length, Corollary 1 implies the following guarantees for NUQSGD: Theorem 4 (NUQSGD for smooth convex optimization). Let f and R be defined as in Theorem 1, let ε Q be defined as in Theorem 2, let ε > 0, B = (1 + ε Q )B, and let γ > 0 be given by γ 2 = 2R 2 /( BT ). With ENCODE and DECODE defined as in Appendix A, suppose that Algorithm 1 is executed for T iterations with a learning rate α = 1/(β + √ K/γ) on K processors, each with access to independent stochastic gradients of f with a second-moment bound B. Then

T ε = O max 2 B Kε 2 , β ε R 2 iterations suffice to guarantee E f 1 T ∑ T t=0 w t -min w∈Ω f (w) ≤ ε.

In addition, NUQSGD requires at most N Q communication bits per iteration in expectation.

On nonconvex problems, (weaker) convergence guarantees can be established along the lines of, e.g., (Ghadimi and Lan, 2013, Theorem 2.1) .

NUQSGD vs QSGD. How do QSGD and NUQSGD compare in terms of bounds on the expected number of communication bits required to achieve a given suboptimality gap ε? The quantity that controls our guarantee on the convergence speed in both algorithms is the variance upper bound, which in turn is controlled by the quantization schemes. Note that the number of quantization levels, s, is usually a small number in practice. On the other hand, the dimension, d, can be very large, especially in overparameterized networks. In Figure 2 , we show that the quantization scheme underlying NUQSGD results in substantially smaller variance upper bounds for plausible ranges of s and d. Note that these bounds do not make any assumptions on the dataset or the structure of the network.

For any (nonrandom) number of iterations T , an upper bound, N A , holding uniformly over iterations k ≤ T on the expected number of bits used by an algorithm A to communicate the gradient on iteration k, yields an upper bound T N A , on the expected number of bits communicated over T iterations by algorithm A. Taking T = T A,ε to be the (minimum) number of iterations needed to guarantee an expected suboptimality gap of ε based on the properties of A, we obtain an upper bound, ζ A,ε = T A,ε N A , on the expected number of bits of communicated on a run expected to achieve a suboptimality gap of at most ε. 

B Kε 2 > β ε , ζ NUQSGD,ε = O 1 ε 2 d(d -2 2s ) log √ d 2 s and ζ QSGD,ε = O( 1 ε 2 d log √ d).

Focusing on the dominant terms in the expressions of overall number of communication bits required to guarantee a suboptimality gap of ε, we observe that NUQSGD provides slightly stronger guarantees. Note that our stronger guarantees come without any assumption about the data.

5. EXPERIMENTAL EVALUATION:

In this section, we examine the practical performance of NUQSGD in terms of both convergence (accuracy) and speedup. The goal is to empirically show that NUQSGD can provide the same performance and accuracy compared to the QSGDInf heuristic, which has no theoretical compression guarantees. For this, we implement and test these three methods (NUQSGD, QSGD, and QSGDInf), together with the distributed full-precision SGD baseline, which we call SuperSGD. We split our study across two axes: first, we examine the convergence of the methods and their induced variance. Second, we provide an efficient implementation of all four methods in Pytorch using the Horovod communication back-end (Sergeev and Del Balso, 2018) , adapted to efficiently support quantization, and examine speedup relative to the full-precision baseline. We investigate the impact of quantization on training performance by measuring loss, variance, accuracy, and speedup for ResNet models (He et al., 2016) applied to ImageNet (Deng et al., 2009) and CIFAR10 (Krizhevsky) .

We evaluate these methods on two image classification datasets: ImageNet and CIFAR10. We train ResNet110 on CIFAR10 and ResNet18 on ImageNet with mini-batch size 128 and base learning rate 0.1. In all experiments, momentum and weight decay are set to 0.9 and 10 -4 , respectively. The bucket size and the number of quantization bits are set to 8192 and 4, respectively. We observe similar results in experiments with various bucket sizes and number of bits. We simulate a scenario with k GPUs for all three quantization methods by estimating the gradient from k independent mini-batches and aggregating them after quantization and dequantization.

In Figure 3 (left and middle), we show the training loss with 8 GPUs. We observe that NUQSGD and QSGDinf improve training loss compared to QSGD on ImageNet. We observe significant gap in training loss on CIFAR10 where the gap grows as training proceeds. We also observe similar performance gaps in test accuracy (provided in Appendix F). In particular, unlike NUQSGD, QSGD does not achieve test accuracy of full-precision SGD. Figure 3 (right) shows the mean normalized variance of the gradient (defined in Appendix F) versus training iteration on the trajectory of single-GPU SGD on CIFAR10. These observations validate our theoretical results that NUQSGD has smaller variance for large models with small number of quantization bits.

Efficient Implementation and Speedup. To examine speedup behavior, we implemented all quantization methods in Horovod (Sergeev and Del Balso, 2018) , a communication back-end supporting Pytorch, Tensorflow and MXNet. Doing so efficiently requires non-trivial refactoring of this framework, since it does not support communication compression-our framework will be open-sourced upon publication. Our implementation diverges slightly from the theoretical analysis. First, Horovod applies "tensor fusion" to multiple layers, by merging the resulting gradient tensors for more efficient transmission. This causes the gradients for different layers to be quantized together, which can lead to loss of accuracy (due to e.g. different normalization factors across the layers). We addressed this by tuning the way in which tensor fusion is applied to the layers such that it minimizes the accuracy loss. Second, we noticed that quantizing the gradients corresponding to the biases has a significant adverse effect on accuracy; since the communication impact of biases is negligible, we transmit them at full precision. We apply this for all methods considered. Finally, for efficiency reasons, we directly pack the quantized values into 32-bit numbers, without additional encoding. We implemented compression and de-compression via efficient CUDA kernels.

Our baselines are full-precision SGD (SuperSGD), Error-Feedback SignSGD (Karimireddy et al., 2019) , and the QSGDinf heuristic, which we compare against the 4-bit and 8-bit NUQSGD variants executing the same pattern. The implementation of the QSGDinf heuristic provides almost identical convergence numbers, and is sometimes omitted for visibility. (QSGD yields inferior convergence on this dataset and is therefore omitted.) All variants are implemented using a standard all-to-all reduction pattern. Figures 4 (left), (middle) show the execution time per epoch for ResNet34 and ResNet50 models on ImageNet, on a cluster machine with 8 NVIDIA 2080 Ti GPUs, for the hyperparameter values quoted above. The results confirm the efficiency and scalability of the compressed variant, mainly due to the reduced communication volume. We note that the overhead of compression and decompression is less than 1% of the batch computation time for NUQSGD.

Figure 4 (right) presents end-to-end speedup numbers (time versus accuracy) for ResNet50/ImageNet, executed on 4 GPUs, under the same hyperparameter settings as the full-precision baseline, with bucket size 512. First, notice that NUQSGD variants match the target accuracy of the 32-bit model, with non-trivial speedup over the standard data-parallel variant, directly proportional to the perepoch speedup. The QSGDinf heuristic yields similar accuracy and performance, and is therefore omitted. Second, we found that unfortunately EF-SignSGD does not converge under these standard hyperparameter settings. To address this issue, we performed a non-trivial amount of hyperparameter tuning for this algorithm: in particular, we found that the scaling factors and the bucket size must be carefully adjusted for convergence on ImageNet. We were able to recover full accuracy with EF-SignSGD on ResNet50, but that the cost of quantizing into buckets of size 64. Unfortunately, in this setting the algorithm transmits a non-trivial amount of scaling data, and the GPU implementation becomes less efficient due to error computation and reduced parallelism. The end-to-end speedup of this tuned variant is inferior to NUQSGD-4bit, and only slightly superior to that of NUQSGD-8bit. Please see Figure 9 in the Appendix and the accompanying text for details.

6. CONCLUSIONS:

We study data-parallel and communication-efficient version of stochastic gradient descent. Building on QSGD (Alistarh et al., 2017) , we study a nonuniform quantization scheme. We establish upper bounds on the variance of nonuniform quantization and the expected code-length. In the overparametrized regime of interest, the former decreases as the number of quantization levels increases, while the latter increases with the number of quantization levels. Thus, this scheme provides a trade-off between the communication efficiency and the convergence speed. We compare NUQSGD and QSGD in terms of their variance bounds and the expected number of communication bits required to meet a certain convergence error, and show that NUQSGD provides stronger guarantees. Experimental results are consistent with our theoretical results and confirm that NUQSGD matches the performance of QSGDinf when applied to practical deep models and datasets including ImageNet. Thus, NUQSGD closes the gap between the theoretical guarantees of QSGD and empirical performance of QSGDinf. One limitation of our study which we aim to address in future work is that we focus on all-to-all reduction patterns, which interact easily with communication compression.

In particular, we aim to examine the interaction between more complex reduction patterns, such as ring-based reductions (Hannun et al., 2014) , which may yield superior performance in bandwidthbottlenecked settings, but which interact with communication-compression in non-trivial ways, since they may lead a gradient to be quantized at each reduction step. By inspection, the quantized gradient Q s (v) is determined by the tuple ( v , ρ ρ ρ, h), where v is the norm of the gradient, ρ ρ ρ [sign(v 1 ), • • • , sign(v d )] T is the vector of signs of the coordinates v i 's, and h [h 1 (v, s), • • • , h d (v, s)] T are the quantizations of the normalized coordinates. We can describe the ENCODE function (for Algorithm 1) in terms of the tuple ( v , ρ ρ ρ, h) and an encoding/decoding scheme ERC : {1, 2, • • • } → {0, 1} * and ERC -1 : {0, 1} * → {1, 2, • • • } for encoding/decoding positive integers.

The encoding, ENCODE(v), of a stochastic gradient is as follows: We first encode the norm v using b bits where, in practice, we use standard 32-bit floating point encoding. We then proceed in rounds, r = 0, 1, • • • . On round r, having transmitted all nonzero coordinates up to and including t r , we transmit ERC(i r ) where t r+1 = t r + i r is either (i) the index of the first nonzero coordinate of h after t r (with t 0 = 0) or (ii) the index of the last nonzero coordinate. In the former case, we then transmit one bit encoding the sign ρ t r+1 , transmit ERC(log(2 s+1 h t r+1 )), and proceed to the next round. In the latter case, the encoding is complete after transmitting ρ t r+1 and ERC(log(2 s+1 h t r+1 )).

The DECODE function (for Algorithm 1) simply reads b bits to reconstruct v . Using ERC -1 , it decodes the index of the first nonzero coordinate, reads the bit indicating the sign, and then uses ERC -1 again to determines the quantization level of this first nonzero coordinate. The process proceeds in rounds, mimicking the encoding process, finishing when all coordinates have been decoded.

Like Alistarh et al. (2017) , we use Elias recursive coding (Elias, 1975, ERC) to encode positive integers. ERC is simple and has several desirable properties, including the property that the coding scheme assigns shorter codes to smaller values, which makes sense in our scheme as they are more likely to occur. Elias coding is a universal lossless integer coding scheme with a recursive encoding and decoding structure.

The Elias recursive coding scheme is summarized in Algorithm 2. For any positive integer N, the following results are known for ERC (Alistarh et al., 2017) : 

1. |ERC(N)| ≤ 1 + o(1) log N + 1; 2. ERC(N)

B PROOF OF THEOREM 2 (VARIANCE BOUND):

We first find a simple expression of the variance of Q s (v) for every arbitrary quantization scheme in the following lemma:

Lemma 1. Let v ∈ R d , L = (l 0 , l 1 , • • • , l s+1

), and fix s ≥ 1. The variance of Q s (v) for general sequence of quantization levels is given by

EQUATION

)

where r i = |v i |/ v and p(r), s(r), τ(r) are defined in Section 3.1.

Proof. Noting the random quantization is i.i.d over elements of a stochastic gradient, we can decompose

E[ Q s (v) -v 2 ] as: E[ Q s (v) -v 2 ] = d ∑ i=1 v 2 σ 2 (r i ) (6) where σ 2 (r i ) = E[(h i (v, s) -r i ) 2 ]. Computing the variance of h i (v, s), we can show that σ 2 (r i ) = τ 2 (r i )p(r i ) 1 -p(r i ) .

In the following, we consider NUQSGD algorithm with L = (0, 1/2 s , • • • , 2 s-1 /2 s , 1) as the quantization levels. Then, h i (v, s)'s are defined in two cases based on which quantization interval r i falls into:

1) If r i ∈ [0, 2 -s ], then h i (v, s) = 0 with probability 1 -p 1 (r i , s); 2 -s otherwise (7)

where p 1 r, s = 2 s r.

2) If r i ∈ [2 j-s , 2 j+1-s ] for j = 0, • • • , s -1, then h i (v, s) = 2 j-s with probability 1 -p 2 (r i , s); 2 j+1-s otherwise (8)

where p 2 r, s = 2 s-j r -1. Note that Q s (0) = 0.

Let S j denote the coordinates of vector v whose elements fall into the ( j + 1)-th bin, i.e., S 0 {i :

r i ∈ [0, 2 -s ]} and S j+1 {i : r i ∈ [2 j-s , 2 j+1-s ]} for j = 0, • • • , s -1. Let d j |S j |.

Applying the result of Lemma 1, we have

EQUATION

where τ j l j+1l j for j ∈ {0, • • • , s}.

Substituting τ 0 = 2 -s and τ j = 2 j-1-s for j ∈ {1, • • • , s} into (9), we have

EQUATION

We first note that ∑ i∈S 0 p 1 (r i , s) ≤ d and ∑ i∈S j+1 p 2 (r i , s) ≤ d for all j, i.e., an upper bound on the variance of

Q s (v) is given by E[ Q s (v) -v 2 ] ≤ v 2 d/3(2 -2s+1 + 1)

. Furthermore, we have

EQUATION

)

Substituting the upper bounds in ( 11) and ( 12) into ( 10), an upper bound on the variance of Q s (v) is given by

EQUATION

)

The upper bound in ( 13) cannot be used directly as it depends on {d 0 , • • • , d s }. Note that d j 's depend on quantization intervals. In the following, we obtain an upper bound on E[ Q s (v) -v 2 ], which depends only on d and s. To do so, we need to use this lemma inspired by (Alistarh et al., 2017, Lemma A.5 ): Let • 0 count the number of nonzero components. Lemma 2. Let v ∈ R d . The expected number of nonzeros in Q s (v) is bounded above by

EQUATION

)

For each i ∈ S 0 , Q s (v i ) becomes zero with probability 1 -2 s r i , which results in

EQUATION

)

Using a similar argument as in the proof of Lemma 2, we have

EQUATION

) Note that d s = d -d 0 -• • • -d s-1 .

We define

EQUATION

)

Note that d0 ≤ d 0 , d1

+ d0 ≤ d 1 + d 0 , • • • , ds-1 + • • • + d0 ≤ d s-1 + • • • + d 0 , and ds + • • • + d0 = d s + • • • + d 0 .

Noting that the coefficients of the additive terms in the upper bound in ( 13) are monotonically increasing with j, we can find an upper bound on 13), which gives (3) and completes the proof.

E[ Q s (v) -v 2 ] by replacing (d 0 , • • • , d s ) with ( d0 , • • • , ds ) in (

C PROOF OF THEOREM 3 (CODE-LENGTH BOUND):

Let | • | denote the length of a binary string. In this section, we find an upper bound on E[|ENCODE(v)], i.e., the expected number of communication bits per iteration. Recall from Appendix A that the quantized gradient

Q s (v) is determined by the tuple ( v , ρ ρ ρ, h). Write i 1 < i 2 < • • • < i h 0 for the indices of the h 0 nonzero entries of h. Let i 0 = 0.

The encoding produced by ENCODE(v) can be partitioned into two parts, R and E, such that, for j = 1, . . . , h 0 ,

• R contains the codewords ERC(i ji j-1 ) encoding the runs of zeros; and

• E contains the sign bits and codewords ERC(log{2 s+1 h i j }) encoding the normalized quantized coordinates.

Note that

[i 1 , i 2 -i 1 , • • • , i h 0 -i h 0 -1 ] 1 ≤ d.

Thus, by (Alistarh et al., 2017, Lemma A.3) , the properties of Elias encoding imply that

EQUATION

)

We now turn to bounding |E|. The following result in inspired by (Alistarh et al., 2017, Lemma A.3 ).

Lemma 3. Fix a vector q such that q p p ≤ P, let i 1 < i 2 < . . . i q 0 be the indices of its q 0 nonzero entries, and assume each nonzero entry is of form of 2 k , for some positive integer k. Then

q 0 ∑ j=1 |ERC(log(q i j ))| ≤(1 + o(1)) log 1 p + q 0 + (1 + o(1)) q 0 log log P q 0 .

Proof. Applying property (1) for ERC (end of Appendix A), we have

q 0 ∑ j=1 |ERC(log(q i j ))| ≤ (1 + o(1)) q 0 ∑ j=1 log log q i j + q 0 ≤ (1 + o(1)) log 1 p + q 0 + (1 + o(1)) q 0 ∑ j=1 log log q p i j ≤ (1 + o(1)) log 1 p + q 0 + (1 + o(1)) q 0 log log P q 0

where the last bound is obtained by Jensen's inequality.

Taking q = 2 s+1 h, we note that q 2 = 2 2s+2 h 2 and

EQUATION

By Lemma 3 applied to q and the upper bound (20),

EQUATION

Combining ( 19) and ( 21), we obtain an upper bound on the expected code-length:

EQUATION

where

EQUATION

It is not difficult to show that, for all k > 0, g 1 (x) x log k x is concave. Note that g 1 is an increasing function up to x = k/e. Defining g 2 (x) x log log C

x and taking the second derivative, we have

EQUATION

)

Hence g 2 is also concave on x < C. Furthermore, g 2 is increasing up to some C/5 < x * < C/4. We note that E[ h 0 ] ≤ 2 2s + √ d2 s following Lemma 2. By assumption 2 2s + √ d2 s ≤ d/e, and so, Jensen's inequality and (22) lead us to (4).

D PROOF OF THEOREM 4 (NUQSGD FOR SMOOTH CONVEX OPTIMIZATION):

Let g(w) and ĝ(w) denote the full-precision and decoded stochastic gradients, respectively. Then

EQUATION

) By Theorem 2, E[ ĝ(w) -g(w) 2 ] ≤ ε Q E[ g(w) 2 ]. By assumption, E[ g(w) 2 ] ≤ B. Noting g(w) is unbiased, E[ ĝ(w) -∇ f (w) 2 ] ≤ (1 + ε Q )B.

The result follows by Corollary 1. E PROOF OF THEOREM 5 (EXPECTED NUMBER OF COMMUNICATION BITS)

Assuming 2 B Kε 2 > β ε , then T ε = O 2 B Kε 2 R 2 .

Ignoring all but terms depending on d and s, we have

T ε = O( B/ε 2 ). Following Theorems 2 and 3 for NUQSGD, ζ NUQSGD,ε = O(N Q ε Q B/ε 2 ). For QSGD, following the results of Alistarh et al. (2017), ζ QSGD,ε = O( ÑQ εQ B/ε 2 ) where ÑQ = 3(s 2 + s √ d) + ( 3 2 + o(1))(s 2 + s √ d) log 2(s 2 +d) s 2 + √ d + b and εQ = min d s 2 , √ d s .

In overparameterized networks, where d ≥ 2 2s+1 , we have In this section, we present further experimental results in a similar setting to Section 5.

ε Q = 2 -s √ d -2 2s + O(

In Figure 6 We also measure the variance and normalized variance at fixed snapshots during training by evaluating multiple gradient estimates using each quantization method. All methods are evaluated on the same trajectory traversed by the single-GPU SGD. These plots answer this specific question: What would the variance of the first gradient estimate be if one were to train using SGD for any number of iterations then continue the optimization using another method? The entire future trajectory may change by taking a single good or bad step. We can study the variance along any trajectory. However, the trajectory of SGD is particularly interesting because it covers a subset of points in the parameter space that is likely to be traversed by any first-order optimizer. For multi-dimensional parameter space, we average the variance of each dimension.

Figure 5 (left), shows the variance of the gradient estimates on the trajectory of single-GPU SGD on CIFAR10. We observe that QSGD has particularly high variance, while QSGDinf and NUQSGD have lower variance than single-GPU SGD.

We also propose another measure of stochasticity, normalized variance, that is the variance normalized by the norm of the gradient. The mean normalized variance can be expressed as

E i [V A [∂ l(w; z)/∂ w i ]] E i [E A [(∂ l(w; z)/∂ w i ) 2 ]]

where l(w; z) denotes the loss of the model parametrized by w on sample z and subscript A refers to randomness in the algorithm, e.g., randomness in sampling and quantization. Normalized variance can be interpreted as the inverse of Signal to Noise Ratio (SNR) for each dimension. We argue that the noise in optimization is more troubling when it is significantly larger than the gradient. For sources of noise such as quantization that stay constant during training, their negative impact might only be observed when the norm of the gradient becomes small. In Figure 7 , we show the mean normalized variance of the gradient versus training iteration on CIFAR10 and ImageNet. For different methods, the variance is measured on their own trajectories. Since the variance depends on the optimization trajectory, these curves are not directly comparable. Rather the general trend should be studied.

ResNet152 Weak Scaling. In Figure 8 , we present the weak scaling results for ResNet152/ImageNet. Each of the GPUs receives a batch of size 8, and we therefore scale up the global batch size by the number of nodes. The results exhibit the same superior scaling behavior for NUQSGD relative to the uncompressed baseline.

EF-SignSGD Convergence. In Figure 9 , we present a performance comparison for NUQSGD variants (bucket size 512) and a convergent variant of EF-SignSGD with significant levels of parameter tuning for convergence. We believe this to be the first experiment to show convergence of the latter method at ImageNet scale, as the original paper only considers the CIFAR dataset. For convergence, we have tuned the choice of scaling factor and the granularity at which quantization is applied (bucket size). We have also considered learning rate tuning, but that did not appear to prevent divergence in the early stages of training for this model. We did not attempt warm start, since that would significantly decrease the practicality of the algorithm. We have found that bucket size 64 is the highest at which the algorithm will still converge on this model and dataset, and found 1-bit SGD scaling (Seide et al., 2014) , which consists of taking sums over positives and over negatives for each bucket, to yield good results. The experiments are executed on a machine with 8 NVIDIA Titan X GPUs, and batch size 256, and can be found in Figure 9 . Under these hyperparameter values the EF-SignSGD algorithm sends 128 bits per each bucket of 64 values (32 for each scaling factor, and 64 for the signs), doubling its baseline communication cost. Moreover, the GPU implementation is not as efficient, as error feedback must be computed and updated at every step, and there is less parallelism to leverage inside each bucket. This explains the fact that the end-to-end performance is in fact close to that of the 8-bit NUQSGD variant, and inferior to 4-bit NUQSGD.

G VARIANCE LOWER BOUND:

In the following theorem, we show that for any given set of levels, there exists a distribution of points with dimension d such that the variance is in Ω( √ d), and so our bound is tight in d.

Theorem 6 (Lower bound). Let d ∈ Z >0 and let (0, l 1 , • • • , l s , 1) denote an arbitrary sequence of quantization levels. Provided d ≥ (2/l 1 ) 2 , there exists a vector v ∈ R d such that the variance of unbiased quantization of v is lower bounded by v 2 l 1 √ d/2, i.e., the variance is in Ω( √ d).

Proof. The variance of Q s (v) for general sequence of quantization levels is given by

E[ Q s (v) -v 2 ] = v 2 d ∑ i=1 σ 2 (r i ).

If r ∈ [l s(r) , l s(r)+1 ], the variance σ 2 (r) can be expressed as

EQUATION

We

consider v 0 = [r, r, • • • , r] T for r = 0. The normalized coordinates is v0 = [1/ √ d, • • • , 1/ √ d] T .

Using ( 26) and noting 1/ √ d < l 1 , we have

EQUATION

Summing variance of all coordinates and applying (27), the variance of Q s (v 0 ) is lower bounded by

EQUATION

H WORST-CASE VARIANCE ANALYSIS

In this section, we first derive the optimal worst-case variance upper bound by optimizing over the distribution of normalized coordinates for an arbitrary sequence of levels, expressed as a solution to an integer program with quadratic constraints. We then relax the program to obtain a quadratically constrained quadratic program (QCQP). A coarser analysis yields an upper bound expressed as a solution to a linear program (LP), which is more amenable to analysis. We solve this LP analytically for the special case of s = 1 and show the optimal level is at 1/2.

Then, for an exponentially spaced collection of levels of the form (0, p s , • • • , p 2 , p, 1) for p ∈ [0, 1] and an integer number of levels, s, we write the expression of QCQP and solve it efficiently using standard solvers. We have a numerical method for finding the optimal value of p that minimizes the worst-case variance, for any given s and d. Through the worst-case analysis, we gain insight into the behaviour of the variance upper bound. We show that our current scheme is nearly optimal (in the worst-case sense) in some cases. Using these techniques we can obtain slightly tighter bounds numerically.

H.1 GENERALLY SPACED LEVELS:

Let L = (l 0 , l 1 , • • • , l s , l s+1 ) denote an arbitrary sequence of quantization levels where l 0 = 0 < l 1 < • • • < l s+1 = 1. Recall that, for r ∈ [0, 1], we define s(r) and p(r) such that they satisfy l s(r) ≤ r ≤ l s(r)+1 and r = 1p(r) l s(r) + p(r)l s(r)+1 , respectively. Define τ(r) = l s(r)+1l s(r) . Note that s(r) ∈ {0, 1, • • • , s}. Then, h i (v, s)'s are defined in two cases based on which quantization interval r i falls into:

1) If r i ∈ [0, l 1 ], then h i (v, s) = 0 with probability 1p 1 (r i , L ); l 1 otherwise (29)

where p 1 r, L = r/l 1 .

2) If r i ∈ [l j-1 , l j ] for j = 1, • • • , s + 1, then h i (v, s) = l j-1 with probability 1p 2 (r i , L ); l j otherwise (30)

where p 2 r, L = (rl j-1 )/τ j-1 .

Let S j denote the coordinates of vector v whose elements fall into the ( j + 1)-th bin, i.e., S j {i :

r i ∈ [l j , l j+1 ]} for j = 0, • • • , s. Let d j |S j |.

Following Lemma 1 and steps in Theorem 2, we can show that

EQUATION

)

Theorem 7 (QCQP bound). Let v ∈ R d . An upper bound on the nonuniform quantization of v is given by ε QP v 2 where ε QP is the optimal value of the following QCQP: subject to z j ≤ τ 2 j d j , z 2 j ≤ τ 2 j d j , j = 0, • • • , s,

Q 1 : max (d 0 ,••• ,d s ,z 0 ,••• ,z s ) s ∑ j=0 z j subject to d -d 0 -• • • -d j ≤ (1/l j+1 ) 2 , j = 0, • • • , s -1,

(32), (33), and (34). 

H.2 EXPONENTIALLY SPACED LEVELS:

In this section, we focus on the special case of exponentially spaced collection of levels of the form L p = (0, p s , • • • , p 2 , p, 1) for p ∈ [0, 1] and an integer number of levels, s. In this case, we have τ 0 = p s and τ j = (1p)p s-j for j = 1, • • • , s.

For any given s and d, we can solve the corresponding quadratic and linear programs efficiently to find the worst-case variance bound. As a bonus, we can find the optimal value of p that minimizes the worst-case variance bound. In Figure 10 , we show the numerical results obtained by solving QCQP Q 1 with L p versus p using CVX (Boyd and Vandenberghe, 2004) . In Figure 10 (left), we fix d and vary s, while in Figure 10 (right), we fix s and vary d. As expected, we note that the variance upper bound increases as d increases and the variance upper bound decreases as s increases. We observe that our current scheme is nearly optimal (in the worst-case sense) in some cases. Further, the optimal value of p shifts to the right as d increases and shifts to the left as s increases.

I NONCONVEX OPTIMIZATION:

We can obtain convergence guarantees to various learning problems where we have convergence guarantees for SGD under standard assumptions. On nonconvex problems, (weaker) convergence guarantees can be established along the lines of, e.g., (Ghadimi and Lan, 2013, Theorem 2.1) . In particular, NUQSGD is guaranteed to converge to a local minima for smooth general loss functions.

Theorem 9 (NUQSGD for smooth nonconvex optimization). Let f : Ω → R denote a possibly nonconvex and β -smooth function. Let w 0 ∈ Ω denote an initial point, ε Q be defined as in Theorem 2, T ∈ Z >0 , and f * = inf w∈Ω f (w). Suppose that Algorithm 1 is executed for T iterations with a learning rate α = O(1/β ) on K processors, each with access to independent stochastic gradients of f with a second-moment bound B. Then there exists a random stopping time R ∈ {0,

• • • , T } such that NUQSGD guarantees E[ ∇ f (w R ) 2 ] ≤ ε where ε = O β ( f (w 0 ) -f * )/T + (1 + ε Q )B .

:



Figures and Tables:

Figure 1: An example of nonuniform stochastic quantization with s = 3. The point between the arrows represents the value of the normalized coordinate.

Figure 2: Variance upper bounds.

Figure 3: Training loss on CIFAR10 (left) and ImageNet (middle) for ResNet models. QSGD, QSGDinf, and NUQSGD are trained by simulating the quantization and dequantizing of the gradients from 8-GPUs. On CIFAR10, SGD refers to the single-GPU training versus on Imagenet it refers to 2-GPU setup in the original ResNet paper. SGD is shown to highlight the significance of the gap between QSGD and QSGDinf. SuperSGD refers to simulating full-precision distributed training without quantization. SuperSGD is impractical in scenarios with limited bandwidth. (Right) Estimated normalized variance on CIFAR10 on the trajectory of single-GPU SGD. Variance is measured for fixed model snapshots during training. Notice that the variance for NUQSGD and QSGDinf is lower than SGD for almost all the training and it decreases after the learning rate drops.

Figure 4: Scalability behavior for NUQSGD versus the full-precision baseline when training ResNet34 and ResNet50 on ImageNet. The ResNet34 graph examines strong scaling (left), splitting a global batch of size 256 onto the available GPUs, whereas the ResNet50 graph examines strong scaling (middle) keeping a fixed per-GPU batch size of 16. Each time bar is split into computation (bottom), encoding cost (middle), and transmission cost (top). Notice the significant negative scalability of the SGD baseline in both scenarios. By contrast, the 4-bit communication-compressed implementation achieves positive scaling, while the 8-bit variant stops scaling between 4 and 8 nodes due to the higher communication and encoding costs. End-to-end training time for ResNet50/ImageNet for NUQSGD and EF-SignSGD versus the SuperSGD baseline (right).

can be encoded and decoded in time O(|ERC(N)|); 3. Decoding can be done without knowledge of an upper bound on N.

Figure 5: Estimated variance (left) and normalized variance (right) on CIFAR10 on the trajectory of single-GPU SGD. Variance is measured for fixed model snapshots during training. Notice that the variance for NUQSGD and QSGDinf is lower than SGD for almost all the training and it decreases after the learning rate drops. All methods except SGD simulate training using 8 GPUs. SuperSGD applies no quantization to the gradients and represents the lowest variance we could hope to achieve.

Figure6: Accuracy on the hold-out set on CIFAR10 (left) and on ImageNet (right) for training ResNet models from random initialization until convergence. For CIFAR10, the hold-out set is the test set and for ImageNet, the hold-out set is the validation set.

Figure 5 (right) shows the mean normalized variance of the gradient versus training iteration. Observe that the normalized variance for QSGD stays relatively constant while the unnormalized variance of QSGD drops after the learning rate drops. It shows that the quantization noise of QSGD can cause slower convergence at the end of the training than at the beginning.

Figure 8: Scalability behavior for NUQSGD versus the full-precision baseline when training ResNet152 on ImageNet.

Figure 9: End-to-end training time for ResNet50/ImageNet for NUQSGD and EF-SignSGD versus the SGD baseline.

, z 2 j ≤ τ 2 j d j , j = 0, • • • , s, d j ≥ 0, j = 0, • • • , s.Proof. Following Lemma 2, we havedd 0d 1 -• • •d j ≤ (1/l j+1 ) 2 (32) for j = 0, • • • , s -1. The problem of optimizing (d 0 , • • • , d s ) to maximize the variance upper bound (31) subject to (32, τ j d j } subject to (32), j = 0, • • • , s -1, Z ≥0 , j = 0, • • • , s.(34)Let z j min{τ 2 j d j , τ j d j } denote an auxiliary variable for j = 0, • • • , s. Problem R 1 can be rewritten as R 2 : max(d 0 ,••• ,d s ,z 0 ,••• ,z s )

Figure 10: Optimal value of problem Q 1 versus p ∈ [0, 1] for exponentially spaced collection of levels of the form (0, p s , • • • , p 2 , p, 1).

Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, et al. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014. Elias recursive coding produces a bit string encoding of positive integers.

Table content: <table><tr><td>P. Elias. Universal codeword sets and representations of the integers. IEEE Transactions on</td></tr><tr><td>Information Theory, 21(2):194-203, 1975.</td></tr><tr><td>S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge Univ. Press, 2004.</td></tr><tr><td>A ENCODING</td></tr><tr><td>Encoding:</td></tr><tr><td>Place a 0 at the end of the string;</td></tr><tr><td>if N == 1 then</td></tr><tr><td>Stop;</td></tr><tr><td>else</td></tr><tr><td>Prepend binary(N) to the beginning;</td></tr><tr><td>Let N denote # bits prepended minus 1;</td></tr><tr><td>Encode N recursively;</td></tr><tr><td>Decoding:</td></tr><tr><td>Start with N = 1;</td></tr><tr><td>if the next bit == 0 then</td></tr><tr><td>Stop and return N;</td></tr><tr><td>else</td></tr><tr><td>Read that bit plus N following bits;</td></tr><tr><td>Update N;</td></tr><tr><td>Algorithm 2:</td></tr></table>

, we show the test accuracy for training ResNet110 on CIFAR10 and validation accuracy for training ResNet34 on ImageNet from random initialization until convergence (discussed in Section 5). Similar to the training loss performance, we observe that NUQSGD and QSGDinf outperform QSGD in terms of test accuracy in both experiments. In both experiments, unlike NUQSGD, QSGD does not recover the test accuracy of SGD. The gap between NUQSGD and QSGD on ImageNet is significant. We argue that this is achieved because NUQSGD and QSGDinf have lower variance relative to QSGD. It turns out both training loss and generalization error can benefit from the reduced variance. Estimated normalized variance on CIFAR10 (left) and ImageNet (right). For different methods, the variance is measured on their own trajectories. Note that the normalized variance of NUQSGD and QSGDinf is lower than SGD for almost the entire training. It decreases on CIFAR10 after the learning rate drops and does not grow as much as SGD on ImageNet. Since the variance depends on the optimization trajectory, these curves are not directly comparable. Rather the general trend should be studied.

Table content: <table><tr><td>Mean Normalized Variance</td><td>0.00 0.25 0.50 0.75 1.00 1.25</td><td colspan="2">SGD QSGD QSGDinf NUQSGD SuperSGD</td><td/><td>Mean Normalized Variance</td><td>0.7 0.8 0.9 1.0 1.1</td><td/><td/><td/></tr><tr><td/><td>0</td><td>2</td><td>4 Training Iteration</td><td>6</td><td>8 1e4</td><td>0</td><td>1</td><td>2 Training Iteration 3 4</td><td>5</td><td>6 1e5</td></tr><tr><td colspan="2">Figure 7:</td><td/><td/><td/><td/><td/><td/><td/><td/></tr></table>

Peer review (iclr2020):
In this paper, the authors propose a new gradient compression method, which is called nonuniform quantization. The algorithm is a reasonable variant of SGD with uniform quantization. The paper is well written. The experiments show good performance. However, there are several weakness in this paper: 1. In this paper, a very important reference and baseline is missing, which is call error-feedback SGD [1]. Although the title of [1] focuses on SignSGD, it provides a general algorithm for arbitrary compressor with a error/variance bound similar to Theorem 2 in this paper, no matter the compressor is unbiased or not. Since [1] provides the SOTA results for quantized SGD, the proposed algorithm should be compared to it in the experiments. 2. This paper claims to have strong theoretical guarantees. However, the theoretical analysis only works for convex functions. Note that the theoretical analysis in [1] also works for non-convex functions. 3. Regardless of the convergence guarantees (which is weak considering the existing theorems in [1]). the proposed algorithm, NUQSGD, does not show improvement on the convergence, compared to the baseline QSGDinf. 4. In Figure 3, the experiments only show loss vs. # of iterations, which does not show the actual training time. In Figure 4, training time is only shown for NUQSGD, which ignores the other baselines including QSGD and QSGDinf. What I really what to see is training loss (or testing accuracy) vs. training time (or communication overhead, such as number of bits), so that we can evaluate the trade-off between communication overhead and the convergence, compared to the baselines. Minor issue (I hope the authors can consider the following suggestions in a revised version. However, since the issue is minor, it doesn*t affect the score): !. In Definition 1, in some cases is c constant integer, and in some other case become a function, which is very confusing and not friendly to the readers. I also hope the authors can highlight the definition of and , which are essential for understanding the nonuniform quantization mechanism. -------------- Reference [1] Karimireddy, Sai Praneeth et al. “Error Feedback Fixes SignSGD and other Gradient Compression Schemes.” ICML (2019).