Distributed Delayed Stochastic Optimization

Alekh Agarwal, John C. Duchi

Introduction

We focus on stochastic convex optimization problems of the form

Our model of delayed gradient information is particularly relevant in distributed optimization scenarios, where a master maintains the parameters xx while workers compute stochastic gradients of the objective (1). The architectural assumption of a master with several worker nodes is natural for distributed computation, and other researchers have considered models similar to those in this paper [NBB01, LSZ09]. By allowing delayed and asynchronous updates, we can avoid synchronization issues that commonly handicap distributed systems.

Certainly distributed optimization has been studied for several decades, tracing back at least to seminal work of Tsitsiklis and colleagues ([Tsi84, BT89]) on minimization of smooth functions where the parameter vector is distributed. More recent work has studied problems in which each processor or node ii in a network has a local function fif_{i}, and the goal is to minimize the sum f(x)=1ni=1nfi(x)f(x)=\frac{1}{n}\sum_{i=1}^{n}f_{i}(x) [NO09, RNV10, JRJ09, DAW10]. Most prior work assumes as a constraint that data lies on several different nodes throughout a network. However, as Dekel et al. [DGBSX10a] first noted, in distributed stochastic settings independent realizations of a stochastic gradient can be computed concurrently, and it is thus possible to obtain an aggregated gradient estimate with lower variance. Using modern stochastic optimization algorithms (e.g. [JNT08, Lan10]), Dekel et al. give a series of reductions to show that in an nn-node network it is possible to achieve a speedup of O(n)\mathcal{O}(n) over a single-processor so long as the objective ff is smooth.

Our work is closest to Nedić et al.’s asynchronous subgradient method [NBB01], which is an incremental gradient procedure in which gradient projection steps are taken using out-of-date gradients. See Figure 1 for an illustration. The asynchronous subgradient method performs non-smooth minimization and suffers an asymptotic penalty in convergence rate due to the delays: if the gradients are computed with a delay of τ\tau, then the convergence rate of the procedure is O(τ/T)\mathcal{O}(\sqrt{\tau/T}). The setting of distributed optimization provides an elegant illustration of the role played by the delay in convergence rates. As in Fig. 1, the delay τ\tau can essentially be of order nn in Nedić et al.’s setting, which gives a convergence rate of O(n/T)\mathcal{O}(\sqrt{n/T}). A simple centralized stochastic gradient algorithm attains a rate of O(1/T)\mathcal{O}(1/\sqrt{T}), which suggests something is amiss in the distributed algorithm. Langford et al. [LSZ09] rediscovered Nedić et al.’s results and attempted to remove the asymptotic penalty by considering smooth objective functions, though their approach has a technical error (see Appendix C), and even so they do not demonstrate any provable benefits of distributed computation. We analyze similar asynchronous algorithms, but we show that for smooth stochastic problems the delay is asymptotically negligible—the time τ\tau does not matter—and in fact, with parallelization, delayed updates can give provable performance benefits.

We build on results of Dekel et al. [DGBSX10a], who show that when the objective ff has Lipschitz-continuous gradients, then when nn processors compute stochastic gradients in parallel using a common parameter xx it is possible to achieve convergence rate O(1/Tn)\mathcal{O}(1/\sqrt{Tn}) so long as the processors are synchronized (under appropriate synchrony conditions, this holds nearly independently of network topology). A variant of their approach is asymptotically robust to asynchrony so long as most processors remain synchronized for most of the time [DGBSX10b]. We show results similar to their initial discovery, but we analyze the effects of asynchronous gradient updates where all the nodes in the network can suffer delays. Application of our main results to the distributed setting provides convergence rates in terms of the number of nodes nn in the network and the stochastic process governing the delays. Concretely, we show that under different assumptions on the network and delay process, we achieve convergence rates ranging from O(n3/T+1/Tn)\mathcal{O}(n^{3}/T+1/\sqrt{Tn}) to O(n/T+1/Tn)\mathcal{O}(n/T+1/\sqrt{Tn}), which is O(1/nT)\mathcal{O}(1/\sqrt{nT}) asymptotically in TT. For problems with large nn, we demonstrate faster rates ranging from O((n/T)2/3+1/Tn)\mathcal{O}((n/T)^{2/3}+1/\sqrt{Tn}) to O(1/T2/3+1/Tn)\mathcal{O}(1/T^{2/3}+1/\sqrt{Tn}). In either case, the time necessary to achieve ϵ\epsilon-optimal solution to the problem (1) is asymptotically O(1/nϵ2)\mathcal{O}(1/n\epsilon^{2}), a factor of nn—the size of the network—better than a centralized procedure in spite of delay.

The remainder of the paper is organized as follows. We begin by reviewing known algorithms for solving the stochastic optimization problem (1) and stating our main assumptions. Then in Section 3 we give abstract descriptions of our algorithms and state our main theoretical results, which we make concrete in Section 4 by formally placing the analysis in the setting of distributed stochastic optimization. We complement the theory in Section 5 with experiments on a real-world dataset, and proofs follow in the remaining sections.

For the reader’s convenience, we collect our (mostly standard) notation here. We denote general norms by \left\|\cdot\right\|, and the dual norm \left\|\cdot\right\|_{*} to the norm \left\|\cdot\right\| is defined as z:=supx:x1z,x\left\|z\right\|_{*}:=\sup_{x:\left\|x\right\|\leq 1}\left\langle z,x\right\rangle. The subdifferential set of a function ff is

We use the shorthand f(x):=supgf(x)g\left\|\partial f(x)\right\|_{*}:=\sup_{g\in\partial f(x)}\left\|g\right\|_{*}. A function ff is GG-Lipschitz with respect to the norm \left\|\cdot\right\| on X\mathcal{X} if for all x,yXx,y\in\mathcal{X}, f(x)f(y)Gxy|f(x)-f(y)|\leq G\left\|x-y\right\|. For convex ff, this is equivalent to f(x)G\left\|\partial f(x)\right\|_{*}\leq G for all xXx\in\mathcal{X} (e.g. [HUL96a]). A function ff is LL-smooth on X\mathcal{X} if f\nabla f is Lipschitz continuous with respect to the norm \left\|\cdot\right\|, defined as

For convex differentiable hh, the Bregman divergence [Bre67] between xx and yy is defined as

A convex function hh is cc-strongly convex with respect to a norm \left\|\cdot\right\| over X\mathcal{X} if

We use [n][n] to denote the set of integers {1,,n}\{1,\ldots,n\}.

Setup and Algorithms

In this section we set up and recall the delay-free algorithms underlying our approach. We then give the appropriate delayed versions of these algorithms, which we analyze in the sequel.

To build intuition for the algorithms we analyze, we first describe two closely related first-order algorithms: the dual averaging algorithm of Nesterov [Nes09] and the mirror descent algorithm of Nemirovski and Yudin [NY83], which is analyzed further by Beck and Teboulle [BT03]. We begin by collecting notation and giving useful definitions. Both algorithms are based on a proximal function ψ(x)\psi(x), where it is no loss of generality to assume that ψ(x)0\psi(x)\geq 0 for all xXx\in\mathcal{X}. We assume ψ\psi is 11-strongly convex (by scaling, this is no loss of generality). By definitions (2) and (3), the divergence DψD_{\psi} satisfies Dψ(x,y)12xy2D_{\psi}(x,y)\geq\frac{1}{2}\left\|x-y\right\|^{2}.

In the oracle model of stochastic optimization that we assume, at time tt both algorithms query an oracle at the point x(t)x(t), and the oracle then samples ξ(t)\xi(t) i.i.d. from the distribution PP and returns g(t)F(x(t);ξ(t))g(t)\in\partial F(x(t);\xi(t)). The dual averaging algorithm [Nes09] updates a dual vector z(t)z(t) and primal vector x(t)Xx(t)\in\mathcal{X} via

while mirror descent [NY83, BT03] performs the update

Both make a linear approximation to the function being minimized—a global approximation in the case of the dual averaging update (4) and a more local approximation for mirror descent (5)—while using the proximal function ψ\psi to regularize the points x(t)x(t).

We now state the two essentially standard assumptions [JNT08, Lan10, Xia10] we most often make about the stochastic optimization problem (1), after which we recall the convergence rates of the algorithms (4) and (5).

In particular, Assumption A implies that ff is GG-Lipschitz continuous with respect to the norm \left\|\cdot\right\| and that ff is convex. Our second assumption has been used to show rates of convergence based on the variance of a gradient estimator for stochastic optimization problems (e.g. [JNT08, Lan10]).

Several commonly used functions satisfy the above assumptions, for example:

The logistic loss: F(x;ξ)=log[1+exp(x,ξ)]F(x;\xi)=\log[1+\exp(\left\langle x,\xi\right\rangle)], the objective for logistic regression in statistics (e.g. [HTF01]). The objective FF satisfies Assumptions A and B so long as ξ\left\|\xi\right\| is bounded.

We also make a standard compactness assumption on the optimization set X\mathcal{X}.

For xargminxXf(x)x^{*}\in\mathop{\rm argmin}_{x\in\mathcal{X}}f(x) and xXx\in\mathcal{X}, the bounds ψ(x)R2/2\psi(x^{*})\leq R^{2}/2 and Dψ(x,x)R2D_{\psi}(x^{*},x)\leq R^{2} both hold.

Under Assumptions A or B in addition to Assumption C, the updates (4) and (5) have known convergence rates. Define the time averaged vector x^(T)\widehat{x}(T) as

Then under Assumption A, both algorithms satisfy

for the stepsize choice α(t)=R/(Gt)\alpha(t)=R/(G\sqrt{t}) (e.g. [Nes09, Xia10, NJLS09]). The result (7) is sharp to constant factors in general [NY83, ABRW10], but can be further improved under Assumption B. Building on work of Juditsky et al. [JNT08] and Lan [Lan10], Dekel et al. [DGBSX10a, Appendix A] show that under Assumptions B and C the stepsize choice α(t)1=L+η(t)\alpha(t)^{-1}=L+\eta(t), where η(t)\eta(t) is a damping factor set to η(t)=σRt\eta(t)=\sigma R\sqrt{t}, yields for either of the updates (4) or (5) the convergence rate

2 Delayed Optimization Algorithms

Recall that the problems we consider are stochastic optimization problems of the form (1). Under the assumptions above, we extend the mirror descent and dual averaging algorithms in the simplest way: we replace g(t)g(t) with g(tτ(t))g(t-\tau(t)). For dual averaging (c.f. the update (4)) this yields

while for mirror descent (c.f. the update (5)) we have

Convergence rates for delayed optimization of smooth functions

In this section, we state and discuss several results for asynchronous stochastic gradient methods. We give two sets of theorems. The first are for the asynchronous method when we make updates to the parameter vector xx using one stochastic subgradient, according to the update rules (9) or (10). The second method involves using several stochastic subgradients for every update, each with a potentially different delay, which gives sharper results that we present in Section 3.2.

Intuitively, the B\sqrt{B}-penalty due to delays for non-smooth optimization arises from the fact that subgradients can change drastically when measured at slightly different locations, so a small delay can introduce significant inaccuracy. To overcome the delay penalty, we now turn to the smoothness assumption B as well as the Lipschitz condition A (we assume both of these conditions along with Assumption C hold for all the theorems). In the smooth case, delays mean that stale gradients are only slightly perturbed, since our stochastic algorithms constrain the variability of the points x(t)x(t). As we show in the proofs of the remaining results, the error from delay essentially becomes a second order term: the penalty is asymptotically negligible. We study both update rules (9) and (10), and we set α(t)=1L+η(t)\alpha(t)=\frac{1}{L+\eta(t)}. Here η(t)\eta(t) will be chosen to both control the effects of delays and for errors from stochastic gradient information. We prove the following theorem in Sec. 6.1.

Let the sequence x(t)x(t) be defined by the update (9). Define the stepsize η(t)t+τ\eta(t)\propto\sqrt{t+\tau} or let η(t)η\eta(t)\equiv\eta for all tt. Then

The mirror descent update (10) exhibits similar convergence properties, and we prove the next theorem in Sec. 6.2.

Use the conditions of Theorem 1 but generate x(t)x(t) by the update (10). Then

In each of the above theorems, we can set η(t)=σt+τ/R\eta(t)=\sigma\sqrt{t+\tau}/R. As immediate corollaries, we recall the definition (6) of the averaged sequence of x(t)x(t) and use convexity to see that

for either update rule. In addition, we can allow the delay τ(t)\tau(t) to be random:

We provide the proof of the corollary in Sec. 6.3. The take-home message from the above corollaries, as well as Theorems 1 and 2, is that the penalty in convergence rate due to the delay τ(t)\tau(t) is asymptotically negligible. As we discuss in greater depth in the next section, this has favorable implications for robust distributed stochastic optimization algorithms.

2 Combinations of delays

In some scenarios—including distributed settings similar to those we discuss in the next section—the procedure has access not to only a single delayed gradient but to several with different delays. To abstract away the essential parts of this situation, we assume that the procedure receives nn gradients g1,,gng_{1},\ldots,g_{n}, where each has a potentially different delay τ(i)\tau(i). Now let λ=(λi)i=1n\lambda=(\lambda_{i})_{i=1}^{n} belong to the probability simplex, though we leave λ\lambda’s values unspecified for now. Then the procedure performs the following updates at time tt: for dual averaging,

The next two theorems build on the proofs of Theorems 1 and 2, combining several techniques. We provide the proof of Theorem 3 in Sec. 7, omitting the proof of Theorem 4 as it follows in a similar way from Theorem 2.

Let the sequence x(t)x(t) be defined by the update (12). Under assumptions A, B and C, let 1α(t)=L+η(t)\frac{1}{\alpha(t)}=L+\eta(t) and η(t)t+τ\eta(t)\propto\sqrt{t+\tau} or η(t)η\eta(t)\equiv\eta for all tt. Then

Use the same conditions as Theorem 3, but assume that x(t)x(t) is defined by the update (13) and Dψ(x,x)R2D_{\psi}(x^{*},x)\leq R^{2} for all xXx\in\mathcal{X}. Then

The consequences of Theorems 3 and 4 are powerful, as we illustrate in the next section.

Distributed Optimization

We divide the NN samples among nn workers so that each worker has an N/nN/n-sized subset of data. In streaming applications, the distribution PP is the unknown distribution generating the data, and each worker receives a stream of independent data points ξP\xi\sim P. Worker ii uses its subset of the data, or its stream, to compute gig_{i}, an estimate of the gradient f\nabla f of the global ff. We make the simplifying assumption that gig_{i} is an unbiased estimate of f(x)\nabla f(x), which is satisfied, for example, when each worker receives an independent stream of samples or computes the gradient gig_{i} based on samples picked at random without replacement from its subset of the data.

The architectural assumptions we make are natural and based off of master/worker topologies, but the convergence results in Section 3 allow us to give procedures robust to delay and asynchrony. We consider two protocols: in the first, workers compute and communicate asynchronously and independently with the master, and in the second, workers are at different distances from the master and communicate with time lags proportional to their distances. We show in the latter part of this section that the convergence rates of each protocol, when applied in an nn-node network, are O(1/nT)\mathcal{O}(1/\sqrt{nT}) for nn-node networks (though lower order terms are different for each).

Before describing our architectures, we note that perhaps the simplest master-worker scheme is to have each worker simultaneously compute a stochastic gradient and send it to the master, which takes a gradient step on the averaged gradient. While the nn gradients are computed in parallel, accumulating and averaging nn gradients at the master takes Ω(n)\Omega(n) time, offsetting the gains of parallelization. Thus we consider alternate architectures that are robust to delay.

This protocol is the delayed update algorithm mentioned in the introduction, and it parallelizes computation of (estimates of) the gradient f(x)\nabla f(x). Formally, worker ii has parameter x(t)x(t) and computes gi(t)=F(x(t);ξi(t))g_{i}(t)=F(x(t);\xi_{i}(t)), where ξi(t)\xi_{i}(t) is a random variable sampled at worker ii from the distribution PP. The master maintains a parameter vector xXx\in\mathcal{X}. The algorithm proceeds in rounds, cyclically pipelining updates. The algorithm begins by initiating gradient computations at different workers at slightly offset times. At time tt, the master receives gradient information at a τ\tau-step delay from some worker, performs a parameter update, and passes the updated central parameter x(t+1)x(t+1) back to the worker. Other workers do not see this update and continue their gradient computations on stale parameter vectors. In the simplest case, each node suffers a delay of τ=n\tau=n, though our earlier analysis applies to random delays throughout the network as well. Recall Fig. 1 for a graphic description of the process.

Locally Averaged Delayed Architecture

At a high level, the protocol we now describe combines the delayed updates of the cyclic delayed architecture with averaging techniques of previous work [NO09, DAW10]. We assume a network G=(V,E)\mathcal{G}=(\mathcal{V},\mathcal{E}), where V\mathcal{V} is a set of nn nodes (workers) and E\mathcal{E} are the edges between the nodes. We select one of the nodes as the master, which maintains the parameter vector x(t)Xx(t)\in\mathcal{X} over time.

The algorithm works via a series of multicasting and aggregation steps on a spanning tree rooted at the master node. In the first phase, the algorithm broadcasts from the root towards the leaves. At step tt the master sends its current parameter vector x(t)x(t) to its immediate neighbors. Simultaneously, every other node broadcasts its current parameter vector (which, for a depth dd node, is x(td)x(t-d)) to its children in the spanning tree. See Fig. 2(a). Every worker receives its new parameter and computes its local gradient at this parameter. The second part of the communication in a given iteration proceeds from leaves toward the root. The leaf nodes communicate their gradients to their parents. The parent takes the gradients of the leaf nodes from the previous round (received at iteration t1t-1) and averages them with its own gradient, passing this averaged gradient back up the tree. Again simultaneously, each node takes the averaged gradient vectors of its children from the previous rounds, averages them with its current gradient vector, and passes the result up the spanning tree. See Fig. 2(b) and Fig. 3 for a visual description.

Slightly more formally, associated with each node iVi\in\mathcal{V} is a delay τ(i)\tau(i), which is (generally) twice its distance from the master. Fix an iteration tt. Each node iVi\in\mathcal{V} has an out of date parameter vector x(tτ(i)/2)x(t-\tau(i)/2), which it sends further down the tree to its children. So, for example, the master node sends the vector x(t)x(t) to its children, which send the parameter vector x(t1)x(t-1) to their children, which in turn send x(t2)x(t-2) to their children, and so on. Each node computes

where ξi(t)\xi_{i}(t) is a random variable sampled at node ii from the distribution PP. The communication back up the hierarchy proceeds as follows: the leaf nodes in the tree (say at depth dd) send the gradient vectors gi(td)g_{i}(t-d) to their immediate parents in the tree. At the previous iteration t1t-1, the parent nodes received gi(td1)g_{i}(t-d-1) from their children, which they average with their own gradients gi(td+1)g_{i}(t-d+1) and pass to their parents, and so on. The master node at the root of the tree receives an average of delayed gradients from the entire tree, with each gradient having a potentially different delay, giving rise to updates of the form (12) or (13).

1 Convergence rates for delayed distributed minimization

Having described our architectures, we can now give corollaries to the theoretical results from the previous sections that show it is possible to achieve asymptotically faster rates (over centralized procedures) using distributed algorithms even without imposing synchronization requirements. We allow workers to pipeline updates by computing asynchronously and in parallel, so each worker can compute low variance estimate of the gradient f(x)\nabla f(x).

We begin with a simple corollary to the results in Sec. 3.1. We ignore the constants LL, GG, RR, and σ\sigma, which are not dependent on the characteristics of the network. We also assume that each worker uses mm independent samples of ξP\xi\sim P to compute the stochastic gradient as

Using the cyclic protocol as in Fig. 1, Theorems 1 and 2 give the following result.

Let ψ(x)=12x22\psi(x)=\frac{1}{2}\left\|{x}\right\|_{2}^{2}, assume the conditions in Corollary 1, and assume that each worker uses mm samples ξP\xi\sim P to compute the gradient it communicates to the master. Then with the choice η(t)=T/m\eta(t)=\sqrt{T}/\sqrt{m} either of the updates (9) or (10) satisfy

In the above corollary, so long as the bound on the delay BB satisfies, say, B=o(T1/4)B=o(T^{1/4}), then the last term in the bound is asymptotically negligible, and we achieve a convergence rate of O(1/Tm)\mathcal{O}(1/\sqrt{Tm}).

The cyclic delayed architecture has the drawback that information from a worker can take O(n)\mathcal{O}(n) time to reach the master. While the algorithm is robust to delay and does not need lock-step coordination of workers, the downside of the architecture is that the essentially n2m/Tn^{2}m/T term in the bounds above can be quite large. Indeed, if each worker computes its gradient over mm samples with mnm\approx n—say to avoid idling of workers—then the cyclic architecture has convergence rate O(n3/T+1/nT)\mathcal{O}(n^{3}/T+1/\sqrt{nT}). For moderate TT or large nn, the delay penalty n3/Tn^{3}/T may dominate 1/nT1/\sqrt{nT}, offsetting the gains of parallelization.

To address the large nn drawback, we turn our attention to the locally averaged architecture described by Figs. 2 and 3, where delays can be smaller since they depend only on the height of a spanning tree in the network. The algorithm requires more synchronization than the cyclic architecture but still performs limited local communication. Each worker computes gi(tτ(i))=F(x(tτ(i));ξi(t))g_{i}(t-\tau(i))=\nabla F(x(t-\tau(i));\xi_{i}(t)) where τ(i)\tau(i) is the delay of worker ii from the master and ξiP\xi_{i}\sim P. As a result of the communication procedure, the master receives a convex combination of the stochastic gradients evaluated at each worker ii, for which we gave results in Section 3.2.

In this architecture, the master receives gradients of the form gλ(t)=i=1nλigi(tτ(i))g_{\lambda}(t)=\sum_{i=1}^{n}\lambda_{i}g_{i}(t-\tau(i)) for some λ\lambda in the simplex, which puts us in the setting of Theorems 3 and 4. We now make the reasonable assumption that the gradient errors f(x(t))gi(t)\nabla f(x(t))-g_{i}(t) are uncorrelated across the nodes in the network.Similar results continue to hold under weak correlation. In statistical applications, for example, each worker may own independent data or receive streaming data from independent sources; more generally, each worker can simply receive independent samples ξiP\xi_{i}\sim P. We also set ψ(x)=12x22\psi(x)=\frac{1}{2}\left\|{x}\right\|_{2}^{2}, and observe

This gives the following corollary to Theorems 3 and 4.

Set λi=1n\lambda_{i}=\frac{1}{n} for all ii, ψ(x)=12x22\psi(x)=\frac{1}{2}\left\|{x}\right\|_{2}^{2}, and η(t)=σt+τ/Rn\eta(t)=\sigma\sqrt{t+\tau}/R\sqrt{n}. Let τˉ\bar{\tau} and τ2\overline{\tau^{2}} denote the average of the delays τ(i)\tau(i) and τ(i)2\tau(i)^{2}, respectively. Under the conditions of Theorem 3 or 4,

The above corollaries are general and hold irrespective of the relative costs of communication and computation. However, with knowledge of the costs, we can adapt the stepsizes slightly to give better rates of convergence when nn is large or communication to the master node is expensive. For now, we focus on the cyclic architecture (the setting of Corollary 2), though the same principles apply to the local averaging scheme. Let CC denote the cost of communicating between the master and workers in terms of the time to compute a single gradient sample, and assume that we set m=Cnm=Cn, so that no worker node has idle time. For simplicity, we let the delay be non-random, so B=τ=nB=\tau=n. Consider the choice η(t)=ηT/(Cn)\eta(t)=\eta\sqrt{T/(Cn)} for the damping stepsizes, where η1\eta\geq 1. This setting in Theorem 1 gives

where the last equality follows since η1\eta\geq 1. Optimizing for η\eta on the right yields

The convergence rates thus follow two regimes. When Tn7/C3T\leq n^{7}/C^{3}, we have convergence rate O(n2/3/T2/3)\mathcal{O}(n^{2/3}/T^{2/3}), while once T>n7/C3T>n^{7}/C^{3}, we attain O(1/TCn)\mathcal{O}(1/\sqrt{TCn}) convergence. Roughly, in time proportional to TCTC, we achieve optimization error 1/TCn1/\sqrt{TCn}, which is order-optimal given that we can compute a total of TCnTCn stochastic gradients [ABRW10]. The scaling of this bound is nicer than that previously: the dependence on network size is at worst n2/3n^{2/3}, which we obtain by increasing the damping factor η(t)\eta(t)—and hence decreasing the stepsize α(t)=1/(L+η(t))\alpha(t)=1/(L+\eta(t))—relative to the setting of Corollary 2. We remark that applying the same technique to Corollary 3 gives convergence rate scaling as the smaller of O((D/T)2/3+1/TCn)\mathcal{O}((D/T)^{2/3}+1/\sqrt{TCn}) and O((nCD/T+1/TCn)\mathcal{O}((nCD/T+1/\sqrt{TCn}). Since the diameter DnD\leq n, this is faster than the cyclic architecture’s bound (15).

2 Running-time comparisons

Now we state our assumptions on the relative times used by each algorithm. Let TT be the number of units of time allocated to each algorithm, and let the centralized, cyclic delayed and locally averaged delayed algorithms complete TcentT_{\rm cent}, TcycleT_{\rm cycle} and TdistT_{\rm dist} iterations, respectively, in time TT. It is clear that Tcent=TT_{\rm cent}=T. We assume that the distributed methods use mcyclem_{\rm cycle} and mdistm_{\rm dist} samples of ξP\xi\sim P to compute stochastic gradients and that the delay τ\tau of the cyclic algorithm is nn. For concreteness, we assume that communication is of the same order as computing the gradient of one sample F(x;ξ)\nabla F(x;\xi) so that C=1C=1. In the cyclic setup of Sec. 3.1, it is reasonable to assume that mcycle=Ω(n)m_{\rm cycle}=\Omega(n) to avoid idling of workers (Theorems 1 and 2, as well as the bound (15), show it is asymptotically beneficial to have mcyclem_{\rm cycle} larger, since σcycle2=1/mcycle\sigma_{\rm cycle}^{2}=1/m_{\rm cycle}). For mcycle=Ω(n)m_{\rm cycle}=\Omega(n), the master requires mcyclen\frac{m_{\rm cycle}}{n} units of time to receive one gradient update, so mcyclenTcycle=T\frac{m_{\rm cycle}}{n}T_{\rm cycle}=T. In the locally delayed framework, if each node uses mdistm_{\rm dist} samples to compute a gradient, the master receives a gradient every mdistm_{\rm dist} units of time, and hence mdistTdist=Tm_{\rm dist}T_{\rm dist}=T. Further, σdist2=1/mdist\sigma_{\rm dist}^{2}=1/m_{\rm dist}. We summarize our assumptions by saying that in TT units of time, each algorithm performs the following number of iterations:

Plugging the above iteration counts into the earlier bound (8) and Corollaries 2 and 3 via the sharper result (15), we can provide upper bounds (to constant factors) on the expected optimization accuracy after TT units of time for each of the distributed architectures as in Table 1. Asymptotically in the number of units of time TT, both the cyclic and locally communicating stochastic optimization schemes have the same convergence rate. However, topological considerations show that the locally communicating method (Figs. 2 and 3) has better performance than the cyclic architecture, though it requires more worker coordination. Since the lower order terms matter only for large nn or small TT, we compare the terms n2/3/T2/3n^{2/3}/T^{2/3} and D2/3/T2/3D^{2/3}/T^{2/3} for the cyclic and locally averaged algorithms, respectively. Since DnD\leq n for any network, the locally averaged algorithm always guarantees better performance than the cyclic algorithm. For specific graph topologies, however, we can quantify the time improvements:

nn-node cycle or path: D=nD=n so that both methods have the same convergence rate.

n\sqrt{n}-by-n\sqrt{n} grid: D=nD=\sqrt{n}, so the distributed method has a factor of n2/3/n1/3=n1/3n^{2/3}/n^{1/3}=n^{1/3} improvement over the cyclic architecture.

Balanced trees and expander graphs: D=O(logn)D=\mathcal{O}(\log n), so the distributed method has a factor—ignoring logarithmic terms—of n2/3n^{2/3} improvement over cyclic.

Naturally, it is possible to modify our assumptions. In a network in which communication is cheap, or conversely, in a problem for which the computation of F(x;ξ)\nabla F(x;\xi) is more expensive than communication, then the number of samples ξP\xi\sim P for which which each worker computes gradients is small. Such problems are frequent in statistical machine learning, such as when learning conditional random field models, which are useful in natural language processing, computational biology, and other application areas [LMP01]. In this case, it is reasonable to have mcycle=O(1)m_{\rm cycle}=\mathcal{O}(1), in which case Tcycle=TnT_{\rm cycle}=Tn and the cyclic delayed architecture has stronger convergence guarantees of O(min{n2/T,1/T2/3}+1/Tn)\mathcal{O}(\min\{n^{2}/T,1/T^{2/3}\}+1/\sqrt{Tn}). In any case, both non-centralized protocols enjoy significant asymptotically faster convergence rates for stochastic optimization problems in spite of asynchronous delays.

Numerical Results

Though this paper focuses mostly on the theoretical analysis of the methods we have presented, it is important to understand the practical aspects of the above methods in solving real-world tasks and problems with real data. To that end, we use the cyclic delayed method (12) to solve a common statistical machine learning problem. Specifically, we focus on solving the logistic regression problem

We use the Reuters RCV1 dataset [LYRL04], which consists of N800000N\approx 800000 news articles, each labeled with some combination of the four labels economics, government, commerce, and medicine. In the above example, the vectors ai{0,1}da_{i}\in\{0,1\}^{d}, d105d\approx 10^{5}, are feature vectors representing the words in each article, and the labels bib_{i} are 11 if the article is about government, 1-1 otherwise.

We simulate the cyclic delayed optimization algorithm (9) for the problem (17) for several choices of the number of workers nn and the number of samples mm computed at each worker. We summarize the results of our experiments in Figure 4. To generate the figure, we fix an ϵ\epsilon (in this case, ϵ=.05\epsilon=.05), then measure the time it takes the stochastic algorithm (9) to output an x^\widehat{x} such that f(x^)infxXf(x)+ϵf(\widehat{x})\leq\inf_{x\in\mathcal{X}}f(x)+\epsilon. We perform each experiment ten times.

After computing the number of iterations required to achieve ϵ\epsilon-accuracy, we convert the results to running time by assuming it takes one unit of time to compute the gradient of one term in the sum defining the objective (17). We also assume that it takes 11 unit of time, i.e. C=1C=1, to communicate from one of the workers to the master, for the master to perform an update, and communicate back to one of the workers. In an nn node system where each worker computes mm samples of the gradient, the master receives an update every max{mn,1}\max\{\frac{m}{n},1\} time units. A centralized algorithm computing mm samples of its gradient performs an update every mm time units. By multiplying the number of iterations to ϵ\epsilon-optimality by max{mn,1}\max\{\frac{m}{n},1\} for the distributed method and by mm for the centralized, we can estimate the amount of time it takes each algorithm to achieve an ϵ\epsilon-accurate solution.

We now turn to discussing Figure 4. The delayed update (9) enjoys speedup (the ratio of time to ϵ\epsilon-accuracy for an nn-node system versus the centralized procedure) nearly linear in the number nn of worker machines until n15n\geq 15 or so. Since we use the stepsize choice η(t)t/n\eta(t)\propto\sqrt{t/n}, which yields the predicted convergence rate given by Corollary 2, the n2m/Tn3/Tn^{2}m/T\approx n^{3}/T term in the convergence rate presumably becomes non-negligible for larger nn. This expands on earlier experimental work with a similar method [LSZ09], which experimentally demonstrated linear speedup for small values of nn, but did not investigate larger network sizes. Roughly, as predicted by our theory, for non-asymptotic regimes the cost of communication and delays due to using nn nodes mitigate some of the benefits of parallelization. Nevertheless, as our analysis shows, allowing delayed and asynchronous updates still gives significant performance improvements.

Delayed Updates for Smooth Optimization

Let assumptions A and B on the function ff and the compactness assumption C hold. Then for any sequence x(t)x(t)

Proof The proof follows by using a few Bregman divergence identities to rewrite the left hand side of the above equations, then recognizing that the result is close to a telescoping sum. Recalling the definition of a Bregman divergence (2), we note the following well-known four term equality, a consequence of straightforward algebra: for any a,b,c,da,b,c,d,

To make (19) useful, we note that the Lipschitz continuity of f\nabla f implies

so that recalling the definition of DfD_{f} (2) we have

In particular, using the non-negativity of Df(x,y)D_{f}(x,y), we can replace (19) with the bound

To bound the first Bregman divergence term, we recall that by Assumption C and the strong convexity of ψ\psi, xx(t)22Dψ(x,x(t))2R2\left\|x^{*}-x(t)\right\|^{2}\leq 2D_{\psi}(x^{*},x(t))\leq 2R^{2}, and hence the optimality of xx^{*} implies

This gives the first bound of the lemma. For the second bound, using convexity, we see that

The essential idea in this proof is to use convexity and smoothness to bound f(x(t))f(x)f(x(t))-f(x^{*}), then use the sequence {η(t)}\{\eta(t)\}, which decreases the stepsize α(t)\alpha(t), to cancel variance terms. To begin, we define the error e(t)e(t)

where g(tτ)=F(x(tτ);ξ(t)g(t-\tau)=\nabla F(x(t-\tau);\xi(t) for some ξ(t)P\xi(t)\sim P. Note that e(t)e(t) does not have zero expectation, as there is a time delay.

By using the convexity of ff and then the LL-Lipschitz continuity of f\nabla f, for any xXx^{*}\in\mathcal{X}, we have

Now, by applying Lemma 5 in Appendix A and the definition of the update (9), we see that

To get the bound (21), we substituted α(t)1=L+η(t)\alpha(t)^{-1}=L+\eta(t) and then used the fact that ψ\psi is strongly convex, so Dψ(x(t+1),x(t))12x(t)x(t+1)2D_{\psi}(x(t+1),x(t))\geq\frac{1}{2}\left\|x(t)-x(t+1)\right\|^{2}. By summing the bound (21), we have the following non-probabilistic inequality:

since ψ(x)0\psi(x)\geq 0 and x(T+1)x(T+1) minimizes z(T+1),x+1α(T+1)ψ(x)\left\langle z(T+1),x\right\rangle+\frac{1}{\alpha(T+1)}\psi(x). What remains is to control the summed e(t)e(t) terms in the bound (22). We can do this simply using the second part of Lemma 4. Indeed, we have

What remains, then, is to bound the stochastic (second) term in (23). This is straightforward, though:

Since Dψ(x(t+1),x(t))12x(t)x(t+1)2D_{\psi}(x(t+1),x(t))\geq\frac{1}{2}\left\|x(t)-x(t+1)\right\|^{2}, combining (24) with (22) and noting that 1α(t1)1α(t)0\frac{1}{\alpha(t-1)}-\frac{1}{\alpha(t)}\leq 0 gives

2 Proof of Theorem 2

The proof of Theorem 2 is similar to that of Theorem 1, so we will be somewhat terse. We define the error e(t)=f(x(t))g(tτ)e(t)=\nabla f(x(t))-g(t-\tau), identically as in the earlier proof, and begin as we did in the proof of Theorem 1. Recall that

Applying the first-order optimality condition to the definition of x(t+1)x(t+1) (5), we get

for all xXx\in\mathcal{X}. In particular, we have

Applying the above to the inequality (25), we see that

where for the last inequality, we use the fact that Dψ(x(t+1),x(t))12x(t)x(t+1)2D_{\psi}(x(t+1),x(t))\geq\frac{1}{2}\left\|x(t)-x(t+1)\right\|^{2}, by the strong convexity of ψ\psi, and that α(t)1=L+η(t)\alpha(t)^{-1}=L+\eta(t). By summing the inequality (26), we have

Comparing the bound (27) with the earlier bound for the dual averaging algorithms (22), we see that the only essential difference is the α(t)1α(t1)1\alpha(t)^{-1}-\alpha(t-1)^{-1} terms. The compactness assumption guarantees that Dψ(x,x(t))R2D_{\psi}(x^{*},x(t))\leq R^{2}, however, so

The remainder of the proof uses Lemmas 7 and 4 completely identically to the proof of Theorem 1.

3 Proof of Corollary 1

We prove this result only for the mirror descent algorithm (10), as the proof for the dual-averaging-based algorithm (9) is similar. We define the error at time tt to be e(t)=f(x(t))g(tτ(t))e(t)=\nabla f(x(t))-g(t-\tau(t)), and observe that we only need to control the second term involving e(t)e(t) in the bound (26) differently. Expanding the error terms above and using Fenchel’s inequality as in the proofs of Theorems 1 and 2, we have

Now we note that conditioned on the delay τ(t)\tau(t), we have

Consequently we apply Lemma 4 (specifically, following the bounds (19) and (20)) and find

The sum of DfD_{f} terms telescopes, leaving only terms not received by the gradient procedure within TT iterations, and we can use α(t)1ηT\alpha(t)\leq\frac{1}{\eta\sqrt{T}} for all tt to derive the further bound

To control the quantity (28), all we need is to bound the expected cardinality of the set {t[T]:t+τ(t)>T}\{t\in[T]:t+\tau(t)>T\}. Using Chebyshev’s inequality and standard expectation bounds, we have

We can control the remaining terms as in the proofs of Theorems 1 and 2.

Proof of Theorem 3

The proof of Theorem 3 is not too difficult given our previous work—all we need to do is redefine the error e(t)e(t) and use η(t)\eta(t) to control the variance terms that arise. To that end, we define the gradient error terms that we must control. In this proof, we set

where gi(t)=f(x(t);ξi(t))g_{i}(t)=\nabla f(x(t);\xi_{i}(t)) is the gradient of node ii computed at the parameter x(t)x(t) and τ(i)\tau(i) is the delay associated with node ii.

Using Assumption B as in the proofs of previous theorems, then applying Lemma 5, we have

We telescope as in the proofs of Theorems 1 and 2, canceling L2x(t)x(t+1)2\frac{L}{2}\left\|x(t)-x(t+1)\right\|^{2} with the LDψLD_{\psi} divergence terms to see that

This is exactly as in the non-probabilistic bound (22) from the proof of Theorem 1, but the definition (29) of the error e(t)e(t) here is different.

What remains is to control the error term in (30). Writing the terms out, we have

Bounding the first term above is simple via Lemma 4: as in the proof of Theorem 1 earlier, we have

We use the same technique as the proof of Theorem 1 to bound the second term from (31). Indeed, the Fenchel-Young inequality gives

By assumption, given the information at worker ii at time tτ(i)t-\tau(i), gi(tτ(i)))g_{i}(t-\tau(i))) is independent of x(t)x(t), so the first term has zero expectation. More formally, this happens because x(t)x(t) is a function of gradients gi(1),,gi(tτ(i)1)g_{i}(1),\ldots,g_{i}(t-\tau(i)-1) from each of the nodes ii and hence the expectation of the first term conditioned on {gi(1),,gi(tτ(i)1)}i=1n\{g_{i}(1),\ldots,g_{i}(t-\tau(i)-1)\}_{i=1}^{n} is 0. The last term is canceled by the Bregman divergence terms in (30), so combining the bound (31) with the above two paragraphs yields

Conclusion and Discussion

In this paper, we have studied dual averaging and mirror descent algorithms for smooth and non-smooth stochastic optimization in delayed settings, showing applications of our results to distributed optimization. We showed that for smooth problems, we can preserve the performance benefits of parallelization over centralized stochastic optimization even when we relax synchronization requirements. Specifically, we presented methods that take advantage of distributed computational resources and are robust to node failures, communication latency, and node slowdowns. In addition, by distributing computation for stochastic optimization problems, we were able to exploit asynchronous processing without incurring any asymptotic penalty due to the delays incurred. In addition, though we omit these results for brevity, it is possible to extend all of our expected convergence results to guarantees with high-probability.

Acknowledgments

In performing this research, AA was supported by a Microsoft Research Fellowship, and JCD was supported by the National Defense Science and Engineering Graduate Fellowship (NDSEG) Program. We are very grateful to Ofer Dekel, Ran Gilad-Bachrach, Ohad Shamir, and Lin Xiao for illuminating conversations on distributed stochastic optimization and communication of their proof of the bound (8). We would also like to thank Yoram Singer for reading a draft of this manuscript and giving useful feedback.

Appendix A Technical Results about Proximal Functions

In this section, we collect several useful results about proximal functions and continuity properties of the solutions of proximal operators. We give proofs of all uncited results in Appendix B. We begin with results useful for the dual-averaging updates (4) and (9).

Since ψα(z)=argmaxxX{z,xα1ψ(x)}\nabla\psi^{*}_{\alpha}(z)=\mathop{\rm argmax}_{x\in\mathcal{X}}\{\left\langle-z,x\right\rangle-\alpha^{-1}\psi(x)\}, it is clear that x(t)=ψα(t)(z(t))x(t)=\nabla\psi^{*}_{\alpha(t)}(z(t)). Further by strong convexity of ψ\psi, we have that ψα(z)\nabla\psi^{*}_{\alpha}(z) is α\alpha-Lipschitz continuous [Nes09, HUL96b, Chapter X], that is, for the norm \left\|\cdot\right\| with respect to which ψ\psi is strongly convex and its associated dual norm \left\|\cdot\right\|_{*},

We will find one more result about solutions to the dual averaging update useful. This result has essentially been proven in many contexts [Nes09, Tse08, DGBSX10a].

Let x+x^{+} minimize z,x+Aψ(x)\left\langle z,x\right\rangle+A\psi(x) for all xXx\in\mathcal{X}. Then for any xXx\in\mathcal{X},

Now we turn to describing properties of the mirror-descent step (5), which we will also use frequently. The lemma allows us to bound differences between x(t)x(t) and x(t+1)x(t+1) for the mirror-descent family of algorithms.

Let x+x^{+} minimize g,x+1αDψ(x,y)\left\langle g,x\right\rangle+\frac{1}{\alpha}D_{\psi}(x,y) over xXx\in\mathcal{X}. Then x+yαg\left\|x^{+}-y\right\|\leq\alpha\left\|g\right\|_{*}.

The last technical lemma we give explicitly bounds the differences between x(t)x(t) and x(t+τ)x(t+\tau), for some τ1\tau\geq 1, by using the above continuity lemmas.

Let Assumption A hold. Define x(t)x(t) via the dual-averaging updates (4), (9), or (12) or the mirror-descent updates (5), (10), or (13). Let α(t)1=L+η(t+t0)c\alpha(t)^{-1}=L+\eta(t+t_{0})^{c} for some cc\in, η>0\eta>0, t00t_{0}\geq 0, and L0L\geq 0. Then for any fixed τ\tau,

Appendix B Proofs of Proximal Operator Properties

Proof of Lemma 6 The inequality is clear when x+=yx^{+}=y, so assume that x+yx^{+}\neq y. Since x+x^{+} minimizes g,x+1αDψ(x,y)\left\langle g,x\right\rangle+\frac{1}{\alpha}D_{\psi}(x,y), the first order conditions for optimality imply

for any xXx\in\mathcal{X}. Thus we can choose y=xy=x and see that

where the last inequality follows from the strong convexity of ψ\psi. Using Hölder’s inequality gives that αgyxx+y2\alpha\left\|g\right\|_{*}\left\|y-x\right\|\geq\left\|x^{+}-y\right\|^{2}, and dividing by yx\left\|y-x\right\| completes the proof. ∎

Proof of Lemma 7 We first show the lemma for the dual-averaging updates. Recall that x(t)=ψα(t)(z(t))x(t)=\nabla\psi^{*}_{\alpha(t)}(z(t)) and ψα\nabla\psi^{*}_{\alpha} is α\alpha-Lipschitz continuous. Using the triangle inequality,

where we use Cauchy-Schwarz inequality in the first step. Since c1c\leq 1, the last term is clearly bounded by 4G2τ2/η2t2c4G^{2}\tau^{2}/\eta^{2}t^{2c}.

The proof for the mirror-descent family of updates is similar. We focus on non-delayed update (5), as the other updates simply modify the indexing of g(t+s)g(t+s) below. We know from Lemma 6 and the triangle inequality that

Squaring the above bound, taking expectations, and recalling that α(t)\alpha(t) is non-increasing, we see

by Hölder’s inequality. Substituting the appropriate value for α(t)\alpha(t) completes the proof. ∎

Appendix C Error in [LSZ09]

References