Optimal Decentralized Distributed Algorithms for Stochastic Convex Optimization
Eduard Gorbunov, Darina Dvinskikh, Alexander Gasnikov
Introduction
In this paper, we are interested in the convex optimization problem
where is a random variable. Problems of this type play a central role in a bunch of applications of machine learning and mathematical statistics . Typically represents the feature vector defining the model, only samples of are available and the distribution of is unknown. One possible way to minimize generalization error (2) is to solve empirical risk minimization or finite-sum minimization problem instead, i.e. solve (1) with the objective
where should be sufficiently large to approximate the initial problem. Indeed, if is convex and -Lipschitz continuous for all , has finite diameter and , then (see ) with probability at least
and if additionally is -strongly convex for all , then (see ) with probability at least
In other words, to solve (1)+(2) with functional accuracy via minimization of empirical risk (3) it is needed to have in the convex case and in the -strongly convex case where hides a constant factor, a logarithmic factor of and a polylogarithmic factor of .
Stochastic first-order methods such as Stochastic Gradient Descent (SGD) or its accelerated variants like AC-SA or Similar Triangles Method (STM) are very popular choice to solve either (1)+(2) or (1)+(3). In contrast with their cheap iterations in terms of computational cost, these methods converge only to the neighbourhood of the solution, i.e. to the ball centered at the optimality and radius proportional to the standard deviation of the stochastic estimator. For the particular case of finite-sum minimization problem one can solve this issue via variance-reduction trick and its accelerated variants . Unfortunately, this technique is not applicable in general for the problems of type (1)+(2). Another possible way to reduce the variance is mini-batching. When the objective function is -smooth one can accelerate the computations of batches using parallelization , and it is one of the examples where centralized distributed optimization appears naturally .
In other words, in some situations, e.g. when the number of samples is too big, it is preferable in practice to split the data into blocks, assign each block to the separate worker, e.g. processor, and organize computation of the gradient or stochastic gradient in the parallel or distributed manner. Moreover, in view of (4)-(5) sometimes to solve an expectation minimization problem it is needed to have such a big number of samples that corresponding information (e.g. some objects like images, videos and etc.) cannot be stored on machine because of the memory limitations (see Section 8 for the detailed example of such a situation). Then, we can rewrite the objective function in the following form
Here corresponds to the loss on the -th data block and could be also represented as an expectation or a finite sum. So, the general idea for parallel optimization is to compute gradients or stochastic gradients by each worker, then aggregate the results by the master node and broadcast new iterate or needed information to obtain the new iterate back to the workers.
The visual simplicity of the parallel scheme hides synchronization drawback and high requirement to master node . The big line of works is aimed to solve this issue via periodical synchronization , error-compensation , quantization or combination of these techniques .
However, in this paper we mainly focus on another approach to deal with aforementioned drawbacks — decentralized distributed optimization . It is based on two basic principles: every node communicates only with its neighbours and communications are performed simultaneously. Moreover, this architecture is more robust, e.g. it can be applied to time-varying (wireless) communication networks .
One can consider this paper as a continuation of work where authors mentioned the key ideas that form a basis of this work. However, in this paper we provide formal proofs of some results announced in together with couple of new results that were not mentioned. Our contributions include:
Accelerated primal-dual method with biased stochastic dual oracle for convex and smooth dual problem. We extent the result from the recent work to the case when we have an access to the biased stochastic gradients. We emphasize that our analysis works for the minimization on whole space and we do not assume that the sequence generated by the method is bounded. It creates extra difficulties in the analysis, but we handle it via advanced technique for estimating recurrences (see also ).
Two accelerated methods with stochastic dual oracle for strongly convex and smooth dual problem. For the case when the dual function is strongly convex with Lipschitz continuous gradient we analyze two methods: one is R-RRMA-AC-SA2 and another is SSTM_sc. The first one was described in , but in this paper we formally state the method and prove high probability bounds for its convergence rate. The second method is also well-known, but to the best of our knowledge there were no convergence results for it in such generality that we handle. That is, we consider SSTM_sc with biased stochastic oracle applied to the unconstrained smooth and strongly convex minimization problem and prove high probability bounds for its convergence rate together with the bound for the noise level. As for the convex case, we also do not assume that the sequence generated by the method is bounded. Then we show how it can be applied to solve stochastic optimization problem with affine constraints using dual oracle.
Analysis of STM applied to convex smooth minimization problem with smooth convex composite term and inexact proximal step for unconstrained minimization. Surprisingly, but before this paper there were no analysis for STM in this case. The closest work to ours in this topic is , but in authors considered optimization problems on bounded sets.
2 Outline of the Paper
In Section 2, we introduce the notation and main definitions used in the paper. Then, we discuss optimal bounds for stochastic convex optimization in Section 3. In Section 4, we present the stochastic optimization problems with affine constraints and the state-of-the-art methods that solve the specific penalized unconstrained problem instead of the original one together with the novel approach which we call STP_IPS that aims to solve convex smooth unconstrained minimization problems with the smooth convex composite term and inexact proximal step. Next, we consider the same type of problems but using a dual approach and develop three different accelerated methods for this case together with the convergence analysis for each of them (Section 5). The first one is Stochastic Primal-Dual STM (SPDSTM), and it uses a biased stochastic dual oracle to solve primal and dual problems simultaneously for the case when the primal problem is -strongly convex and Lipschitz continuous on some ball centered at zero. The next two methods are R-RRMA-AC-SA2 and SSTM_sc, and they solve the same problem when the primal functional is additionally -smooth using a stochastic dual oracle. The difference between them is that R-RRMA-AC-SA2 uses special restarts technique and works with unbiased stochastic oracle, while SSTM_sc is directly accelerated and able to work with biased stochastic gradients. Then we show how to apply the results of the previous sections to the decentralized distributed optimization problems and derive the bounds for the proposed methods in Section 6. Finally, in Section 7, we compare bounds for the convergence rate in parallel and decentralized optimization, discuss the optimality of the obtained results, and present possible directions for future work. To illustrate how our theory works, we consider the problem of calculation of population Wasserstein barycenter in Section 8. We leave long proofs, auxiliary and technical results, and the whole section about STP_IPS in the appendix.
Notation and Definitions
Below we list some classical definitions for optimization (see, for example, for the details).
If then there exists unique minimizer of on which we denote by , except the situations when we explicitly specify in a different way. In the case when , i.e. is convex, we assume that there exists at least one minimizer of on and in the case when the set of minimizers of on the set is not a singleton we choose to be either arbitrary or closest to the starting point of a method. When we consider some optimization method with a starting point we use or to denote the Euclidean distance between and .
Optimal Bounds for Stochastic Convex Optimization
In this section our goal is to present the overview of the optimal methods and their convergence rates for the stochastic convex optimization problem (1)+(2) in the case when the gradient of the objective function is available only through (possibly biased) stochastic estimators with “light tails” or, equivalently, with -sub-Gaussian variance. That is, we are interested in the situation when for an arbitrary one can get such stochastic gradient that
In this paper we are mainly focus on smooth optimization problems and use different modifications of Similar Triangles Method (STM) since it gives optimal rates in this case and it is easy enough to analyze at least in the deterministic case. For convenience, we state the method in this section as Algorithm 1.
Interestingly, if we run STM with to solve (1) with -strongly convex and -smooth objective, it will return such that after iterations which is not optimal, seeIn some places we put references not to the first work where this bound was shown but to the works where this complexity bound was shown for either more convenient or more relevant to our work method. Table 1. To match the optimal bound in this case one should use classical restart of STM which is run with .
We notice that another highly widespread in machine learning applications type of problems is regularized or composite optimization problem
where is a convex proximable function. For this case STM can be generalized via modifying the update rule in the following way :
We address such problems with -smooth composite term in the Appendix, see Section E for the details.
Next, we go back to the problem (1)+(2) and consider more general case when and . In this case one can construct unbiased estimator
where are i.i.d. samples and has times smaller variance than :
Then in order to get such a point that with probability at least where and is -strongly convex () and -smooth one can run STM for
which is optimal up to logarithmic factors. We call this modification Stochastic STM (SSTM). As for the deterministic case we summarize the state-of-the-art results for this case in Table 2.
Stochastic Convex Optimization with Affine Constraints: Primal Approach
Now, we are going to make a step towards decentralized distributed optimization and consider convex optimization problem with affine constraints:
where and . Up to a sign we can define the dual problem in the following way
However, in this section we are interested only in primal approaches to solve (17) and, in particular, the main goal of this section is to present first-order methods that are optimal both in terms of and calculations. Before we start our analysis let us notice that typically in decentralized optimization matrix from (17) is chosen as a square root of Laplacian matrix of communication network (see Section 6 for the details). In asynchronous case the square root is replaced by incidence matrix (). Then in asynchronous case instead of accelerated methods for (18) one should use accelerated block-coordinate descent methods .
To solve problem (17) we use the following trick : instead of (17) we consider penalized problem
where is the desired accuracy of the solution in terms of that we want to achieve. The motivation behind this trick is revealed in the following theorem.
We start with the analysis of the case when is -smooth and convex.
to produce point such that (22) holds.
That is, number of calculations matches the optimal bound for deterministic convex and -smooth problems of type (1) multiplied by up to logarithmic factors (see Table 1).
We conjecture that the same technique in the case when is -strongly convex and -smooth gives the method that requires such number of calculations that matches the second rows of Tables 1 and 2 in the corresponding cases with additional factor and logarithmic factors. Recently such bounds were shown in for the distributed version of Multistage Accelerated Stochastic Gradient method from . However, this bounds were shown for the case when the stochastic gradient is unbiased.
Next, we assume that is closed and convex and is -strongly convex, but possibly non-smooth function with bounded gradients: for all . Let us start with the case . Then, to achieve (22) one can run Sliding method from considering as a composite term. In this case Sliding requires
In the case when is a compact set and is not available and unbiased stochastic gradient is used instead (see inequalities (10)-(11) with ) one can show that Stochastic Sliding (S-Sliding) method can achieve (22) with probability at least , , and it requires the same number of calculations of as in (26) up to logarithmic factors and
When one can apply restarts technique on top of S-Sliding (RS-Sliding) and get that to guarantee (22) with probability at least , RS-Sliding requires
We notice that bounds presented above for the non-smooth case are proved only for the case when is bounded. For the case of unbounded the convergence results with such rates were proved only in expectation. Moreover, it would be interesting to study S-Sliding and RS-Sliding in the case when , i.e. stochastic gradient is biased, but we leave these questions for future works.
Stochastic Convex Optimization with Affine Constraints: Dual Approach
We notice that in this section we do not assume that is symmetric or positive semidefinite.
Assume additionally that satisfies so-called “light-tails” inequality:
The size of the batch could always be restored from the context, so, we do not specify it here. Note that the batch version satisfies
Below we present the main convergence result of this section.
with probability at least . What is more, to guarantee (40) with probability at least Algorithm 2 requires
2 Strongly Convex Dual Functions and Restarts Technique
In this section we assume that primal functional is additionally -smooth. It implies that the dual function in (18) is additionally -strongly convex in where and is the minimal positive eigenvalue of .
From weak duality and (20) we get the key relation of this section (see also )
This inequality implies the following theorem.
Consider function and its dual function defined in (20) such that problems (17) and (18) have solutions. Assume that is such that and , where is some positive number and where is any minimizer of . Then for following relations hold:
Applying Cauchy-Schwarz inequality to (42) we get
The second part (43) immediately follows from and Demyanov-Danskin theorem which implies . ∎
That is why, in this section we mainly focus on the methods that provides optimal convergence rates for the gradient norm. In particular, we consider Recursive Regularization Meta-Algorithm from (see Algorithm 3) with AC-SA2 (see Algorithm 5) as a subroutine (i.e. RRMA-AC-SA2) which is based on AC-SA algorithm (see Algorithm 4) from . We notice that RRMA-AC-SA2 is applied for a regularized dual function
In this section we consider the same oracle as in Section 5, but we additionally assume that , i.e. stochastic first-order oracle is unbiased. To define batched version of the stochastic gradient we will use the following notation:
As before in the cases when the batch-size can be restored from the context, we will use simplified notation and .
In the AC-SA algorithm we use batched stochastic gradients of functions which are defined as follows:
The following theorem states the main result for RRMA-AC-SA2 that we need in the section.
Let be -smooth and -strongly convex function and for some . If the Algorithm 3 performs iterations in totalThe overall number of performed iterations during the calls of AC-SA2 equals . with batch size for all iterations, then it will provide such a point that
where is some positive constant and is a solution of the dual problem (18).
Let us show that w.l.o.g. we can assume in this section that function defined in (20) is -strongly convex everywhere with . In fact, from -smoothness of we have only that is -strongly convex in (see for the details). However, the structure of the considered here methods is such that all points generated by the RRMA-AC-SA2 and, in particular, AC-SA lie in .
We prove the statement of the theorem by induction. For the statement is trivial, since . Assume that for some and prove it for . Since is a convex set and is a convex combination of and we have . Next, the point also lies in since it is convex combination of the points lying in this set. Due to (44), (45) and (46) we have that . The first term lies in since and the second and the third terms also lie in since . Putting all together we get . Finally, lies in as a convex combination of points from this set. ∎
We prove this result by induction. For the statement is trivial since . Next, assume that and prove that . Our assumption implies that the assumptions from Theorem 5.4 and applying the result of the theorem we get that and from the method AC-SA2 applied to the also lie in . That is, the output of AC-SA2 applied for lies in . ∎
Now we are ready to present our approach which was sketched in of constructing an accelerated method for the strongly convex dual problem using restarts of RRMA-AC-SA2. To explain the main idea we start with the simplest case: , . It means that there is no stochasticity in the method and the bound (47) can be rewritten in the following form:
In the case when we need to modify this approach. The first ingredient to handle the stochasticity is large enough batch size for the -th restart: should be . However, in the stochastic case we do not have an access to the , so, such batch size is impractical. One possible way to fix this issue is to independently sample large enough number of stochastic gradients additionally, which is the second ingredient of our approach, in order to get good enough approximation of and use the norm of such an approximation which is close to the norm of the true gradient with big enough probability in order to estimate needed batch size for the optimization procedure. Using this, we can get the bound of the following form:
The third ingredient is the amplification trick: we run independent trajectories of RRMA-AC-SA2, get points and choose such among of them that is close enough to with high probability, i.e. with probability at least for fixed . We achieve it due to additional sampling of stochastic gradients at for each trajectory and choosing such corresponding to the smallest norm of the obtained batched stochastic gradient. By Markov’s inequality for all
That is, for we have that with probability at least
for fixed which means that
with probability at least . Therefore, after of such restarts our method provide the point such that with probability at least
The approach informally described above is stated as Algorithm 6.
Assume that is -strongly convex and -smooth. If Algorithm 6 is run with
for all where is such that , and , then with probability at least
and the total number of the oracle calls equals
Under assumptions of Theorem 5.6 we get that with probability at least
where the total number of the oracle calls is defined in (51).
Inequalities (50) and which follows from -strong convexity of imply that
Now we are ready to present convergence guarantees for the primal function and variables.
Let the assumptions of Theorem 5.6 hold. Assume that is -Lipschitz continuous on where
and . Then, with probability at least
where , and to achieve it we need the total number of oracle calls equals
3 Direct Acceleration for Strongly Convex Dual Function
We consider first the following minimization problem:
We use Stochastic Similar Triangles Method which is stated in this section as Algorithm 7 to solve problem (55). To define the iterate we use the following sequence of functions:
Assume that Algorithm 7 is run to solve problem (55) with being -strongly convex and -smooth. Then, for all we have
for all , where and are some non-negative constants and , for some , . Assume that for each vector is a function of , is a deterministic vector, , sequence of random vectors satisfy
hold for all simultaneously, where is some positive constant, ,
and
Assume that the function is -strongly convex and -smooth,
i.e. with positive constants , and . If additionally and where and Algorithm 7 is run for iterations, then with probability at least
and is some positive constant. In other words, to achieve with probability at least Algorithm 7 needs iterations and oracle calls where hides polylogarithmic factors depending on and .
Next, we apply the SSTM_sc for the problem (18) when the objective of the primal problem (17) is -smooth, -strongly convex and -Lipschitz continuous on some ball which will be specified next, i.e. we consider the same setup as in Section 5 but we additionally assume that the primal functional has -Lipschitz continuous gradient. As in Section 5 we also consider the case when the gradient of the dual functional is known only through biased stochastic estimators, see (32)–(39) and the paragraphs containing these formulas.
This theorem makes it possible to apply the result from Theorem 5.11 for SSTM_sc which is run on the problem (18).
Under assumptions of Theorem 5.11 we get that after iterations of Algorithm 7 which is run on the problem (18) with probability at least
where and the total number of oracles calls equals
If additionally , then with probability at least
Theorem 5.11 implies that with probability at least we have
Using this and -smoothness of we get that with probability
Since A\overset{\eqref{eq:A_k_lower_bound_str_cvx}}{\geq}\frac{1}{L_{\psi}}\left(1+\frac{1}{2}\sqrt{\frac{\mu_{\psi}}{L_{\psi}}}\right)^{2k}, it implies that after iterations of SSTM_sc we will get (65) with probability at least and the number of oracle calls will be
Next, from -strong convexity of we have that with probability at least
and from this we obtain that with probability at least
Let the assumptions of Theorem 5.11 hold. Assume that is -Lipschitz continuous on where
, and for some positive constant . Assume additionally that the last batch-size is slightly bigger than other batch-sizes, i.e.
Then, with probability at least
Applications to Decentralized Distributed Optimization
In this section we apply our results to the decentralized optimization problems. But let us consider first the centralized or parallel architecture. As we mentioned in the introduction, when the objective function is -smooth one can compute batches in parallel in order to accelerate the work of the method and (14)-(16) imply that
number of workers in such a parallel scheme gives the method with working time proportional to the number of iterations defined in (14). However, number of workers defined in (73) could be too big in order to use such an approach in practice. But still computing the batches in parallel even with much smaller number of workers could reduce the working time of the method if the communication is fast enough and it follows from (16).
Besides the computation of batches in parallel for the general type of problem (1)+(2), parallel optimization is often applied to the finite-sum minimization problems (1)+(3) or (1)+(6) that we rewrite here in the following form:
We notice that in this section is a number of workers and is known only for the -th worker. Consider the situation when workers are connected in a network and one can construct a spanning tree for this network. Assume that the diameter of the obtained graph equals , i.e. the height of the tree — maximal distance (in terms of connections) between the root and a leaf . If we run STM on such a spanning tree then we will get that the number of communication rounds will be times larger than number of iterations defined in (14).
For simplicity, we also call as a Laplacian matrix and it does not lead to misunderstanding since everywhere below we use instead of . The key observation here that computation of requires one round of communications when the -th worker sends to all its neighbours and receives for all such that , i.e. -th worker gets vectors from all its neighbours. Note, that is symmetric and positive semidefinite and, as a consequence, exists. Moreover, we can replace by in (77) and get the equivalent statement:
Using this we can rewrite the problem (74) in the following way:
with .
Now it should become clear why in Section 4 we paid most of our attention on number of calculations. In this particular scenario which can be computed via one round of communications of each node with its neighbours as it was mentioned earlier in this section. That is, for the primal approach we can simply use the results discussed in Section 4. For convenience, we summarize them in Tables 3 and 4 which are obtained via plugging the parameters that we obtained above in the bounds from Section 4. Note that the results presented in this match the lower bounds obtained in in terms of the number of communication rounds up to logarithmic factors and and there is a conjecture that these bounds are also optimal in terms of number of oracle calls per node for the class of methods that require optimal number of communication rounds. Recently, the very similar result about the optimal balance between number of oracle calls per node and number of communication round was proved for the case when the primal functional is convex and -smooth and deterministic first-order oracle is available .
where is the -th -dimensional block of . Note that
Consider the stochastic function which is defined implicitly as follows:
it is natural to define the stochastic gradient as follows:
with and . Using this, we define the stochastic gradient of as and, as a consequence, we get
with and .
Taking all of this into account we conclude that problem (82) is a special case of (18) with . To make the algorithms from Section 5 distributed we should change the variables in those methods via multiplying them by from the left , e.g. for the iterates of SPDSTM we will get
which means that it is needed to multiply lines 4-6 of Algorithm 2 by from the left. After such a change of variables all methods from Section 5 become suitable to run them in the distributed fashion. Besides that, it does not spoil the ability of recovering the primal variables since before the change of variables all of the methods mentioned in Section 5 used or where points were some dual iterates of those methods, so, after the change of variables we should use or respectively. Moreover, it is also possible to compute in the distributed fashion using consensus type algorithms: one communication step is needed to compute , then each worker computes locally and after that it is needed to run consensus algorithm. We summarize the results for this case in Tables 5 and 6. Note that the proposed bounds are optimal in terms of the number of communication rounds up to polylogarithmic factors . Note that the lower bounds from are presented for the convolution of two criteria: number of oracle calls per node and communication rounds. One can obtain lower bounds for the number of communication rounds itself using additional assumption that time needed for one communication is big enough and the term which corresponds to the number of oracle calls can be neglected. Regarding the number of oracle calls there is a conjecture that the bounds that we present in this paper are also optimal up to polylogarithmic factors for the class of methods that require optimal number of communication rounds.
Discussion
In this section we want to discuss some aspects of the proposed results that were not covered in the main part of this paper. First of all, we should say that in the smooth case for the primal approach our bounds for the number of communication steps coincides with the optimal bounds for the number of communication steps for parallel optimization if we substitute the diameter of the spanning tree in the bounds for parallel optimization by .
However, we want to discuss another interesting difference between parallel and decentralized optimization in terms of the complexity results which was noticed in . From the line of works it is known that for the problem (1)+(6) (here we use instead of and iterator instead of for consistency) with -smooth and -strongly convex for all the optimal number of oracle calls, i.e. calculations of of the stochastic gradients of with -subgaussian variance is
The bad news is that (88) does not work with full parallelization trick and the best possible way to parallelize it is described in . However, standard accelerated scheme using mini-batched versions of the stochastic gradients without variance-reduction technique and incremental oracles which gives the bound
for the number of oracle calls and it admits full parallelization. It means that in the parallel optimization setup when we have computational network with nodes and the spanning tree for it with diameter the number of oracle calls per node is
However, for the decentralized setup the second row of Table 4 states that the number of communication rounds is the same as in (91) up to substitution of by and the number of oracle calls per node is
which has times bigger statistical term under the maximum than in (90). What is more, recently it was shown that there exists such a decentralized distributed method that requires
stochastic gradient oracle calls per node , but it is not optimal in terms of the number of communications. Moreover, there is a hypothesis that in the smooth case the bounds from Tables 3 and 4 (rows 2 and 3) are optimal in terms of the number of oracle calls per node for the class of methods that require optimal number of communication rounds up to polylogarithmic factors.
The same claim but for Table 5 was also presented in as a hypothesis and in this paper we propose the same hypothesis for the result stated Table 6 up to polylogarithmic and additionally we hypothesise that the noise level that we obtained is also unimprovable up to polylogarithmic factors.
As it was mentioned in Section 4, the recurrence technique that we use in Sections E and 5 can be very useful in the generalization of the results for STM from Section 4 for the case when instead of only stochastic gradient (see inequalities (10)-(11)) is available, is -smooth and proximal step is computed in an inexact manner. It would be nice also to compare proposed methods for the case when with the results from . For the convex but non-strongly convex case one can also try to combine Nesterov’s smoothing technique with D-MASG from .
We emphasize that in our results we assume that each from (79) is -smooth and -strongly convex. When each is -smooth and -strongly convex, it means that in order to satisfy the assumption we use in our paper we need to choose and . This choice can lead to a very slow rate in some situations, e.g. the worst-case can be times larger than for as for the case when and where for all but is -smooth . It was shown that instead of worst-case and one can use and to be some weighted average of , but such techniques can spoil number of communication rounds needed to achieve desired accuracy.
It would be also interesting to generalize the proposed results for the case of more general stochastic gradients .
Application for Population Wasserstein Barycenter Calculation
In this section we consider the problem of calculation of population Wasserstein barycenter since this example hides different interesting details connected with the theory discussed in this paper. In our presentation of this example we rely mostly on the recent work .
Next, we consider the entropic OT problem (see )
For a given set of samples we introduce empirical barycenter as
We consider the problem (95) of finding population barycenter with some accuracy and discuss possible approaches to solve this problem in the following subsections.
However, before that, we need to mention some useful properties of . First of all, one can write explicitly the dual function of for a fixed (see ):
Using this representation one can deduce the following theorem.
We will also use another useful relation (see ):
where the gradient is taken w.r.t. the first argument.
2 SA Approach
Assume that one can obtain and use fresh samples in online regime. This approach is called Stochastic Approximation (SA). It implies that at each iteration one can draw a fresh sample and compute the gradient w.r.t. of function which is -strongly convex and -Lipschitz continuous with . Optimal methods for this case are based on iterations of the following form
for some and for all after calls of this oracle produces such a point that with probability at least the following inequalities hold:
and, as a consequence of -strong convexity of for all ,
with probability at least , R-SGD requires
under additional assumption that .
3 SAA Approach
Now let us assume that large enough collection of samples is available. Our goal is to find such that with high probability, i.e. -approximation of the population barycenter, via solving empirical barycenter problem (96). This approach is called Stochastic Average Approximation (SAA). Since is -strongly convex and -Lipschitz in with for all we can conclude that with probability
where we use that the diameter of is . Moreover, in it was shown that one can guarantee that with probability
Taking advantages of both inequalities we get that if
then with probability at least
Assuming that we have such that with probability at least the inequality
holds, we apply the union bound and get that with probability
It remains to describe the approach that finds such that satisfies (111) with probability at least . Recall that in this subsection we consider the following problem
For each summand in the sum above we have the explicit formula (98) for the dual function . Note that one can compute the gradient of via arithmetical operations. What is more, has a finite-sum structure, so, one can sample -th component of with probability and get stochastic gradient
which requires arithmetical operations to be computed.
where , this approach requires communication rounds and arithmetical operations per node to find gradients . If instead of full gradients workers use stochastic gradients defined in (113) and these stochastic gradients have light-tailed distribution, i.e. satisfy the condition (86) with parameter , then to guarantee (114) with probability the aforementioned approach needs the same number of communications rounds and arithmetical operations per node to find gradients . Using -strong convexity of for all and taking we get that our approach finds such a point that satisfies (110) with probability at least using
arithmetical operations per node to find gradients in the deterministic case and
arithmetical operations per node to find stochastic gradients in the stochastic case. However, the state-of-the-art theory of learning states (see (108)) that should so large that in the stochastic case the second term in the bound for arithmetical operations typically dominates the first term and the dimensional dependence reduction from in the deterministic case to in the stochastic case is typically negligible in comparison with how much is larger than . That is, our theory says that it is better to use full gradients in the particular example considered in this section (see also Section 7). Therefore, further in the section we will assume that , i.e. workers use full gradients of dual functions .
However, bounds (115)-(116) were obtained under very restrictive at the first sight assumption that we have workers and each worker stores only one measure which is unrealistic. One can relax this assumption in the following way. Assume that we have machines connected in a network with Laplacian matrix and -th machine stores measures for and . Next, for -th machine we introduce virtual workers also connected in some network that -th machine can emulate along with communication between virtual workers and for every virtual worker we arrange one measure, e.g. it can be implemented as an array-like data structure with some formal rules for exchanging the data between cells that emulates communications. We also assume that inside the machine we can set the preferable network for the virtual nodes in such a way that each machine emulates communication between virtual nodes and computations inside them fast enough. Let us denote the Laplacian matrix of the obtained network of virtual nodes as . Then, our approach finds such a point that satisfies (110) with probability at least using
time for arithmetical operations per machine to find gradients where is time needed for -th machine to emulate communication between corresponding virtual nodes at each iteration and is time required by -th machine to perform arithmetical operation for all corresponding virtual nodes in the gradients computation process at each iteration. For example, if we have only one machine and network of virtual nodes forms a complete graph than , but and can be large and to reduce the running time one should use more powerful machine. In contrast, if we have machines connected in a star-graph than and will be much smaller, but will be of order which is large. Therefore, it is very important to choose balanced architecture of the network at least for virtual nodes per machine if it is possible. This question requires a separate thorough study and lies out of scope of this paper.
4 SA vs SAA comparison
Recall that in SA approach we assume that it is possible to sample new measures in online regime which means that the computational process is performed on one machine, whereas in SAA approach we assume that large enough collection of measures is distributed among the network of machines that form some computational network. In practice measures from correspond to some images. As one can see from the complexity bounds, both SA and SAA approaches require large number of samples to learn the population barycenter defined in (95). If these samples are images, then they typically cannot be stored in RAM of one computer. Therefore, it is natural to use distributed systems to store the data.
Now let us compare complexity bounds for SA and SAA. We summarize them in Table 7.
When the communication is fast enough and is small we typically have that SAA approach significantly outperforms SA approach in terms of the complexity as well even for communication architectures with big . Therefore, for balanced architecture one can expect that SAA approach will outperform SA even more.
To conclude, we state that population barycenter computation is a natural example when it is typically much more preferable to use distributed algorithms with dual oracle instead of SA approach in terms of memory and complexity bounds.
Acknowledgments
We would like to thank F. Bach, P. Dvurechensky, M. Gürbüzbalaban, D. Kovalev, A. Nemirovski, A. Olshevsky, N. Srebro, A. Taylor and C. Uribe for useful discussions. The work of E. Gorbunov was supported by RFBR, project number 19-31-51001. The work of D. Dvinskikh was supported by Russian Science Foundation (project 18-71-10108). The work of A. Gasnikov was supported by RFBR, project number 19-31-51001.
Appendix A Basic Facts
In this section we enumerate for convenience basic facts that we use many times in our proofs.
Squared norm of the sum.
Appendix B Useful Facts about Duality
This section contains several useful results that we apply in our analysis.
Consider the function defined on a closed convex set and linear operator such that and its dual function defined as . Then
From Demyanov–Danskin theorem we have that which implies
Appendix C Auxiliary Results
In this section, we present the results from other papers that we rely on in our proofs.
where belongs to the filtration for all . Let . Then there exists an absolute constant such that for any fixed and with probability at least :
and let . Assume that the sequence satisfy “light-tail” assumption:
where are some positive numbers. Then for all
Appendix D Technical Results
For the sequence such that
Moreover, .
We prove (125) by induction. For equation (124) gives us . Next we assume that (125) holds for all and prove it for :
This quadratic inequality implies that .
Finally, the relation is proved in Lemma 1 from (see also ). ∎
For the sequence such that
If we solve quadratic equation , with respect to , we will get (127). Inequality (128) was established in Lemma 3 from and Lemma 4 from . It remains to prove (129). Since for all and we have
Let , where , be non-negative numbers such that
where is such positive number that , i.e. one can choose .
We prove (131) by induction. For the inequality trivially follows since . Next we assume that (131) holds for some and prove it for :
Let , where , be non-negative numbers such that
and . Then for all we have
We prove (133) by induction. For the inequality trivially follows. Next we assume that (133) holds for some and prove it for . From (132), , and we have
and where is such positive number that
i.e. one can choose .
since and . Note that we also have . Next we assume that (135) holds for some and prove it for :
That is, we proved the statement of the lemma for
w.r.t. one can show that the choice satisfies the assumption of the lemma on .
Appendix E Similar Triangles Method with Inexact Proximal Step
In this section we focus on the composite optimization problem. i.e. problems of the type
where is convex and -smooth and is convex and -smooth. Before we present our method, let us introduce new notation.
Note that -solution could be non-unique, but for our purposes in such cases it is enough to use any point from the set of -solutions. In the analysis we will need the following result.
Next, using this, Cauchy-Schwarz inequality and definition of we get
The main method of this section is stated as Algorithm 8.
In the STM_IPS we use functions which are defined for all as follows:
We start our analysis with the following lemma.
Assume that is convex and -smooth, is convex and -smooth and . Then after iterations of Algorithm 8 we have
where is the solution of (136) closest to the starting point , , , for and .
From -strong convexity of we have
Together with triangle inequality it implies that
Applying inequality above and (125) for the r.h.s. of (140) we obtain
and . Using this we get
One can check via direct calculations that
Combining previous three inequalities we obtain
Together with the previous inequality and , it implies
Rearranging the terms and using , we obtain
where we used that . Finally, convexity of and definition of , i.e. , implies
Applying this inequality for in a sequence we get
Below we state our main result of this section.
Let be convex and -smooth, be convex and -smooth and . Assume that for a given number of iterations the number satisfies with some positive constant . Then after iteration of Algorithm 8 we have
for . Since for each and we get the recurrence
Note that the r.h.s. of the previous inequality is non-decreasing function of . Let us define as the largest integer such that and . Then and, as a consequence,
Using Lemma D.4 we get that for all . We plug this inequality together with and in (147) and get
Under assumptions of Theorem E.4 we get that for an arbitrary after
iterations of Algorithm 8 we have . Moreover, we get that should satisfy
The first part of the corollary follows from (146) and Lemma D.1. Relation (150) follows from the definition of and . Indeed, since and we get that
Finally, we notice that one can set in Algorithm 8 in a different way in order to get the same convergence guarantees, e.g. one can use and the order of given by (150) will be the same. In this case inequalities (140) and (142) transform to
respectively, where . Then the remaining part of the proof remains the same and gives the same result up to small changes in the numerical constants.
Appendix F Missing Proofs from Section 4
where is an arbitrary solution of (17). Taking inequality into account we get the first part of (23). From Cauchy-Schwarz inequality we obtain
Together with (151) it gives us quadratic inequality on :
Therefore, should be less then the greatest root of the corresponding quadratic equation, i.e. .
F.2 Proof of Theorem 4.2
and using the similar steps as in the proof of inequality (141) we get
Combining previous two inequalities we conclude that
Appendix G Missing Lemmas and Proofs from Section 5.1
which proves the inequality (153). Applying -smoothness of we get
Combining these two inequalities we get (154). ∎
For each iteration of Algorithm 2 we have
The proof of this lemma follows a similar way as in the proof of Theorem 1 from . We can rewrite the update rule for in the equivalent way:
One can check via direct calculations that
Combining previous two inequalities we obtain
Together with previous inequality, it implies
Rearranging the terms and using , we obtain
and after summing these inequalities for we get
The following lemma plays the central role in our analysis and it serves as the key to prove that the iterates of SPDSTM lie in the ball of radius up to some polylogarithmic factor of .
Let the sequences of non-negative numbers , random non-negative variables and random vectors , satisfy inequality
for all , where and are some non-negative constants. Assume that for each vector is a function of , is a deterministic vector, , sequence of random vectors satisfy
, for some , , and sequence of random variables is such that with some positive deterministic constant and for all , , depends only on and also assume that . If additionally and , then with probability at least the inequalities
hold for all simultaneously, where is some positive constant, ,
and
We start with applying Cauchy-Schwarz inequality to the second and the third terms in the right-hand side of (160):
The idea of the proof is as following: estimate roughly, then apply Lemma C.2 in order to estimate second term in the last row of (160) and after that use the obtained recurrence to estimate right-hand side of (160).
Using Lemma C.3 we get that with probability at least
where in the last inequality we use . Using union bound and we get that with probability the inequality
holds for all simultaneously. Note that the last row in the previous inequality is non-decreasing function of . If we define as the largest integer such that and , we will get that and, as a consequence, with probability
Therefore, we have that with probability
for all . Unrolling the recurrence we get that with probability
for all . We emphasize that it is very rough estimate, but we show next that such a bound does not spoil the final result too much. It implies that with probability
due to Cauchy-Schwarz inequality and assumptions of the lemma. If we denote and apply Lemma C.2 with
and , we get that for all with probability
with some constant which does not depend on or . Using union bound we obtain that with probability
and it holds for all simultaneously. Note that with probability at least
for all simultaneously. Using union bound again we get that with probability the inequality
holds for all simultaneously.
Note that we also proved that (165) is in the same event together with (167) and holds with probability . Putting all together in (160), we get that with probability at least the inequality
holds for all simultaneously. For brevity, we introduce new notation: (neglecting constant factor). Using our assumption and definition we obtain that with probability at least the inequality
holds for all simultaneously. Next we apply Lemma D.3 with , , , and get that with probability at least inequality
holds for all simultaneously with
It implies that with probability at least the inequality
holds for all simultaneously. ∎
G.2 Proof of Theorem 5.1
For the convenience we put here the extended statement of the theorem.
Assume that is -strongly convex and . Let be a desired accuracy. Next, assume that is -Lipschitz continuous on the ball with
where is such that , are some positive numeric constants, ,
and
with probability at least . What is more, to guarantee (170) with probability at least Algorithm 2 requires
Next, we introduce the sequences and as
Using new notation we can rewrite (175) as
Using this and Lemma 2 from (see Lemma C.1 in the Section C) we get that
Putting all together in (179) and using (173) and line 2 from Algorithm 2 we get
Next we apply Lemma C.3 to the right-hand side of the previous inequality and get
In the above inequality we used the fact that . Putting all together and using union bound we get that with probability at least
Secondly, using the same trick as in the proof of Theorem 1 from we get that for arbitrary point
Using these relations in (184) we obtain that with probability at least
In order to bound the second term in the right-hand side of the previous inequality we use the definition of the norm we have
where we used equality (31). Putting all together we obtain that with probability at least
Lemma C.3 implies that for all
Using this inequality with and we get that with probability at least
It implies that with probability at least
and due to triangle inequality with probability
The next step is in applying Lipschitz continuity of on . Recall that
and due to Demyanov-Danskin theorem . Together with -smoothness of it implies that
From this and (177) we get that with probability at least the inequality
We notice that the last inequality lies in the same probability event when (177) holds.
lies in the event . From this we can obtain a lower bound for :
also lie in the event . It remains to use inequalities (189) and (194) to bound first and second terms in the right hand side of inequality (186) and obtain that with probability at least
Using this and weak duality , we obtain
holds together with (196) with probability at least . The total number of stochastic gradient oracle calls is , which gives the bound in the problem statement since . ∎
Appendix H Missing Proofs from Section 5.2
For simplicity we analyse only the first restart since the analysis of the later restarts is the same. We apply Theorem 5.3 with such that
together with simple inequality and get for all
By Markov’s inequality we have for each that for fixed with probability at most
Then, with probability at least
where is such that . From Lemma C.3 we have for all
Since we can take in the previous inequality and get that for all and fixed points with probability at least
Using union bound we get that with probability at least inequality
holds for all simultaneously with fixed points . Using union bound again we get that with probability at least for fixed
Using Lemma C.3 with and we get that with probability at least
Applying union bound again we get that with probability at least the following inequality holds:
Similarly, for all with probability at least
Using union bound we get that with probability at least the inequality
holds for all simultaneously. Finally, unrolling the recurrence an using our choice of we obtain that with probability at least
which concludes the proof. To get (51) we need to estimate using our choice of parameters stated in (49).
H.2 Proof of Corollary 5.8
Theorem 5.6, Corollary 5.7 and inequality imply that with probability at least
Applying Theorem 5.2 we get that with probability we also have
where . Next, we show that points and are close to each other with high probability for all and both lie in with high probability. Lemma C.3 states that
Taking and using we get that for all with probability at least
where we use . Using union bound we get that with probability at least the inequality
holds for all simultaneously and, in particular, we get that with probability at least
It implies that with probability at least
and due to triangle inequality with probability
Applying Demyanov-Danskin’s theorem, -smoothness of with and we obtain that with probability at least
That is, we proved that with probability at least points and lie in the ball . In this ball function is -Lipschitz continuous, therefore, with probability at least
Combining inequalities (206), (209) and (212) and using union bound we get that with probability at least
Finally, in order to get the bound for the total number of oracle calls from (54) we use (51) together with and (121).
Appendix I Missing Proofs from Section 5.3
Applying -strong convexity of and the relation
From -smoothness of we have
Next, Fenchel-Young inequality (see inequality (119)) implies that
Putting all together and rearranging the terms we get
I.2 Proof of Lemma 5.10
The idea behind the proof of this lemma is exactly the same as for Lemma G.3. We start with applying Cauchy-Schwarz inequality to the second and the third terms, i.e.
Using Lemma C.3 we get that with probability at least
Using union bound and we get that with probability inequalities
hold for all simultaneously. Therefore, with probability the inequality
holds for all simultaneously. Unrolling the recurrence we get that with probability
for all . We emphasize that it is very rough estimate, but as for the convex case we show next that such a bound does not spoil the final result too much. It implies that with probability
for all simultaneously. Moreover, since (217) holds we have in the same probability event that inequalities
due to Cauchy-Schwarz inequality and assumptions of the lemma. If we denote and apply Lemma C.2 with
and , we get that for all with probability
with some constant which does not depend on or . Using union bound we obtain that with probability
and it holds for all simultaneously. Note that , , and with probability at least
for all simultaneously. Using union bound again we get that with probability the inequality
holds for all simultaneously.
Note that we also proved that (216) is in the same event together with (220) and holds with probability . Putting all together in (59), we get that with probability at least the inequality
holds for all simultaneously. For brevity, we introduce new notation: (neglecting constant factor). Using our assumptions , , and definition we obtain that with probability at least the inequality
hold for all simultaneously with
It implies that with probability at least the inequality
holds for all simultaneously.
I.3 Proof of Theorem 5.11
for all . By definition of we get that
for all . Next, we introduce new notation
Taking and using , we get that with probability at least
From this and we obtain that with probability
Using union bound we get that with probability at least
oracle calls where hides polylogarithmic factors depending on and .
I.4 Proof of Corollary 5.14
Corollary 5.13 implies that with probability at least
and the total number of oracle calls to get this is of order (72). Together with Theorem 5.2 it gives us that with probability at least
Taking and using we get that with probability at least
It implies that with probability at least
and due to triangle inequality with probability
Applying Demyanov-Danskin theorem and -smoothness of with we obtain that with probability at least
Combining inequalities (232), (235) and (238) and using union bound we get that with probability at least
Finally, in order to get the bound for the total number of oracle calls from (72) we use (66) together with and (121).