asynchronous accelerated stochastic gradient …asynchronous accelerated stochastic gradient descent...

7
Asynchronous Accelerated Stochastic Gradient Descent Qi Meng, 1Wei Chen, 2 Jingcheng Yu, 3Taifeng Wang, 2 Zhi-Ming Ma, 4 Tie-Yan Liu 2 1 School of Mathematical Sciences, Peking University, [email protected] 2 Microsoft Research, {wche, taifengw, tie-yan.liu}@microsoft.com 3 Fudan University, [email protected] 4 Academy of Mathematics and Systems Science, Chinese Academy of Sciences, [email protected] Abstract Stochastic gradient descent (SGD) is a widely used optimization algorithm in machine learning. In or- der to accelerate the convergence of SGD, a few advanced techniques have been developed in re- cent years, including variance reduction, stochas- tic coordinate sampling, and Nesterov’s accelera- tion method. Furthermore, in order to improve the training speed and/or leverage larger-scale train- ing data, asynchronous parallelization of SGD has also been studied. Then, a natural question is whether these techniques can be seamlessly inte- grated with each other, and whether the integration has desirable theoretical guarantee on its conver- gence. In this paper, we provide our formal an- swer to this question. In particular, we consider the asynchronous parallelization of SGD, accelerated by leveraging variance reduction, coordinate sam- pling, and Nesterov’s method. We call the new al- gorithm asynchronous accelerated SGD (AASGD). Theoretically, we proved a convergence rate of AASGD, which indicates that (i) the three accel- eration methods are complementary to each other and can make their own contributions to the im- provement of convergence rate; (ii) asynchronous parallelization does not hurt the convergence rate, and can achieve considerable speedup under ap- propriate parameter setting. Empirically, we tested AASGD on a few benchmark datasets. The exper- imental results verified our theoretical findings and indicated that AASGD could be a highly effective and efficient algorithm for practical use. 1 Introduction Stochastic gradient descent (SGD) is a widely used optimiza- tion technology in many applications, due to its simplicity and good empirical performances [Bousquet and Bottou, 2008; Rakhlin et al., 2012; Nemirovski et al., 2009]. In this paper, we focus on the adoption of SGD to solve the following empirical risk minimization problem, whose objective is the This work was done when the author was visiting Microsoft Research Asia. sum of smooth and convex loss functions, i.e. min x2R d F (x)= 1 n n X i=1 fi (x). (1) Please note that the loss function f i (x) may take differ- ent forms in different applications. For example, suppose we have a set of training data (a 1 ,b 1 ), ··· , (a n ,b n ), where a i 2 R d is an input feature vector and b i 2 R is its out- put. Then loss function f i is usually defined as a least square function f i (x)= 1 2 (a T i x - b i ) 2 for regression, and a logistic function f i (x) = log(1 + exp(-b i a T i x)) for classification. SGD exploits the additive nature of the empirical risk func- tion F (x), and randomly samples an instance at each iteration to calculate the gradient and updates the model towards the direction of negative gradient. Theoretical study on SGD has revealed that it has a sublinear convergence rate, meaning that the total number of component gradient evaluations required by SGD method to find an -accurate solution is O(1/). In recent years, people have been working on accelerating the convergence of SGD, by proposing new methods or leverag- ing existing methods in the literature of optimization. Repre- sentative acceleration methods include: (1) Variance Reduction (VR) [Johnson and Zhang, 2013; Defazio et al., 2014]: Besides computing the gradient of one randomly sampled instance in each iteration, the VR tech- nique computes the full gradient in a periodical manner and uses this full gradient for multiple iterations in order to reduce the sampling variance. It can be proven that the convergence rate of SGD can become linear by using the VR technique, under the condition of strong convexity. (2) Stochastic Coordinate Sampling (SC) [Nesterov, 2012; Richt´ arik and Tak´ c, 2014]: In addition to randomly sample training instances, the SC technique also performs random sampling over the feature dimensions. In particular, it ran- domly samples a block of coordinates, computes the partial gradients with respect to the features in the sampled block, and updates the solution only over this block. It clear that, since the computation of partial gradients are much faster, by using SC, SGD can become more efficient, especially when the number of coordinate blocks is relatively large. (3) Nesterov’s Acceleration (NA) [Nesterov, 2004]: The NA technique introduces one or multiple auxiliary variables, and updates the parameter according to the gradient at the Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16) 1853

Upload: others

Post on 12-Feb-2020

31 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

Asynchronous Accelerated Stochastic Gradient Descent

Qi Meng,

1⇤Wei Chen,

2

Jingcheng Yu,

3⇤Taifeng Wang,

2

Zhi-Ming Ma,

4

Tie-Yan Liu

2

1 School of Mathematical Sciences, Peking University, [email protected] Research, {wche, taifengw, tie-yan.liu}@microsoft.com

3Fudan University, [email protected] of Mathematics and Systems Science, Chinese Academy of Sciences, [email protected]

Abstract

Stochastic gradient descent (SGD) is a widely usedoptimization algorithm in machine learning. In or-der to accelerate the convergence of SGD, a fewadvanced techniques have been developed in re-cent years, including variance reduction, stochas-tic coordinate sampling, and Nesterov’s accelera-tion method. Furthermore, in order to improve thetraining speed and/or leverage larger-scale train-ing data, asynchronous parallelization of SGD hasalso been studied. Then, a natural question iswhether these techniques can be seamlessly inte-grated with each other, and whether the integrationhas desirable theoretical guarantee on its conver-gence. In this paper, we provide our formal an-swer to this question. In particular, we consider theasynchronous parallelization of SGD, acceleratedby leveraging variance reduction, coordinate sam-pling, and Nesterov’s method. We call the new al-gorithm asynchronous accelerated SGD (AASGD).Theoretically, we proved a convergence rate ofAASGD, which indicates that (i) the three accel-eration methods are complementary to each otherand can make their own contributions to the im-provement of convergence rate; (ii) asynchronousparallelization does not hurt the convergence rate,and can achieve considerable speedup under ap-propriate parameter setting. Empirically, we testedAASGD on a few benchmark datasets. The exper-imental results verified our theoretical findings andindicated that AASGD could be a highly effectiveand efficient algorithm for practical use.

1 Introduction

Stochastic gradient descent (SGD) is a widely used optimiza-tion technology in many applications, due to its simplicityand good empirical performances [Bousquet and Bottou, 2008;Rakhlin et al., 2012; Nemirovski et al., 2009]. In this paper,we focus on the adoption of SGD to solve the followingempirical risk minimization problem, whose objective is the

⇤This work was done when the author was visiting MicrosoftResearch Asia.

sum of smooth and convex loss functions, i.e.

min

x2R

d

F (x) =1

n

nX

i=1

fi

(x). (1)

Please note that the loss function f

i

(x) may take differ-ent forms in different applications. For example, supposewe have a set of training data (a1, b1), · · · , (an, bn), wherea

i

2 Rd is an input feature vector and b

i

2 R is its out-put. Then loss function f

i

is usually defined as a least squarefunction f

i

(x) =

12 (a

T

i

x� b

i

)

2 for regression, and a logisticfunction f

i

(x) = log(1 + exp(�b

i

a

T

i

x)) for classification.SGD exploits the additive nature of the empirical risk func-

tion F (x), and randomly samples an instance at each iterationto calculate the gradient and updates the model towards thedirection of negative gradient. Theoretical study on SGD hasrevealed that it has a sublinear convergence rate, meaning thatthe total number of component gradient evaluations requiredby SGD method to find an ✏-accurate solution is O(1/✏). Inrecent years, people have been working on accelerating theconvergence of SGD, by proposing new methods or leverag-ing existing methods in the literature of optimization. Repre-sentative acceleration methods include:

(1) Variance Reduction (VR) [Johnson and Zhang, 2013;Defazio et al., 2014]: Besides computing the gradient of onerandomly sampled instance in each iteration, the VR tech-nique computes the full gradient in a periodical manner anduses this full gradient for multiple iterations in order to reducethe sampling variance. It can be proven that the convergencerate of SGD can become linear by using the VR technique,under the condition of strong convexity.

(2) Stochastic Coordinate Sampling (SC) [Nesterov, 2012;Richtarik and Takac, 2014]: In addition to randomly sampletraining instances, the SC technique also performs randomsampling over the feature dimensions. In particular, it ran-domly samples a block of coordinates, computes the partialgradients with respect to the features in the sampled block,and updates the solution only over this block. It clear that,since the computation of partial gradients are much faster, byusing SC, SGD can become more efficient, especially whenthe number of coordinate blocks is relatively large.

(3) Nesterov’s Acceleration (NA) [Nesterov, 2004]: TheNA technique introduces one or multiple auxiliary variables,and updates the parameter according to the gradient at the

Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16)

1853

Page 2: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

auxiliary variable. Usually, the auxiliary variable is a slideof the current parameter leaning a little towards its own mo-mentum. It can be proven that the convergence rate of SGDis improved by using the NA technique [Hu et al., 2009].

In addition to the above efforts on accelerating the con-vergence of SGD, there is another line of research, whichspeeds up the SGD algorithm by performing asynchronousparallelization. This is mainly motivated by the availabil-ity of very big training data, which makes sequential SGDvery inefficient. In asynchronous parallel SGD [Recht et al.,2011; Agarwal and Duchi, 2012], multiple workers computestochastic gradients in parallel, and update the centralizedmodel without a synchronization with each other.

Given the above literature, a natural question to ask iswhether these techniques can be seamlessly integrated witheach other, and whether the integration has desirable conver-gence property. In this paper, we will provide our formalanswer to this question. In particular, we study the asyn-chronous parallelization of SGD, accelerated by the VR, SC,and NA techniques. We call the corresponding algorithmasynchronous accelerated SGD (or AASGD for short), andperform both theoretical and empirical investigations on it.

First, we prove that: 1) the three acceleration techniquesare complementary to each other and can make their own con-tributions to the convergence rate of AASGD; 2) the asyn-chronous parallelization does not hurt the convergence, andone can achieve square root speed up in certain situations.

Second, we tested AASGD on a few benchmark datasets.Our experimental results show: 1) the combination of VR,SC, and NA with SGD really leads to faster convergencerate as compared to conventional SGD; 2) Thanks to theasynchronous parallelization, AASGD can achieve promis-ing speedup when running on multiple workers. These resultsverified our theoretical findings and indicated that AASGDcould be a effective and efficient algorithm for practical use.

The remaining paper is organized as follows. In Section2, we introduce SGD, its acceleration methods, and other re-lated works. In Section 3, we propose the AASGD algorithm,and present our convergence analysis. Our empirical study isgiven in Section 4. We conclude the paper in the last section.

2 Backgrounds

2.1 SGD and its Acceleration Methods

SGD is a widely used algorithm to solve the empirical riskminimization problem (1), whose update rule is as follows:

xk

= xk�1 � ⌘

k

rfi

k

(xk�1), (2)

where f

i

k

is a randomly sampled component of F . It hasbeen proven that, SGD has sublinear convergence rate whena decreasing learning rate is used [Rakhlin et al., 2012].

In recent years, variance reduction, stochastic coordinatesampling, and Nesterov’s acceleration method have been usedto accelerate the convergence of SGD. In the following para-graphs, we will give them a brief introduction.

Variance Reduction (VR): It is well known that thevariance introduce by stochastic sampling prevents us fromadopting a constant learning rate in SGD (which makes SGDhave a slower convergence rate than full gradient descent). Toremedy this problem, a few variance reduction methods have

been proposed to improve SGD [Johnson and Zhang, 2013;Roux et al., 2012; Shalev-Shwartz and Zhang, 2013]. In thispaper, we focus on the method proposed in [Johnson andZhang, 2013], which follows a multi-stage scheme and com-putes the full gradient periodically to regularize the stochasticgradients. Specifically, at the beginning of stage s, we com-pute the full gradient rF (x

s

), and then run an inner loop(k = 1, · · · ,K) according to the following update formula:

vk

= rfi

k

(xk�1)�rf

i

k

(xs

) +rF (xs

),

xk

= xk�1 � ⌘v

k

.

The regularized gradient vk

becomes an unbiased estimate ofrF (x

k�1), and its variance is much smaller than f

i

k

(x

k�1)

which is used in SGD.Stochastic Coordinate Sampling (SC): When the data is

high-dimensional, even for one sampled instance, the com-putation of the gradient over all the dimensions is still time-consuming. To solve this problem, people have leveragedthe stochastic coordinate sampling method used in stochas-tic coordinate descent (SCD) [Nesterov, 2012; Richtarik andTakac, 2014; Shalev-Shwartz and Tewari, 2011]. That is, in-stead of computing the gradient over all the dimensions, withSC, we only compute the partial gradients over a sampled co-ordinate block, as shown below:

xk,l

= xk�1,l � ⌘

k

rl

F (xk�1), if l 2 C

k

,

xk,l

= xk�1,l, if l /2 C

k

,

where l is the coordinate index, Ck

(k 2 {1, ...,m}) is thecoordinate block randomly sampled in iteration k and r

l

F isthe partial gradient of F for coordinate l.

Nesterov’s Acceleration (NA): Nesterov proposed an ac-celeration method for gradient methods in [Nesterov, 2004].The basic idea is to consider the momentum when updatingthe parameters. In particular, Nesterov introduced one or sev-eral auxiliary parameters to record the current parameter plusits latest momentum. Then, the parameter is updated by thegradient at the value of the auxiliary variable. To be specific,with NA, the update rule becomes:

xk+1 = y

k

� ⌘k

rfi

k

(yk

),

yk+1 = x

k+1 + ↵(xk+1 � x

k

).

2.2 Existing Convergence Analysis

First, it has been shown that the three acceleration methodsintroduced above can make SGD converge faster. For exam-ple, [Johnson and Zhang, 2013], considered the integrationof VR with SGD, and [Lee et al., 2015] integrated both VRand NA with SGD. However, to our best knowledge, it is un-known what will happen if we simultaneously combine allthe three acceleration methods with SGD. Please note that, itis non-trivial to combine SC and NA with the involvement ofVR, and the update rule of the combined method makes thetheoretical analysis very difficult.

Second, as mentioned in the introduction, asynchronousparallelization of SGD and its convergence rate has been stud-ied in recent years. For example, in [Recht et al., 2011;Lian et al., 2015; Agarwal and Duchi, 2012; Langford et al.,2009; Zhang et al., 2013; Avron et al., 2014], the conver-gence rate of asynchronous SGD was studied in different set-tings. In [Reddi et al., 2015] the asynchronous parallelization

1854

Page 3: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

of SVRG was investigated. However, as far as we know, theasynchronous parallelization of SGD accelerated by VR, SC,and NA has not been studied yet. This is exactly what we aregoing to do in this paper.

3 Asynchronous Accelerated SGD

In this section, we propose a novel algorithm, which inte-grates all the techniques mentioned in the introduction to im-prove SGD. That is, it is an asynchronous parallel SGD algo-rithm, and accelerated by VR, SC, and NA at the same time.For ease of reference, we call this algorithm AASGD, whosedetails can be found in Algorithm 1.

Assume there are P workers and one master in the com-putational cluster. The workers are making updates to themaster in an asynchronous manner. Each worker has full ac-cess to the data, and stores a non-overlapping partition S

p

(p = 1, ..., P ) of the data index. In addition, the features arealso partitioned into m non-overlapping blocks, denoted as{C1, C2, ..., Cm

}. .The AASGD algorithm works in a multi-stage manner. At

the beginning of stage s, each worker calculates the gradientover all its local data, i.e.,

Pi2S

p

rf

i

(x

s

), and then sends itto the master. The master averages these updates and sendsthe full gradient back to the workers. After that, the workersand the master update the global vector for K rounds (k =

1, · · · ,K) according to the following rules:Worker: Read parameter x

k

from the master, randomlysample a mini-batch of data I

k

of size b without replacementand a block of coordinates C

k

, compute the VR-regularizedgradient u

k

based on l

k

over C

k

, and then send u

k

to themaster.

Master: Update parameter xk

and auxiliary parameters yk

and z

k

according to steps (5)-(7) in Algorithm 1.The following steps in Algorithm 1 are related to the accel-

eration technique: (i) the full gradient calculation in step (1)is used by VR; (ii) the master’s actions in steps (5)-(7) andthe mini-batch sampling in step (2) are used by NA1; (iii) thecoordinate sampling in step (3) is used by SC.

Please note that the workers run the above procedures inparallel, without synchronization with each other. As a con-sequence, the master will receive delayed gradients. Specifi-cally, in Algorithm 1, the regularized gradient u

k

in Step (4)is calculated with respect to a delayed parameter x

k�⌧

k

. Inpractical, ⌧

k

is a random variable, dependent of the compu-tational cluster (e.g., the heterogeneity of the computationalnodes and their inter-connections). It is clear that, the delayis linearly increasing with the number of workers.

4 Convergence Analysis

In this section, we analyze the convergence rate of SASGDand AASGD. To this end, we make the following assump-tions, which are commonly used in previous works [Agarwaland Duchi, 2012; Zhao et al., 2014; Recht et al., 2011].

Assumption 1 (Smoothness): The components {fi

(x); i 2[n]} of F (x) are differentiable and have Lipschitz continuous

1It has been proved in [Nitanda, 2014], the mini-batch strategy isnecessary for the faster convergence of SGD with NA.

Algorithm 1 Asynchronous Accelerated SGD (AASGD)Require: initial vector [x0, ⌘,�, b,K, S]

Ensure: x

S

for s = 1, 2, ..., S do

x = x

s�1; x0 = y0 = z0 = x

For local worker p: calculate rFp

(x0) =P

i2S

p

rfi

(x0)

and send it to the center.(1) For master: calculate rF (x0) =

1P

PP

p=1 rF

p

(x0)

for k = 1, ...,K do

For local worker p: read x

k

and calculate uk

as below:(2) Randomly select a mini-batch of data I

k

with sizeb,(3) Randomly select a coordinate block C

j

k

,(4) Calculate u

k+1,l = rl

f

I

k

(x

k�⌧

k

)�rl

f

I

k

(x0)+

rl

F (x0) if l 2 C

j

k

; uk+1,l = 0 if l /2 C

j

k

and sendit to the master.For master: update the parameters as below:(5) y

k,l

= x

k,l

� ⌘u

k,l

if l 2 C

j

k

; yk,l

= y

k�1,l ifl /2 C

j

k

.(6) z

k

= z

k�1 � ↵u

k

(7) xk+1 = (1� �)y

k

+ �z

k

end for

x

s

=

1K

PK

k=1 xs

k

end for

partial gradients. That is to say, there exists a positive con-stant L

max

, such that 8i 2 [n], j 2 [d], for 8x, y 2 Rd withx

j

6= y

j

, we havekr

j

fi

(x)�rj

fi

(y)k Lmax

kxj

� yj

k.2Therefore, the components f

i

(x) have Lipschitz continu-ous gradients, as shown below:

krfi

(x)�rfi

(y)k Lres

kx� yk, 8i.Assumption 2 (Convexity): F (x) is strongly convex with

convexity parameter µ, i.e.,F (y) � F (x) +rF (x)

T

(y � x) +

µ

2 ky � xk2, 8x, y 2 Rd.Assumption 3 (Sparseness): The sparseness in mini-batch

setting is defined as follows3:

� = max

j2[d]

PC

b

n

v=1 I[9i2I

v

,s.t.x

i,j

6=0]

C

b

n

,

where I denotes the indicator function and I

v

denotes themini-batch with index v which is a subset of [n]. Intuitively,the sparseness measures the maximal frequency for arbitrarycoordinate appears in the mini-batch inputs. It is commonlyassumed that the sparseness is upper bounded.

Assumption 4 (Bounded Delay): The delays ⌧1, ⌧2, ... areindependent random variables, and ⌧

k

⌧ for all k.Based on above assumptions, we proved two theorems.

The first one is for the sequential version of SGD acceler-ated by VR, SC, and NA (which we call SASGD sequentialaccelerated SGD), and the second one is regarding its asyn-chronous parallelization. In order to distinguish the parame-ters for SASGD and AASGD, we use subscript 0 to denote

2In this paper, if there is no specification, k · k is the L2-norm.3In this paper, for simplicity and without confusion, we omit the

mini-batch size b in sparseness.

1855

Page 4: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

parameters for SASGD (and parameters without subscript forAASGD).Theorem 4.1 Under Assumptions 1-3, if we set step size⌘0 1

L

max

, �0 =

⌘0

⌘0+m↵

, and K sufficiently large so that

⇢0 =

1

1� ↵0A

✓m↵0

⌘0K+

m

µ↵0K+ ↵0A

◆< 1,

where 0 < ↵0 <

1A

and A =

4Lres

(n�b)b(n�1) , then SASGD

algorithm has geometric convergence in expectation:

EF (x

s

)� F (x

⇤) ⇢

s

0[F (x0)� F (x

⇤)].

Proof: First, we take expectation of the VR-regularizedgradients v

k+1 with respect to I

k

, j

k

as below,

EI

k

,j

k

vk+1 =

1

mE

I

k

vk+1 =

1

mrF (x

k+1).

Then, for the auxiliary parameter z, we have:EI

k

,j

k

kzk+1 � x⇤k2

= kzk

� x⇤k2 � 2↵0EI

k

,j

k

vTk+1(zk � x⇤

) + ↵20EI

k

,j

k

kvk+1k2

= kzk

� x⇤k2 � 2

m↵0rF (x

k+1)T

(zk

� x⇤)

+ ↵20EI

k

,j

k

kvk+1k2.

Therefore,

rF (xk+1)

T

(zk

� x⇤) =

m↵0

2

EI

k

,j

k

kvk+1k2

+

m

2↵0kz

k

� x⇤k2 � m

2↵0EI

k

,j

k

kzk+1 � x⇤k2. (3)

According to the smoothness of partial gradients, we havethe following:

EI

k

,j

k

F (yk+1)

F (xk+1)� ⌘0EI

k

,j

k

rF (xk+1)

T vk+1 (4)

+

Lmax

⌘20

2

EI

k

,j

k

kvk+1k2

= F (xk+1)� ⌘0

mkrF (x

k+1)k2 + Lmax

⌘20

2

EI

k

,j

k

kvk+1k2.

Thus, we have the following inequality:

0 m↵0

⌘0(F (x

k+1)� EI

k

,j

k

F (yk+1))

� ↵0krF (xk+1)k2 + L

max

m⌘0↵0

2

EI

k

,j

k

kvk+1k2.

After that, by following the proof of Theorem 3 in [Lee etal., 2015], we proved this theorem. ⇤

Based on Theorem 4.1, we have the following corollaryfor the complexity of SASGD, which is defined as how manypartial gradients we need to calculate so as to guarantee theoptimization error less than ✏.Corollary 4.2 Under Assumptions 1-3, and the parametersetups in Theorem 4.1, if we set ↵0 = min{ 1

3A ,

1pL

max

µ

},

and the mini-batch size b =

12np1

(n�1)+12p1

, then the SASGDcan achieve its optimal overall complexity,which is

O((nm+

nmp2

p1

n+

p1

) log

1

✏),

where 1 =

L

2res

L

max

µ

and 2 =

L

max

µ

.

Proof: For SASGD, by setting ↵0 = min{ 13A , 1p

L

max

µ

},

⌘0 =

1L

max

, we can get ⇢0 < 12/3

⇣m

p2

K

+

m

µ↵0K+

13

⌘.

Choosing mini-batch size b =

12np1

(n�1)+12p1

, then we canget 1

3A =

1pL

max

µ

. Putting ↵0 =

1pL

max

µ

in ⇢0, then

⇢0 =

12/3

⇣2m

p2

K

+

13

⌘. Then we can choose K = O(m

p2).

Then the overall complexity (number of partial gradientsevaluation) is O(nm + bm

p2). Putting b =

12np1

(n�1)+12p1

inO(nm+ bm

p2) can get the result. ⇤

Remarks: (1) The convergence rate of SASGD in The-orem 4.1 is linear, much faster than the sublinear conver-gence rate of SGD. This clearly demonstrates the advantagesof adopting the acceleration techniques.

(2) From the complexity of SASGD in Theorem 4.1and Corollary 4.2, we can observe the complementarycontributions of three acceleration methods. As we know, thecomplexity of SGD with a decreasing step size ⌘

k

= 1/µk isO(1/✏µ)[Rakhlin et al., 2012]. Comparing the complexityof SASGD to that of SGD, i) VR method improves thecomplexity from O(1/✏µ) to O �

(nm+mLres

/µ) log 1✏

�;

ii) NA method improves the coefficient in the complex-

ity from (nm+mLres

/µ) to✓nm+

nmL

res

n+p

L

res

◆; iii)

SCD method improve the coefficient from nmL

res

n+p

L

res

tonmL

res

n+p

L

res

pL

res

/L

max

, which is faster since Lres

� Lmax

.

Next, the following Theorem states the convergence rateafter introducing asynchronous parallelization to SASGD.Theorem 4.3 Under Assumptions 1-4, and � satisfiesp� < min{µ, 1

4}, if we set the step size ⌘ 12L

max

,� =

m↵+⌘

, and K is sufficiently large so that

⇢ =

1

1� ↵AD

✓m↵

⌘Lmax

K+

m

µ↵K+ ↵AD

◆< 1,

where 0 < ↵ <

1AD

, A =

4Lres

(n�b)b(n�1) , D = 2(1�

p�2 ), then

AASGD algorithm has geometric convergence in expectation:

EF (x

s

)� F (x

⇤) ⇢

s

[F (x0)� F (x

⇤)].

Proof: At stage s, let vk+1 and u

k+1 be two vectors whosel-th dimension defined as follows:vk+1,l = r

l

fI

k

(xk+1)�r

l

fI

k

(xs�1) +r

l

F (xs�1) if l 2 C

j

k

;otherwise, v

k+1,l = 0.uk+1,l = r

l

fI

k

(xk+1�⌧

k

) � rl

fI

k

(xs�1) + r

l

F (xs�1) if l 2

Cj

k

;otherwise,uk+1,l = 0.

Let vk+1 = rf

I

k

(xk+1)�rf

I

k

(xs�1) +rF (x

s�1)

and uk+1 = rf

I

k

(xk+1�⌧

k

)�rfI

k

(xs�1) +rF (x

s�1).According to Inequality (6) and Inequality (7) in paper [Leeet al., 2015], we have:

F (xk+1)� F (x⇤

)

1� �

�(F (y

k

)� F (xk+1))� 1� �

µ

2

kyk

� xk+1k2

+rF (xk+1)

T

(zk

� x⇤)� µ

2

kxk+1 � x⇤k2.

1856

Page 5: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

Let EI

k

,j

k

be the conditional expectations conditioned on{x

s

, y

s

, z

s

}s=0,1,...,k in stage s. Since z

k+1�z

k

= �↵u

k+1,and E

I

k

,j

k

u

k+1 =

1m

rF (x

k+1�⌧

k

), we can get:

rF (xk+1)

T

(zk

� x⇤)

= EI

k

(vk+1 � u

k+1)T

(zk

� x⇤) +

m↵

2

EI

k

,j

k

kuk+1k2

+

m

2↵kz

k

� x⇤k2 � m

2↵E

I

k

,j

k

kzk+1 � x⇤k2. (5)

According to the smoothness of F , we have:

EI

k

,j

k

F (yk+1)

F (xk+1)� ⌘

mkrF (x

k+1)k2 + Lmax

⌘2

2

EI

k

,j

k

kuk+1k2

+

mE

I

k

rF (xk+1)

T

(vk+1 � u

k+1). (6)

The difference between AASGD and SASGD mainly lies inthe communication delay ⌧ . To characterize its influence onthe convergence rate, we take the following three steps.

Step 1: Due to the delay, Equation (5) has an extra termEI

k

(v

k+1� u

k+1)T

(z

k

�x

⇤) as compared with Equation (3).

According to the fact that zk

= x

k+1 � 1��

(y

k

� x

k+1) andthe Cauthy-Schwarz inequality, we have

mEI

k

,j

k

(vk+1 � u

k+1)T

(zk

� x⇤)

EI

k

kvk+1 � u

k+1kkxk+1 � x⇤kI

k

+

1� �

�EI

k

kvk+1 � u

k+1kkxk+1 � yk

kI

k

,

where kxkI

k

denote the norm of x with respect to theunion of non-zero coordinates of a

i

2 I

k

, i.e., kxkI

k

=

(

Pd

l=1 |xl

|2I[9ai

2I

k

s.t.a

il

6=0])12 . Using the AM-GM inequality,

the sparseness condition and x

k+1 is independent of Ik

, wecan obtain:

EI

k

kvk+1 � u

k+1kkxk+1 � x⇤kI

k

p�E

I

k

kvk+1 � u

k+1k22

+

EI

k

kxk+1 � x⇤k2

I

k

2

p�

p�E

I

k

kvk+1k2 +

p�E

I

k

kuk+1k2

+

p�E

I

k

kxk+1 � x⇤k22

.

Since we also have EI

k

,j

k

kuk+1k2 = E

I

k

kuk+1k2, and

EI

k

,j

k

kvk+1k2 = E

I

k

kuk+1k2, Equation (5) can be re-written

as

rF (xk+1)

T

(zk

� x⇤) � m

2↵E

I

k

,j

k

kzk+1 � x⇤k2

+

m

2↵kz

k

� x⇤k2 +p�

1

�EI

k

kvk+1k2 +

p�

2

kxk+1 � x⇤k2

+

p�(1� �)

2�kx

k+1 � yk

k2

+ (

2

+

p�

1

�)E

I

k

kuk+1k2. (7)

Step 2: Due to the delay, Inequality (6) has an extra term⌘

m

EI

k

rF (xk+1)

T

(vk+1 � u

k+1) as compared with Equation(4). We bound this term using the same technique as Step 1.

mE

I

k

rF (xk+1)

T

(vk+1 � u

k+1) ⌘p�

2mkrF (x

k+1)k2

+

⌘p�

mEI

k

kvk+1k2 + ⌘

p�

mEI

k

kuk+1k2.

Then Inequality (6) can be re-written as0 (F (x

k+1)� EI

k

,j

k

F (yk+1))

�✓

m� ⌘

p�

2m

◆krF (x

k+1)k2

+

✓L

max

⌘2

2m+

⌘p�

m

◆EI

k

kuk+1k2 + ⌘

p�

mEI

k

kvk+1k2.

(8)

By multiplying 2d↵⌘

on both sides of (8) and adding in (7),we can get:rF (x

k+1)T

(zk

� x⇤)

m

2↵kz

k

� x⇤k2 � m

2↵EI

k

,j

k

kzk+1 � x⇤k2

+

p�

2

kxk+1 � x⇤k2 +

p�

2

✓1� �

◆kx

k+1 � yk

k2

+

2m↵

⌘(F (x

k+1)� EI

k

,j

k

F (yk+1))

+ 2

✓↵(

T⌘

2

+

p�) +

p�

◆EI

k

kuk+1k2

� 2↵

✓1�

p�

2

◆krF (x

k+1)k2

+ 2

✓↵p�+

p�

◆E

I

k

kvk+1k2. (9)

Step 3: Let 1��

=

2↵m

. We take expectation with respect to⌧k

. Under the assumptionp� < µ, by summing inequality

(9) over k = 0, ...,K � 1, we can get:PK�1k=0 F (x

k+1)�F (x⇤) m

2↵kz0�x⇤k2+PK�1k=0 ↵HE

I

k

kuk

k2�P

K�1k=0 ↵DkrF (x

k+1)k2 + 2m↵

(F (y0)� F (x⇤)),

where H = 2⌧h⇣

L

max

2 +

p�

⌘+

⇣12⌧ +

m

p�

⌘iand D =

2

⇣1�

p�2

⌘. According to Inequality (12) in paper [Lee et

al., 2015], under the condition D � H, we can get:

(1� ↵AD)�s

m

2Kµ↵+

2m↵

K⌘+ ↵AD

◆�s�1,

where �

s

= F (x

s

)� F (x

⇤). ⇤

As for Theorem 4.2, we have the following discussions.The introduction of asynchronous parallelization does hurtthe convergence of SASGD by a little (mainly due to the com-munication delay). However, when we run the AASGD algo-rithm on multiple machines, we can still achieve significantspeed up under certain conditions, as shown in the followingcorollary.

1857

Page 6: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

(a) comparison on rcv1 (b) comparison on real-sim (c) comparison on news20 (d) speedup

Figure 1: Figure(a), Figure(b) and Figure(c) are comparisons of SASGD and SGD on three datasets respectively; Figure(d) isthe speedups for AASGD on three datasets.

Corollary 4.4 Assumep� < min{µ, 1

4}. If we set the stepsize ⌘ =

12L

max

,↵ = min{ 16A ,

1pL

max

µ⌧

} and select theblock size m <

116L

max

�1/4 , then AASGD will achieve atleast square root speedup with respect to the number of work-ers when ⌧ <

14�1/8 .

Proof: Compared with SASGD, the convergence rate in The-orem 4.2 is slower due to the delay. In order to get speedupfor AASGD, the order of inner loop K cannot be ⌧ timeslarger than SASGD. The order of K is related to two pa-rameters ⌘ and ↵. In SASGD, ⌘0 =

1L

max

. For AASGD,we set ⌘ =

12L

max

. Here we are interested in the situ-ation where the � ⌧ 1. Considering

p� < min{µ, 1

4},the condition

⇣1�

p�2

⌘> ⌧

⇣L

max

2 +

p�+

12⌧ +

m

p�

can be satisfied with m <

116L

max

�1/4 and ⌧ <

14�1/8 .

For AASGD, we set ↵ = min{ 1pL

max

µ⌧

, 16A} and b =

24np

1/⌧

(n�1)+24p

1/⌧, the inner loop K is in the same order of

O✓✓

nm+

nm

p2

p1

n+p

1/⌧

◆log

1✏

◆. Compared with SASGD, it

is at mostp⌧ larger but the computing time is ⌧ times smaller.

The full gradient calculation can be distributed to multiplemachine to get P times speedup. As a result, AASGD canachieve at least

pP times speedup since ⌧ is in proportion to

the number of local worker P . ⇤Remark: Data sparsity serves as a condition for the

speedup. If the data is sparse, the condition is more likelyto hold, and we will get the speed-up.

5 Experiments

In this section, we report our experimental results to demon-strate the efficiency of AASGD, and validate our theoreticalfindings. We conducted binary classification tasks on threebenchmark dataset: rcv1, real-sim, news20, where rcv1 is thedensest dataset and news20 is of the highest dimension. Thedetailed information about the three datasets can be foundfrom LibSVM website. The objective function used in our ex-periments is the L2-regularized logistic regression loss. Wemainly compared AASGD, SASGD, and standard SGD al-gorithms, in terms of their convergence properties. In theAASGD algorithm, we set the number of block partitions asm = d/100, the mini-batch size as

pn/

pP (P is the num-

ber of threads), and the inner loop K = 2mn. The stop-

ping criterion in our experiments is the training error smallerthan 10

�10 (i.e., F (x

k

) � F (x

⇤) < 10

�10). For the datasetswe used, L

max

= L

res

< 0.25 since the input data is nor-malized [Reddi et al., 2015], ⌧ ⇡ P , µ = 1/

pn = 0.01

[Shamir et al., 2014]. In SASGD and AASGD, we set step-sizes ⌘0 = 0.2 and ⌘ = 0.1/P , which satisfy our assumptionsin the theorems and corollaries.

First, we investigate the SASGD algorithm. We compare itwith standard SGD with different step sizes: a constant stepsize (denoted as C-SGD) and a decreasing step size as 1/

pk

where k is the iteration [Reddi et al., 2015](denoted as D-SGD). We plot the training curves of SASGD, C-SGD, andD-SGD in Figure 1(a),1(b),and 1(c)(for the three datasets re-spectively). From the figure, we have the following observa-tions: D-SGD and C-SGD are faster than SASGD when wewant to get a low-precise solution,i.e., ✏ < 10

�2. As the train-ing process continues, SASGD converges much faster thanD-SGD and C-SGD on all the three datasets when we want toget a high-precise solution. This is consistent with our theo-retical results (complexity analysis).

Second, we examine the benefit of AASGD by runningon multiple workers (when there is only one local worker,AASGD reduces to SASGD). We implement AASGD with2,4,..,16 workers, and plot its speedups in Figure 1(d) (for thethree datasets respectively). The speedup is defined as the ra-tio of the runtime with a single thread to the runtime with P

threads. From these figures, we have the following observa-tions:(1) on all the three datasets, AASGD has considerablespeedup with respect to the number of workers, in an orderlower than linear but higher than square root; (2) the small-est speedup is observed on rcv1. This is consistent with ourtheoretical results, since rcv1 is the densest dataset. [Reddi etal., 2015; Recht et al., 2011] get a similar result on rcv1.

6 Conclusions

In this paper, we focus on asynchronous SGD with acceler-ation methods, such as variance reduction, Nesterov’s accel-eration, and stochastic coordinate sampling. We prove theconvergence rate for AASGD, and analyze the conditions forits speedup with respect to the number of workers. Our exper-iments on benchmark datasets well validated our theoreticalfindings. In the future, we will investigate the convergencerate of SGD with more acceleration methods, and AASGD indistributed network architectures.

1858

Page 7: Asynchronous Accelerated Stochastic Gradient …Asynchronous Accelerated Stochastic Gradient Descent Qi Meng,1 Wei Chen,2 Jingcheng Yu,3 Taifeng Wang,2 Zhi-Ming Ma,4 Tie-Yan Liu2 1

References

[Agarwal and Duchi, 2012] Abhishek Agarwal and John CDuchi. Distributed delayed stochastic optimization. In De-cision and Control (CDC), 2012 IEEE 51st Annual Con-ference on, pages 5451–5452. IEEE, 2012.

[Avron et al., 2014] Haim Avron, Alex Druinsky, and ArpanGupta. Revisiting asynchronous linear solvers: Provableconvergence rate through randomization. In Parallel andDistributed Processing Symposium, 2014 IEEE 28th Inter-national, pages 198–207. IEEE, 2014.

[Bousquet and Bottou, 2008] Olivier Bousquet and LeonBottou. The tradeoffs of large scale learning. In Advancesin Neural Information Processing Systems (NIPS), pages161–168, 2008.

[Defazio et al., 2014] Aaron Defazio, Francis Bach, and Si-mon Lacoste-Julien. Saga: A fast incremental gradientmethod with support for non-strongly convex compositeobjectives. In Advances in Neural Information ProcessingSystems (NIPS), pages 1646–1654, 2014.

[Hu et al., 2009] Chonghai Hu, Weike Pan, and James TKwok. Accelerated gradient methods for stochastic opti-mization and online learning. In Advances in Neural Infor-mation Processing Systems (NIPS), pages 781–789, 2009.

[Johnson and Zhang, 2013] Rie Johnson and Tong Zhang.Accelerating stochastic gradient descent using predictivevariance reduction. In Advances in Neural InformationProcessing Systems (NIPS), pages 315–323, 2013.

[Langford et al., 2009] John Langford, Alexander Smola,and Martin Zinkevich. Slow learners are fast. arXivpreprint arXiv:0911.0491, 2009.

[Lee et al., 2015] Jason Lee, Tengyu Ma, and Qihang Lin.Distributed stochastic variance reduced gradient methods.arXiv preprint arXiv:1507.07595, 2015.

[Lian et al., 2015] Xiangru Lian, Yijun Huang, Yuncheng Li,and Ji Liu. Asynchronous parallel stochastic gradient fornonconvex optimization. In Advances in Neural Informa-tion Processing Systems (NIPS), pages 2719–2727, 2015.

[Nemirovski et al., 2009] Arkadi Nemirovski, Anatoli Judit-sky, Guanghui Lan, and Alexander Shapiro. Robuststochastic approximation approach to stochastic program-ming. SIAM Journal on Optimization, 19(4):1574–1609,2009.

[Nesterov, 2004] Yurii Nesterov. Introductory lectures onconvex optimization, volume 87. Springer Science & Busi-ness Media, 2004.

[Nesterov, 2012] Yu Nesterov. Efficiency of coordinate de-scent methods on huge-scale optimization problems. SIAMJournal on Optimization, 22(2):341–362, 2012.

[Nitanda, 2014] Atsushi Nitanda. Stochastic proximal gra-dient descent with acceleration techniques. In Advancesin Neural Information Processing Systems (NIPS), pages1574–1582, 2014.

[Rakhlin et al., 2012] Alexander Rakhlin, Ohad Shamir, andKarthik Sridharan. Making gradient descent optimal for

strongly convex stochastic optimization. In Proceedingsof the 29th International Conference on Machine Learning(ICML-12), pages 449–456, 2012.

[Recht et al., 2011] Benjamin Recht, Christopher Re,Stephen Wright, and Feng Niu. Hogwild: A lock-freeapproach to parallelizing stochastic gradient descent.In Advances in Neural Information Processing Systems(NIPS), pages 693–701, 2011.

[Reddi et al., 2015] Sashank J Reddi, Ahmed Hefny, SuvritSra, Barnabas Poczos, and Alex J Smola. On variance re-duction in stochastic gradient descent and its asynchronousvariants. In Advances in Neural Information ProcessingSystems (NIPS), pages 2629–2637, 2015.

[Richtarik and Takac, 2014] Peter Richtarik and MartinTakac. Iteration complexity of randomized block-coordinate descent methods for minimizing a compositefunction. Mathematical Programming, 144(1-2):1–38,2014.

[Roux et al., 2012] Nicolas Le Roux, Mark Schmidt, andFrancis Bach. A stochastic gradient method with an ex-ponential convergence rate for finite training sets. arXivpreprint arXiv:1202.6258, 2012.

[Shalev-Shwartz and Tewari, 2011] Shai Shalev-Shwartzand Ambuj Tewari. Stochastic methods for l 1-regularizedloss minimization. The Journal of Machine LearningResearch, 12:1865–1892, 2011.

[Shalev-Shwartz and Zhang, 2013] Shai Shalev-Shwartz andTong Zhang. Stochastic dual coordinate ascent methodsfor regularized loss. The Journal of Machine Learning Re-search, 14(1):567–599, 2013.

[Shamir et al., 2014] Ohad Shamir, Nati Srebro, and TongZhang. Communication-efficient distributed optimizationusing an approximate newton-type method. In Proceed-ings of the 31st International Conference on MachineLearning (ICML-14), pages 1000–1008, 2014.

[Zhang et al., 2013] Shanshan Zhang, Ce Zhang, Zhao You,Rong Zheng, and Bo Xu. Asynchronous stochastic gradi-ent descent for dnn training. In Acoustics, Speech and Sig-nal Processing (ICASSP), 2013 IEEE International Con-ference on, pages 6660–6663. IEEE, 2013.

[Zhao et al., 2014] Tuo Zhao, Mo Yu, Yiming Wang, RamanArora, and Han Liu. Accelerated mini-batch randomizedblock coordinate descent method. In Advances in Neu-ral Information Processing Systems (NIPS), pages 3329–3337, 2014.

1859