Graph Oracle Models, Lower Bounds, and Gaps for Parallel Stochastic Optimization
Blake Woodworth, Jialei Wang, Adam Smith, Brendan McMahan, Nathan Srebro
Introduction
Recently, there has been great interest in stochastic optimization and learning algorithms that leverage parallelism, including e.g. delayed updates arising from pipelining and asynchronous concurrent processing, synchronous single-instruction-multiple-data parallelism, and parallelism across distant devices. With the abundance of parallelization settings and associated algorithms, it is important to precisely formulate the problem, which allows us to ask questions such as “is there a better method for this problem than what we have?” and “what is the best we could possibly expect?”
Oracle models have long been a useful framework for formalizing stochastic optimization and learning problems. In an oracle model, we place limits on the algorithm’s access to the optimization objective, but not what it may do with the information it receives. This allows us to obtain sharp lower bounds, which can be used to argue that an algorithm is optimal and to identify gaps between current algorithms and what might be possible. Finding such gaps can be very useful—for example, the gap between the first order optimization lower bound of Nemirovski et al. and the best known algorithms at the time inspired Nesterov’s accelerated gradient descent algorithm .
We propose an oracle framework for formalizing different parallel optimization problems. We specify the structure of parallel computation using an “oracle graph” which indicates how an algorithm accesses the oracle. Each node in the graph corresponds to a single stochastic oracle query, and that query (e.g. the point at which a gradient is calculated) must be computed using only oracle accesses in ancestors of the node. We generally think of each stochastic oracle access as being based on a single data sample, thus involving one or maybe a small number of vector operations.
In Section 3 we devise generic lower bounds for parallel optimization problems in terms of simple properties of the associated oracle graph, namely the length of the longest dependency chain and the total number of nodes. In Section 4 we study specific parallel optimization settings in which many algorithms have been proposed, formulate them as graph-based oracle parallel optimization problems, instantiate our lower bounds, and compare them with the performance guarantees of specific algorithms. We highlight gaps between the lower bound and the best known upper bound and also situations where we can devise an optimal algorithm that matches the lower bound, but where this is not the “natural” and typical algorithm used in this settings. The latter indicates either a gap in our understanding of the “natural” algorithm or a need to depart from it.
Previous work studied communication lower bounds for parallel convex optimization where there are machines each containing a local function (e.g. a collection of samples from a distribution). Each machine can perform computation on its own function, and then periodically every machine is allowed to transmit information to the others. In order to prove meaningful lower bounds based on the number of rounds of communication, it is necessary to prevent the machines from simply transmitting their local function to a central machine, or else any objective could be optimized in one round. There are two established ways of doing this. First, one can allow arbitrary computation on the local machines, but restrict the number of bits that can be transmitted in each round. There is work focusing on specific statistical estimation problems that establishes communication lower bounds via information-theoretic arguments . Alternatively, one can allow the machines to communicate real-valued vectors, but restrict the types of computation they are allowed to perform. For instance, Arjevani and Shamir present communication complexity lower bounds for algorithms which can only compute vectors that lie in a certain subspace, which includes e.g. linear combinations of gradients of their local function. Lee et al. assume a similar restriction, but allow the data defining the local functions to be allocated to the different machines in a strategic manner. Our framework applies to general stochastic optimization problems and does not impose any restrictions on what computation the algorithm may perform, and is thus a more direct generalization of the oracle model of optimization.
Recently, Duchi et al. considered first-order optimization in a special case of our proposed model (the “simple parallelism” graph of Section 4.2), but their bounds apply in a more limited parameter regime, see Section 3 for discussion.
The graph-based oracle model
We consider the following stochastic optimization problem
The prox oracle is quite powerful and provides global rather than local information about . In particular, querying the prox oracle with fully optimizes .
As stated, is an argument to the oracle, however there are two distinct cases. In the “fully stochastic” oracle setting, the algorithm receives an oracle answer corresponding to a random . We also consider a setting in which the algorithm is allowed to “actively query” the oracle. In this case, the algorithm may either sample or choose a desired and receive an oracle answer for that . Our lower bounds hold for either type of oracle. Most optimization algorithms only use the fully stochastic oracle, but some require more powerful active queries.
We capture the structure of a parallel optimization algorithm with a directed, acyclic oracle graph . Its depth, , is the length of the longest directed path, and the size, , is the number of nodes. Each node in the graph represents a single stochastic oracle access, and the edges in the graph indicate where the results of that oracle access may be used: only the oracle accesses from ancestors of each node are available when issuing a new query. These limitations might arise e.g. due to parallel computation delays or the expense of communicating between disparate machines.
Let be the set of possible oracle queries, with the exact form of queries (e.g., vs. ) depending on the context. Formally, a randomized optimization algorithm that accesses the stochastic oracle as prescribed by the graph is specified by associating with each node a query rule , plus a single output rule . We grant all of the nodes access to a source of shared randomness (e.g. an infinite stream of random bits). The mapping selects a query to make at node using the set of queries and oracle responses in ancestors of , namely
Similarly, the output rule maps from all of the queries and oracle responses to the algorithm’s output as . The essential question is: for a class of optimization problems specified by a dependency graph , a stochastic oracle , and a function class , what is the best possible guarantee on the expected suboptimality of an algorithm’s output, i.e.
Lower bounds
We now provide lower bounds for optimization problems and in terms of , , , and the depth and size of .
These are the tightest possible lower bounds in terms of just the depth and size of in the sense that for all there are graphs and associated algorithms which match the lower bound. Of course, for specific, mostly degenerate graphs they might not be tight. For instance, our lower bound for the graph consisting of a short sequential chain plus a very large number of disconnected nodes might be quite loose due to the artificial inflation of . Nevertheless, for many interesting graphs they are tight, as we shall see in Section 4.
Each lower bound has two components: an “optimization” term and a “statistical” term. The statistical term is well known, although we include a brief proof of this portion of the bound in Appendix D for completeness. The optimization term depends on the depth , and indicates, intuitively, the best suboptimality guarantee that can be achieved by an algorithm using unlimited parallelism but only rounds of communication. Arjevani and Shamir also obtain lower bounds in terms of rounds of communication, which are similar to how our lower bounds depend on depth. However they restricted the type of computations that are allowed to the algorithm to a specific class of operations, while we only limit the number of oracle queries and the dependency structure between them, but allow forming the queries in any arbitrary way.
Similar to Arjevani and Shamir , to establish the optimization term in the lower bounds, we construct functions that require multiple rounds of sequential oracle accesses to optimize. In the gradient oracle case, we use a single, deterministic function which resembles a standard construction for first order optimization lower bounds. For the prox case, we construct two functions inspired by previous lower bounds for round-based and finite sum optimization . In order to account for randomized algorithms that might leave the span of gradients or proxs returned by the oracle, we use a technique that was proposed by Woodworth and Srebro and refined by Carmon et al. . For our specific setting, we must slightly modify existing analysis, which is detailed in Appendix A.
A useful feature of our lower bounds is that they apply when both the Lipschitz constant and smoothness are bounded concurrently. Consequently, “non-smooth” in the subsequent discussion can be read as simply identifying the case where the term achieves the minimum as opposed to the term (even if ). This is particularly important when studying stochastic parallel optimization, since obtaining non-trivial guarantees in a purely stochastic setting requires some sort of control on the magnitude of the gradients (smoothness by itself is not sufficient), while obtaining parallelization speedups often requires smoothness, and so we would like to ask what is the best that can be done when both Lipschitz and smoothness are controlled. Interestingly, the dependence on both and in our bounds is tight, even when the other is constrained, which shows that the optimization term cannot be substantially reduced by using both conditions together.
This defines a distribution over ’s based on the randomness in the draw of , and we apply Yao’s minimax principle. In Appendix B, we prove Theorem 1 using this construction.
In the case of the prox oracle, we “straighten out” the smooth construction of Woodworth and Srebro . For fixed constants , we define the following Lipschitz and smooth scalar function :
For and orthonormal drawn uniformly at random, we define
Again, this defines a distribution over ’s based on the randomness in the draw of and we apply Yao’s minimax principle. In Appendix C, we prove Theorem 2 using this construction.
As mentioned above, Duchi et al. recently showed a lower bound for first- and zero-order stochastic optimization in the “simple parallelism” graph consisting of layers, each with nodes. Their bound [10, Thm 2] applies only when the dimension is constant, and . Our lower bound requires non-constant dimension, but applies in any range of . Furthermore, their proof techniques do not obviously extend to prox oracles.
Specific dependency graphs
2 Simple parallelism: the layer graph
3 Delayed updates
4 Intermittent communication
Active querying and SVRG
All methods discussed so far used fully stochastic oracles, requesting a gradient (or prox computation) with respect to an independently and randomly drawn . We now turn to methods that also make active queries, i.e. draw samples from and then repeatedly query the oracle, at different points , but on the same samples . Recall that all of our lower bounds are valid also in this setting.
With an active query gradient oracle, we can implement SVRG on an intermittent communication graph. More specifically, for an appropriate choice of and , we apply SVRG to the regularized empirical objective
These guarantees improve over sequential SGD (17) as soon as and , i.e. . This is a very wide regime: we require only a moderate number of machines, and the second condition will typically hold for a smooth loss. Intuitively, SVRG does roughly the same number (up to a factor of two) of sequential updates as in the sequential SGD approach but it uses better, variance reduced updates. The price we pay is in the smaller total sample size since we keep calling the oracle on the same samples. Nevertheless, since SVRG only needs to calculate the “batch” gradient a logarithmic number of times, this incurs only an additional logarithmic factor.
Comparing (18) and (21), we see that SVRG also improves over A-MB-SGD as soon as , that is if the number of points we are processing on each machine each round is slightly more then the total number of rounds, which is also a realistic scenario.
To summarize, the best known upper bound for optimizing with intermittent communication using a pure stochastic oracle is (20), which combines two different algorithms. However, with active oracle accesses, SVRG is also possible and the upper bound becomes:
Summary
Our main contributions in this paper are: (1) presenting a precise formal oracle framework for studying parallel stochastic optimization; (2) establishing tight oracle lower bounds in this framework that can then be easily applied to particular instances of parallel optimization; and (3) using the framework to study specific settings, obtaining optimality guarantees, understanding where additional assumptions would be needed to break barriers, and, perhaps most importantly, identifying gaps in our understanding that highlight possibilities for algorithmic improvement. Specifically,
For non-smooth objectives and a stochastic prox oracle, smoothing and acceleration can improve performance in the layer graph setting. It is not clear if there is a more direct algorithm with the same optimal performance, e.g. averaging the answers from the prox oracle.
In the delay graph setting, delayed update SGD’s guarantee is not optimal. We suggest an alternative optimal algorithm, but it would be interesting and beneficial to understand the true behavior of delayed update SGD and to improve it as necessary to attain optimality.
With intermittent communication, we show how different methods are better in different regimes, but even combining these methods does not match our lower bound. This raises the question of whether our lower bound is achievable. Are current methods optimal? Is the true optimal complexity somewhere in between? Even finding a single method that matches the current best performance in all regimes would be a significant advance here.
With intermittent communication, active queries allow us to obtain better performance in a certain regime. Can we match this performance using pure stochastic queries or is there a real gap between active and pure stochastic queries?
We would like to thank Ohad Shamir for helpful discussions. This work was partially funded by NSF-BSF award 1718970 (“Convex and Non-Convex Distributed Learning”) and a Google Research Award. BW is supported by the NSF Graduate Research Fellowship under award 1754881. AS was supported by NSF awards IIS-1447700 and AF-1763786, as well as a Sloan Foundation research award.
References
Appendix A Main lower bound lemma
This analysis closely follows that of previous work, specifically the proof of Theorem 1 in and the proof of Lemma 4 in . There are slight differences in the problem setup between this work and that of previous papers, thus we include the following analysis for completeness and to ensure that all of our results can be verified. We do not claim any significant technical novelty within this section.
Let , let be the projection operator onto the span of and let be the projection onto the orthogonal complement of the span of . As in , define
Finally, suppose that for each , is of the form:
First, we connect the events to a more immediately useful condition
[cf. Lemma 9 , Lemma 1 ] For any , , , , and , let then for each
The proof of Lemma 1 involves straightforward linear algebra, and we defer it to Appendix A.1. By Lemma 1, , therefore the property (24) is implied by
Now, we state the main result which allows us to prove our lower bounds:
[cf. Lemma 4 , Lemma 4 ] For any , , , and dimension
if the sets satisfy the property (25) then
The proof of Lemma 2 relies upon the following, whose proof we defer to Appendix A.1.
[cf. Lemma 11 , Lemma 3 ] Let be any rotation operator, , that preserves , that is for any . Then the following conditional densities are equal
This closely follows the proof of Lemma 4 and Lemma 4 , with small modifications to account for the different setting.
Set . Then by Lemma 1, since satisfy the property (25)
Conditioned on and , the set is fixed, as is the set and therefore , so the first term in the inner product is a fixed unit vector. By Lemma 3, the conditional density of is spherically symmetric within the span onto which projects. Therefore, is distributed uniformly on the unit sphere in , which has dimension at least .
where we used that . Finally, this holds for each , , and , so
Where we used that for (36). For (37), recall that we chose so . ∎
This closely follows the proof of Lemma 9 , with slight modification to account for the different problem setup.
For assume . For any and
First, we decomposed into its and components and applied the triangle inequality. Next we used that and that the orthogonal projection operator is self-adjoint. Finally, we used that the projection operator is non-expansive and the definition of .
Next, we prove by induction on that for all and , the event implies that . As a base case (), observe that, trivially, . For the inductive step, fix any and and suppose that for all and . Let project onto (this includes in contrast with ) and let project onto the orthogonal subspace. Since ,
is a (potentially over-complete) basis for . Using the triangle inequality and , we can therefore expand
We must now bound the second term of (44). Focusing on the inner product in the numerator for one particular :
First, we used that , then that . Next, we applied the definition of and the triangle inequality. To get (48) we use the Cauchy-Schwarz inequality on the first term, and the definition of for the second. Finally, we use the inductive hypothesis and that .
We have now upper bounded the inner products in the second term of (44), and it remains to lower bound the norm in the denominator. We can rewrite
Here we again used followed by an (over)expansion of . The remaining steps follow from the inductive hypothesis and fact that . Combining (56) with (50) and returning to (44), we have that
Therefore, for each and an upper bound . Returning now to (41), we have that for any , , and the event implies
where we used that ∎
This closely follows the proof of Lemma 11 .
First, we apply Bayes’ rule to each density and use the fact that :
Appendix B Proof of Theorem 1
Assume for now that , the lower bound can be established for other values of by scaling inputs to our construction. Let
The random draw of defines a distribution over functions . We will lower bound the expected suboptimality of any deterministic optimization algorithm’s output and apply Yao’s minimax principle at the end of the proof.
This function has the following properties:
Furthermore, optimizing is equivalent to “finding” the vectors . In particular, until a point that has a substantial inner product with all of is found, the algorithm will remain far from the minimum:
The function also has the property that if has a small inner product with , then the gradient oracle will reveal little information about when queried at :
In Appendix A, we studied the situation where orthonormal are chosen uniformly at random and a sequence of sets of vectors are generated as
Therefore, by Lemma 2, when the dimension
Therefore, by Yao’s minimax principle for any randomized algorithm
The statistical term follows from Lemma 10. ∎
For any (85) is less than (86), thus no can be in the in (84). Therefore, using only we can calculate
Appendix C Proof of Theorem 2
Without loss of generality, assume , the lower bound can be proven for other values of by scaling inputs to our construction by . Let
It is straightforward to confirm that is convex, -Lipschitz continuous, and -smooth. Let be the uniform distribution over . Let be a set of orthonormal vectors drawn uniformly at random and define
The random choice of determines a distribution over functions and . We will lower bound the expectation (over ) of the suboptimality of any deterministic algorithm’s output, and then apply Yao’s minimax principle.
First, we show that the functions and are convex, -Lipschitz, and -smooth:
For any , , and orthonormal , and with , , , and chosen as in (92), and are convex, -Lipschitz, and -smooth.
Next, we show that optimizing is equivalent to “finding” a large number of the vectors :
For any , , and orthonormal , and with , , , and chosen as in (92), for any such that for all
Next, we show that at any point such that for all , the function value, gradient, and prox of and at are calculable using only:
For any such that for all , and any the function values, gradients, and proxs , , , , , and are calculable using only.
In Appendix A, we studied the situation where orthonormal are chosen uniformly at random and a sequence of sets of vectors are generated as
Consider the dependency graph, and let be the set of queries made in vertices at depth 1 in the graph (i.e. they have no parents). Let be the set of queries made in vertices at depth 2 in the graph (i.e. their parents correspond to the queries in ). Continue in this way for each , and then let correpond to the output of the optimization algorithm, which for now is deterministic.
Suppose . Then for all of the queries and for all we have . Therefore, by Lemma 9 the function values, gradients, and proxs of and are calculable based only on the query points and . Therefore, all of the queries in are a deterministic function of only so satisfies the required decomposition property (98). Finally, the queries are required to be in the domain of , thus they will have norm bounded by .
with probability for every which includes , for , so by Lemma 8
so by Yao’s minimax principle, for any randomized algorithm
The statistical term follows from Lemma 10. ∎
The functions and are a sum of linear functions and , which is convex; therefore both are convex. Also, the scalar function is -Lipschitz, so
where we used that . Similarly,
Therefore, and are -Lipschitz. Furthermore, since is -smooth,
therefore, the maximum eigenvalue of and is at most . ∎
First, we upper bound . Recalling that , define
For this , and with our choice of parameters (92), , so that , thus
Since and , we conclude
Let . We will now lower bound
Introducing dual variables , solving (115) amounts to finding an and a set of non-negative s such that and such that for each . Let
Since for and it follows that . Furthermore, since for and , the gradient
Suppose that is a point such that for all , and . Therefore, for so
Thus both and can be calculated from only. Similarly, for so
Thus and can also be calculated from only.
Now, we consider the proxs at such a point . Let if is odd, and if is even. Let be the projection operator onto and let be the projection onto the orthogonal subspace, . Then, since , we can decompose the prox:
Where we used that for all , so setting achieves the minimum since every term in the expression is zero and function is non-negative. The vector is calculable from , and similarly the second term is a minimization depends only on . A nearly identical argument shows that has the same property. ∎
Appendix D Statistical term
For any , there exists a distribution , and an -Lipschitz, -smooth function defined on such that the output of any potentially randomized optimization algorithm which accesses a stochastic gradient or prox oracle at most times satisfies
Let and where and . Define as
Now consider any deterministic optimization algorithm which accesses the gradient or prox oracle times. Each gradient or prox oracle response can be simulated using a single , so the algorithm’s output is . Consider
Furthermore, the Bayes optimal estimate of is
This simply requires lower bounding the tail of the Binomial distribution. Using Theorem 2.1 in ,
where is the distribution function of the standard normal. Let , then and
Therefore, by Yao’s minimax principle, for any randomized algorithm
Appendix E Supplement to Section 4
Smoothed accelerated mini-batch SGD is the composition of two ingredients. First, we approximate the non-smooth with a smooth surrogate, and then perform accelerated mini-batch SGD on the surrogate . In particular, we use the -Moreau envelope of :
Since is -Lipschitz, has the following properties (Proposition 12.29 ):
for all
We use the prox oracle to execute A-MB-SGD on the -Lipschitz and -smooth , with updates
The A-MB-SGD algorithm will converge on at a rate (see )
Choosing the conclude
which matches the lower bound in Theorem 2.
E.2 Wait-and-collect accelerated mini-batch SGD
E.3 Analysis of technical results in Section 4.4
To apply SVRG method to solve stochastic convex optimization problems under intermittent synchronization graph. We adopt the approach by , first we sample instances and solve a regularized empirical risk minimization problem based on :
By standard estimation-optimization error decomposition (e.g. Section 4 in ), we have
given . Thus to implement SVRG successfully, we need to choose such that the following two conditions are satisfied:
Thus we know by choosing below will satisfy above condition:
substitute the scale of to (154) we get