We provide a discussion of several recent results which, in certain scenarios, are able to overcome a barrier in distributed stochastic optimization for machine learning (ML). Our focus is the so-called asymptotic network independence property, which is achieved whenever a distributed method executed over a network of
Introduction: Distributed optimization and its limitations
First-order optimization methods, ranging from vanilla gradient descent to Nesterov acceleration and its many variants, have emerged over the past decade as the principal way to train ML models. There is a great need for techniques that train such models quickly and reliably in a distributed fashion over networks where the individual processors or GPUs may be scattered across the globe and communicate over an unreliable network, which may suffer from message losses, delays, and asynchrony (see [1], [2], [29], and [33]).
Unfortunately, what often happens is that the gains achieved from having many different processors running an optimization algorithm are squandered by the cost of coordination, shared memory, message losses, and latency. This effect is especially pronounced when there are many processors and they are spread across geographically distributed data centers. As is widely recognized by the distributed systems community, “throwing” more processors at a problem will not, after a certain point, result in better performance.
This is typically reflected in the convergence time bounds obtained for distributed optimization in the literature. The problem formulation is that one must solve
\[{z}^{\ast}\in\arg\mathop{\min}\limits_{z\in{Bbb{R}}^{d}}\mathop{\sum}\limits_{i = 1}\limits^{n}{f_i}\left({z}\right), \tag{1} \]
An example of a network. Two nodes are connected if there is an edge between them.
This relatively simple formulation captures a large variety of learning problems. Suppose each agent \[{\theta}^{\ast}\in\arg\mathop{\min}\limits_{\theta\in{Bbb{R}}^{d}}\mathop{\sum}\limits_{i = 1}\limits^{n}{c_i}\left({\theta},{\cal{X}}_{i}\right), \tag{2} \]
\[{c}_{i}\left({\theta},{\cal{X}}_{i}\right) = \mathop{\sum}\limits_{\left({x}_{j},{y}_{j}\right)\in{\cal{X}}_{i}}{\ell}\left({h}\left({x}_{j};{\theta}\right),{y}_{j}\right)\]
It is also possible that each agent \[{\theta}^{\ast}\in\arg\mathop{\min}\limits_{\theta\in{Bbb{R}}^{d}}\mathop{\sum}\limits_{i = 1}\limits^{n}{f_i}\left({\theta}\right), \tag{3} \]
\[{f}_{i}\left({\theta}\right) = {\Bbb{E}}_{\left({x}_{i},{y}_{i}\right)\sim{\Bbb{P}}_{i}}{\ell}\left({h}\left({x}_{i};{\theta}\right),{y}_{i}\right).\]
This article is concerned with the current limitations of distributed optimization and how to overcome them in certain scenarios. To illustrate our main concern, let us consider the distributed subgradient method in the simplest possible setting, namely, the problem of computing the median of a collection of numbers in a distributed manner over a fixed graph. Each agent \[{f}_{i}\left({z}\right) = \left\vert{z - {m}_{i}}\right\vert,\,\,\forall{i}.\]
The distributed subgradient method (see [18]) uses subgradients \[{z}_{i}\left({k} + {1}\right) = \mathop{\sum}\limits_{j = 1}\limits^{n}{w}_{ij}{z}_{j}\left({k}\right) - {\alpha}_{k}{s}_{i}\left({z}_{i}\left({k}\right)\right), \tag{4}\]
\[{z}\left({k} + {1}\right) = {z}\left({k}\right) - {\alpha}_{k}\frac{1}{n}\mathop{\sum}\limits_{j = 1}\limits^{n}{s_j}\left({z}\left({k}\right)\right). \tag{5} \]
In Figure 2, we show the performance of algorithm (4) as a function of the network size
The performance of algorithm (4) as a function of the network size
Clearly this is an undesirable property. Glancing at the figure, we see that distributing computation over 50 nodes can result in a convergence time on the order of 107 iterations. Few practitioners will be enthusiastic about distributed optimization if the final effect is vastly increased convergence time.
One might hope that this phenomenon, demonstrated for the problem of median computation and considered here because it is arguably the simplest problem to which one can apply the subgradient method, will not hold for the more sophisticated optimization problems in ML literature. Unfortunately, most work in distributed optimization replicates this undesirable phenomenon. Next we give an extremely brief discussion of known convergence times in the distributed setting (for a much more extended discussion, we refer the reader to the recent survey in [17]).
We confine our discussion to the following point: most known convergence times in the distributed optimization literature imply bounds of the form
\[{\text{Time}}_{{n},{\epsilon}}\left({\text{decentralized}}\right)\,≤\,{p}\left({\cal{G}}\right){\text{Time}}_{{n},{\epsilon}}\left({\text{centralized}}\right), \tag{6} \]
For instance, in the subgradient methods, [17, Corollary 9] implies that
\begin{align*}&{\text{Time}}_{{n},{\epsilon}}\left({\text{decentralized}}\right) = {\cal{O}}\left(\frac{\max\left\{{\left\Vert \frac{1}{n}\mathop{\sum}\limits_{i = 1}\limits^{n}{z}_{i}\left({0}\right) - {z}^{\ast}\right\vert}^{2},{G}^{4}{h}\left({\cal{G}}\right)\right\}}{{\epsilon}^{2}}\right), \\ & {\text{Time}}_{{n},{\epsilon}}\left({\text{centralized}}\right) = {\cal{O}}\left(\frac{\max\left\{{\left\Vert{z}\left({0}\right) - {z}^{\ast}\right\Vert}^{2},{G}^{4}\right\}}{{\epsilon}^{2}}\right), \end{align*}
By comparing
Framed in this way, the polynomial scaling in the quantity
Sometimes
There are a number of caveats to the pessimistic argument outlined previously in this section. For example, in a multiagent scenario where data sharing is not desirable or feasible, decentralized computation might be the only option available. Generally speaking, however, fast-growing
There are some scenarios that avoid the pessimistic discussion mentioned previously: for example, when the underlying graph is an expander, the associated spectral gap is constant (see [8, Ch. 6] for a definition of these terms as well as an explanation), and likewise when the graph is a star graph. In particular, on a random Erdo˝s–Rényi random graph, the quantity
Asymptotic network independence in distributed stochastic optimization
In this article, we provide a discussion of several recent papers which have obtained that, for a number of settings involving distributed stochastic optimization,
We call this property asymptotic network independence: it is as if the network is not even there. Asymptotic network independence provides an answer to the concerns raised in the previous section.
We begin by illustrating these results with a simulation from [21], shown in Figure 3. Here the problem to be solved is classification using a smooth support vector machine (SVM) between overlapping clusters of points. The performance of the centralized algorithm is shown in orange, and the performance of the decentralized algorithm is shown in dark blue. The graph is a ring of 50 nodes, and the problem being solved is the search for a support vector classifier. The graph illustrates the main result, which is that a network of 50 nodes performs as well in the limit as does a centralized method with 50 times the computational power of one node. Indeed, after ∼8,000 iterations, the orange and dark blue lines are nearly indistinguishable.
A comparison of DSGD and centralized SGD for training an SVM. (a) A total of 1,000 data points and their labels for SVM classification. The data points are randomly generated around 50 cluster centers. (b) The squared errors and one standard-deviation band for DSGD and centralized SGD. The performance of the centralized algorithm is shown in orange, and the performance of the decentralized algorithm is shown in dark blue. A total of 1,000 Monte Carlo simulations are conducted for estimating the average performance.
We note that similar simulations are available for other ML methods (training neural networks, logistic regression, elastic net regression, and so on). The asymptotic network independence property enables us to efficiently distribute the training process for a variety of existing learning methods.
The name asymptotic network independence is a slight misnomer, as we actually do not care whether the asymptotic performance depends in some complicated way on the network. All we want is for the decentralized convergence rate to be bounded by
The authors in [4]–[6] and [31] gave the first crisp statement of the relationship between centralized and distributed methods in the setting of distributed optimization of smooth, strongly convex functions in the presence of noise. Under constant step sizes, the authors in [4]–[6] were the first to show that, when the step size is sufficiently small, a distributed stochastic gradient method achieves a performance comparable to that of the centralized method in terms of the steady-state mean-square error. The step size has to be small enough as a function of the network topology for this to hold. In [31], the authors showed that the distributed stochastic gradient algorithm asymptotically achieves a convergence rate comparable to that of the centralized method, but assuming that all of the local functions
The work in [22] approximated distributed stochastic gradient algorithm by stochastic differential equations in continuous time by assuming a sufficiently small constant step size. It was shown that the distributed method outperforms a centralized scheme with synchronization overhead; however, it did not lead to straightforward algorithmic bounds. In our recent work [21], we generalized the results to graphs that are time varying, with delays, message losses, and asynchrony. In a parallel recent work [9], a similar result was demonstrated using a further compression technique, which allowed nodes to save on communication.
When the objective functions are not assumed to be convex, several recent works have obtained asymptotic network independence for distributed stochastic gradient methods. In [13] and [14], a general stochastic approximation setting was considered with decaying step sizes, and the convergence rates of centralized and distributed methods were shown to be asymptotically the same; the proof proceeded based on certain technical properties of stochastic approximation methods. The work in [12] was the first to show that distributed algorithms could achieve a speedup like that of a centralized method when the number of computing steps is large enough. Such a result was generalized to the setting of the directed communication networks in [1] for training deep neural networks, where the push-sum technique was combined with the standard distributed stochastic gradient scheme.
We remark that in this survey, all of the previously mentioned algorithms that enjoy the asymptotic network independence property assume smooth objective functions, i.e., functions with Lipschitz continuous gradients.
In the next sections, we provide a simple and readable explanation of the asymptotic network independence phenomenon in the context of distributed stochastic optimization over smooth and strongly convex objective functions. For more information on the topic of distributed stochastic optimization, the reader is referred to [10], [15], [23], [24], [28], [30], and [32] and the references therein.
Setup
We are interested in minimizing (1) over a network of
Assumption 1
Each \begin{align*}&{\langle}\nabla{f}_{i}\left({z}\right) - \nabla{f}_{i}\left({z}'\right),{z} - {z}'\rangle\,≥\,{\mu} {\left\Vert{z} - {z}'\right\Vert}^{2}, \\ & {\left\Vert{\nabla}{f}_{i}\left({z}\right) - \nabla{f}_{i}\left({z}'\right)\right\Vert}\,≤\,{L}\left\Vert{z} - {z}'\right\Vert. \tag{7} \end{align*}
Under “Assumption 1,” (1) has a unique optimal solution,
Lemma 1
For any
In other words, gradient descent with a small step size reduces the distance between the current solution and
In the stochastic optimization setting, we assume that at each iteration
Assumption 2
For all \begin{align*}&{\Bbb{E}}_{{\xi}_{i,k}}\left[{g}_{i}\left({z}_{i}\left({k}\right),{\xi}_{i}\left({k}\right)\right)\,\vert\,{z}_{i}\left(k\right)\right] = \nabla{f}_{i}\left({z}_{i}\left({k}\right)\right), \\ & {\Bbb{E}}_{{\xi}_{i,k}}\left[{\left\Vert{g}_{i}\left({z}_{i}\left({k}\right),{\xi}_{i}\left({k}\right)\right) - \nabla{f}_{i}\left({z}_{i}\left({k}\right)\right)\right\Vert}^{2}\,\vert\,{z}_{i}\left({k}\right)\right]\,≤\,{\sigma}^{2},\,\,{\text{for some }}{\sigma}{>}{0}. \tag{8} \end{align*}
Stochastic gradients appear, for instance, when the gradient estimation of
The algorithm we discuss is the DSGD method adapted from distributed gradient descent and the diffusion strategy [3]; note that in [3] this method was called adapt-then-combine. We let each agent \[{z}_{i}\left({k} + {1}\right) = \mathop{\sum}\limits_{j = 1}\limits^{n}{w}_{ij}\left({z}_{j}\left({k}\right) - {\alpha}_{k}{g}_{j}\left({k}\right)\right), \tag{9} \]
DSGD belongs to the class of so-called consensus-based distributed optimization methods, where different agents mix their estimates at each iteration to reach a consensus of the solutions, i.e.,
Assumption 3
The graph
Some examples of undirected connected graphs are presented in Figure 4. Because of “Assumption 3,” the mixing matrix
Examples of undirected connected graphs. (a) A fully connected graph and (b) ring, (c) star, and (d) tree networks.
Lemma 2
Let “Assumption 3” hold, and let \[\left\Vert{\bf{W}}{\bf{\omega}} - {\bf{1}}{\bar{\omega}}\right\Vert\,≤\,{\lambda}{\left\Vert{\bf{\omega}} - {\bf{1}}{\bar{\omega}}\right\Vert}\]
\[{z}_{i}\left({k} + {1}\right) = \mathop{\sum}\limits_{j = 1}\limits^{n}{w}_{ij}{z}_{j}\left({k}\right), \tag{10} \]
Despite the fact that \[\mathop{\sum}\limits_{i = 1}\limits^{n}{\left\Vert{z}_{i}\left({k}\right) - \frac{1}{n}\mathop{\sum}\limits_{j = 1}\limits^{n}{z}_{j}\left({k}\right)\right\Vert}^{2}\,≤\,{\lambda}^{k}\mathop{\sum}\limits_{i = 1}\limits^{n}{\left\Vert{z}_{i}\left({0}\right) - \frac{1}{n}\mathop{\sum}\limits_{j = 1}\limits^{n}{z}_{j}\left({0}\right)\right\Vert}^{2}.\]
By contrast, the optimal rate of convergence for any stochastic gradient methods is sublinear, asymptotically
In the next sections, we discuss and compare the performance of the centralized SGD method and DSGD. We show that both methods asymptotically converge at the rate
Centralized SGD
The benchmark for evaluating the performance of DSGD is the centralized SGD method, which we describe in this section. At each iteration \[{z}\left({k} + {1}\right) = {z}\left({k}\right) - {\alpha}_{k}{\bar{g}}\left({k}\right), \tag{11} \]
\begin{align*}&{\Bbb{E}}\left[{\left\Vert{\bar{g}}\left({k}\right) - \nabla{f}\left({z}\left({k}\right)\right)\right\Vert}^{2}\right]\\ &\quad = \frac{1}{{n}^{2}}\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}\left[{\left\Vert{g}_{i}\left({z}\left({k}\right),{\xi}_{i}\left({k}\right)\right) - \nabla{f}_{i}\left({z}\left({k}\right)\right)\right\Vert}^{2}\right]\,≤\,\frac{{\sigma}^{2}}{n}. \tag{12} \end{align*}
We measure the performance of SGD by
Lazy Metropolis Rule for Constructing W
Notation:
Theorem 1
Under SGD (11), supposing “Assumption 1,” “Assumption 2,” and “Assumption 3” hold, we have
\[{R}\left({k}\right)\,≤\,\frac{{\sigma}^{2}}{{n}{\mu}^{2}{k}} + {\cal{O}}_{k}\left(\frac{1}{{k}^{2}}\right). \tag{13} \]
To compare with the analysis for DSGD later, we briefly describe how to obtain (13). Note that
\begin{align*}{R}\left({k} + {1}\right) = & {\Bbb{E}}\left[{\left\Vert{z}\left({k}\right) - {\alpha}_{k}{\bar{g}}\left({k}\right) - {z}^{\ast}\right\Vert}^{2}\right]\\ = & {\Bbb{E}}\left[{\left\Vert{z}\left({k}\right) - {\alpha}_{k}\nabla{f}\left({z}\left({k}\right)\right) - {z}^{\ast}\right\Vert}^{2}\right] \\ &\quad + {\alpha}_{k}^{2}{\Bbb{E}}\left[{\left\Vert{\nabla}{f}\left({z}\left({k}\right)\right) - {\bar{g}}\left({k}\right)\right\Vert}^{2}\right].\end{align*}
For large \[{R}\left({k} + {1}\right)\,≤\,\left({1} - {\alpha}_{k}{\mu}\right)^{2}{R}\left({k}\right) + \frac{{\alpha}_{k}^{2}{\sigma}^{2}}{n} = {\left({1} - \frac{1}{k}\right)}^{2}{R}\left({k}\right) + \frac{{\sigma}^{2}}{{n}{\mu}^{2}}\frac{1}{{k}^{2}}. \tag{14} \]
A simple induction then gives (13).
DSGD
We assume the same step-size policy for DSGD and SGD. To analyze DSGD starting from (9), define
\[{\bar{z}}\left({k}\right) = \frac{1}{n}\mathop{\sum}\limits_{i = 1}\limits^{n}{{z}_{i}}\left({k}\right), \tag{15} \]
\begin{align*} \frac{1}{n}\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}\left[{\left\Vert{z}_{i}\left({k}\right) - {z}^{\ast}\right\Vert}^{2}\right] = & {\Bbb{E}}\left[{\left\Vert{\bar{z}}\left({k}\right) - {z}^{\ast}\right\Vert}^{2}\right]\\ & + \frac{1}{n}\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}\left[{\left\Vert{z}_{i}\left({k}\right) - {\bar{z}}\left({k}\right)\right\Vert}^{2}\right]. \tag{16} \end{align*}
Exploring the two terms will provide us with insights into the performance of DSGD. To simplify notation, denote
Inspired by the analysis for SGD, we first look for an inequality that bounds \begin{align*}{U}\left({k} + {1}\right)\,≤\,& {\left({1} - \frac{1}{k}\right)}^{2}{U}\left({k}\right) + \frac{2{L}}{{\sqrt{n}}{\mu}}\frac{\sqrt{{U}\left({k}\right){V}\left({k}\right)}}{k}\\ & + \frac{{L}^{2}}{{n}{\mu}^{2}}\frac{{V}\left({k}\right)}{{k}^{2}} + \frac{{\sigma}^{2}}{{n}{\mu}^{2}}\frac{1}{{k}^{2}}. \tag{17} \end{align*}
Comparing (17) to (14), we find two additional terms on the right-hand side of the inequality. Both terms involve the expected consensus error
This indeed turns out to be the case, as shown in [25], that \[\frac{1}{n}\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}\left[{\left\Vert{z}_{i}\left({k}\right) - {z}^{\ast}\right\Vert}^{2}\right]\,≤\,\frac{{\sigma}^{2}}{{n}{\mu}^{2}{k}}{\cal{O}}\left({1}\right).\]
In other words, we have the asymptotic network independence phenomenon: after a transient, DSGD performs comparably to a centralized SGD method with the same computational power (e.g., which can query the same number of gradients per step as that of the entire network).
Numerical illustration
We provide a numerical example to illustrate the asymptotic network independence property of DSGD. Consider the online Ridge regression problem
\[{z}^{\ast} = \arg\mathop{\min}\limits_{z\in{Bbb{R}}^{d}}\mathop{\sum}\limits_{i = 1}\limits^{n}{f_i}\left({z}\right)\left( = {\Bbb{E}}_{{u}_{i},{v}_{i}}\left[{\left({u}_{i}^{\top}{z} - {v}_{i}\right)}^{2} + {\rho}{\left\Vert{z}\right\Vert}^{2}\right]\right), \tag{18} \]
\[{z}^{\ast} = {\left(\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}_{u_i}\left[{u}_{i}{u}_{i}^{\top}\right] + {n}{\rho}{\bf{I}}\right)}^{-1}\mathop{\sum}\limits_{i = 1}\limits^{n}{\Bbb{E}}_{u_i}\left[{u}_{i}{u}_{i}^{\top}\right]{\tilde{z}}_{i}. \]
In the experiments, we consider two instances. In the first instance, we assume
The performance of SGD and DSGD is shown in Figure 5. We notice that in both instances the expected consensus error for DSGD converges to 0 faster than the expected optimization error, as predicted from our previous discussion. Regarding the expected optimization error, DSGD is slower than SGD in the first ∼800 (respectively,
The performance comparison between DSGD and SGD for online Ridge regression. For DSGD, the plots show the iterates generated by a randomly selected node
Conclusions
In this article, we provided a discussion of recent results that have overcome a barrier in distributed stochastic optimization methods for ML under certain scenarios. These results established an asymptotic network independence property, that is, asymptotically, the distributed algorithm achieves a convergence rate comparable to that of a centralized algorithm with the same computational power. We explained the property using examples of training ML models and provided a short mathematical analysis.
Along the line of achieving asymptotic network independence in distributed optimization, there are various future research directions, including considering nonconvex objective functions, reducing communication costs and transient time, and using exact gradient information. In this section, we briefly describe these directions.
First, the distributed training of deep neural networks, the state-of-the-art ML approach in many application areas, involves minimizing nonconvex objective functions, which are different from the main objectives considered in this article. This area is largely unexplored with a few recent works in [1], [12], [14] and [29].
In distributed algorithms, the costs associated with communication among the agents are often nonnegligible and may become the main burden for large networks. It is therefore important to explore communication-reduction techniques that do not sacrifice the asymptotic network independence property. Recent works [1], [9] touched on this point.
When considering asymptotic network independence for distributed optimization, an important factor is the transient time needed to reach the asymptotic convergence rate, as it may take a long time before the distributed implementation catches up with the corresponding centralized method. In fact, as we have shown in the “Setup” section, this transient time can be a function of the network topology and grows with the network size. Reducing the transient time is thus a key future objective.
Finally, although several recent works have established the asymptotic network independence property in distributed optimization, they are mainly constrained to using stochastic gradient information. If the exact gradient is available, can distributed methods compete with the centralized ones? As we know, centralized algorithms typically enjoy a faster convergence speed with exact gradients. For example, plain gradient descent achieves linear convergence for strongly convex and smooth objective functions. To the best of the authors’ knowledge, as of the writing of this article, with the exception of [11] and [29], the results on asymptotic network independence in this setting are currently lacking.
ACKNOWLEDGMENTS
We would like to thank Artin Spiridonoff from Boston University for his kind help in providing Figure 3. The research was partially supported by the NSF under grants ECCS 1933027, IIS 1914792, DMS 1664644, and CNS 1645681, the U.S. Office of Naval Research under grant N00014-19-1-2571, the National Institutes of Health under grant 1R01GM135930, and the Shenzhen Research Institute of Big Data Startup Fund JCYJ-SP2019090001.