Distributed Coordinate Descent Method for Learning with Big Data

Peter Richtárik, Martin Takáč

Introduction

Randomized coordinate descent methods (CDMs) are increasingly popular in many learning tasks, including boosting, large scale regression and training linear support vector machines. CDMs update a single randomly chosen coordinate at a time by moving in the direction of the negative partial derivative (for smooth losses). Methods of this type, in various settings, were studied by several authors, including Hsieh et al. (2008); Shalev-Shwartz & Tewari (2009); Nesterov (2012); Richtárik & Takáč (2012c); Necoara et al. (2012); Tappenden et al. (2013b); Shalev-Shwartz & Zhang (2013b); Lu & Xiao (2013).

It is clear that in order to utilize modern shared-memory parallel computers, more coordinates should be updated at each iteration. One way to approach this is via partitioning the coordinates into blocks, and operating on a single randomly chosen block at a time, utilizing parallel linear algebra libraries. This approach was pioneered by Nesterov (2012) for smooth losses, and was extended to regularized problems in (Richtárik & Takáč, 2012c). Another popular approach involves working with a random subset of coordinates (Bradley et al., 2011). These approaches can be combined, and theory was developed for methods that update a random subset of blocks of coordinates at a time Richtárik & Takáč (2012a); Fercoq & Richtárik (2013). Further recent works on parallel coordinate descent include (Richtárik & Takáč, 2012b; Mukherjee et al., 2013; Fercoq, 2013; Tappenden et al., 2013a; Shalev-Shwartz & Zhang, 2013a).

However, none of these methods are directly scalable to problems of sizes so large that a single computer is unable to store the data describing the instance, or is unable to do so efficiently (e.g., in memory). In a big data scenario of this type, it is imperative to split the data across several nodes (computers) of a cluster, and design efficient methods for this memory-distributed setting.

Hydra. In this work we design and analyze the first distributed coordinate descent method: Hydra: HYbriD cooRdinAte descent. The method is “hybrid” in the sense that it uses parallelism at two levels: i) across a number of nodes in a cluster and ii) utilizing the parallel processing power of individual nodesWe like to think of each node of the cluster as one of the many heads of the mythological Hydra..

Assume we have cc nodes (computers) available, each with parallel processing power. In Hydra, we initially partition the coordinates {1,2,,d}\{1,2,\dots,d\} into cc sets, P1,,Pc{\cal P}_{1},\dots,{\cal P}_{c}, and assign each set to a single computer. For simplicity, we assume that the partition is balanced: Pk=Pl|{\cal P}_{k}|=|{\cal P}_{l}| for all k,lk,l. Each computer owns the coordinates belonging to its partition for the duration of the iterative process. Also, these coordinates are stored locally. The data matrix describing the problem is partitioned in such a way that all data describing features belonging to Pl{\cal P}_{l} is stored at computer ll. Now, at each iteration, each computer, independently from the others, chooses a random subset of τ\tau coordinates from those they own, and computes and applies updates to these coordinates. Hence, once all computers are done, cτc\tau coordinates will have been updated. The resulting vector, stored as cc vectors of size s=d/cs=d/c each, in a distributed way, is the new iterate. This process is repeated until convergence. It is important that the computations are done locally on each node, with minimum communication overhead. We comment on this and further details in the text.

The main insight. We show that the parallelization potential of Hydra, that is, its ability to accelerate as τ\tau is increased, depends on two data-dependent quantities: i) the spectral norm of the data (σ\sigma) and ii) a partition-induced norm of the data (σ\sigma^{\prime}). The first quantity completely describes the behavior of the method in the c=1c=1 case. If σ\sigma is small, then utilization of more processors (i.e., increasing τ\tau) leads to nearly linear speedup. If σ\sigma is large, speedup may be negligible, or there may be no speedup whatsoever. Hence, the size of σ\sigma suggests whether it is worth to use more processors or not. The second quantity, σ\sigma^{\prime}, characterizes the effect of the initial partition on the algorithm, and as such is relevant in the c>1c>1 case. Partitions with small σ\sigma^{\prime} are preferable. For both of these quantities we derive easily computable and interpretable estimates (ω\omega for σ\sigma and ω\omega^{\prime} for σ\sigma^{\prime}), which may be used by practitioners to gauge, a-priori, whether their problem of interest is likely to be a good fit for Hydra or not. We show that for strongly convex losses, Hydra outputs an ϵ\epsilon-accurate solution with probability at least 1ρ1-\rho after dβcτμlog(1ϵρ)\tfrac{d\beta}{c\tau\mu}\log(\tfrac{1}{\epsilon\rho}) iterations (we ignore some small details here), where a single iteration corresponds to changing of τ\tau coordinates by each of the cc nodes; β\beta is a stepsize parameter and μ\mu is a strong convexity constant.

Outline. In Section 2 we describe the structure of the optimization problem we consider in this paper and state assumptions. We then proceed to Section 3, in which we describe the method. In Section 4 we prove bounds on the number of iterations sufficient for Hydra to find an approximate solution with arbitrarily high probability. A discussion of various aspects of our results, as well as a comparison with existing work, can be found in Section 5. Implementation details of our distributed communication protocol are laid out in Section 6. Finally, we comment on our computational experiments with a big data (3TB matrix) L1 regularized least-squares instance in Section 7.

The problem

We study the problem of minimizing regularized loss,

where ff is a smooth convex loss, and RR is a convex (and possibly nonsmooth) regularizer.

and write M=ATA\mathbf{M}=\mathbf{A}^{T}\mathbf{A}, where A\mathbf{A} is some nn-by-dd matrix.

Example. These assumptions are natural satisfied in many popular problems. A typical loss function has the form

Regularizer R𝑅R.

Example. The choice Ri(t)=0R_{i}(t)=0 for tt\in and Ri(t)=+R_{i}(t)=+\infty, otherwise, effectively models bound constraints, which are relevant for SVM dual. Other popular choices are R(x)=λx1R(x)=\lambda\|x\|_{1} (L1-regularizer) and R(x)=λ2x22R(x)=\tfrac{\lambda}{2}\|x\|_{2}^{2} (L2-regularizer).

Distributed coordinate descent

We consider a setup with cc computers (nods) and first partition the dd coordinates (features) into cc sets P1,,Pc{\cal P}_{1},\dots,{\cal P}_{c} of equal cardinality, s:=d/cs:=d/c, and assign set Pl{\cal P}_{l} to node ll. Hydra is described in Algorithm 1. Hydra’s convergence rate depends on the partition; we comment on this later in Sections 4 and 5. Here we simply assume that we work with a fixed partition. We now comment on the steps.

Step 3. At every iteration, each of the cc computers picks a random subset of τ\tau features from those that it owns, uniformly at random, independently of the choice of the other computers. Let S^l\hat{S}_{l} denote the set picked by node ll . More formally, we require that i) S^lPl\hat{S}_{l}\subseteq{\cal P}_{l}, ii) Prob(S^l=τ)=1\mathbf{Prob}(|\hat{S}_{l}|=\tau)=1, where 1τs1\leq\tau\leq s, and that iii) all subsets of Pl{\cal P}_{l} of cardinality τ\tau are chosen equally likely. In summary, at every iteration of the method, features belonging to the random set S^:=l=1cS^l\hat{S}:=\cup_{l=1}^{c}\hat{S}_{l} are updated. Note that S^\hat{S} has size cτc\tau, but that, as a sampling from the set {1,2,,d}\{1,2,\dots,d\}, it does not choose all cardinality cτc\tau subsets of {1,2,,d}\{1,2,\dots,d\} with equal probability. Hence, the analysis of parallel coordinate descent methods of Richtárik & Takáč (2012a) does not apply. We will say that S^\hat{S} is a τ\tau-distributed sampling with respect to the partition {P1,,Pc}\{{\cal P}_{1},\dots,{\cal P}_{c}\}.

Step 4. Once computer ll has chosen its set of τ\tau coordinates to work on in Step 3, it will in parallel compute (Step 5) and apply (Step 6) updates to them.

Step 5. This is a critical step where updates to coordinates iS^li\in\hat{S}_{l} are computed. By fi(x)f^{\prime}_{i}(x) we denote the ii-th partial derivative of ff at xx. Notice that the formula is very simple as it involves one dimensional optimization.

Closed-form formulas. Often, hkih_{k}^{i} can be computed in closed form. For Ri(t)=λitR_{i}(t)=\lambda_{i}|t| (weighted L1 regularizer), hkih_{k}^{i} is the point in the interval [λifi(xk)Miiβ,λifi(xk)Miiβ][\tfrac{-\lambda_{i}-f^{\prime}_{i}(x_{k})}{\mathbf{M}_{ii}\beta},\tfrac{\lambda_{i}-f^{\prime}_{i}(x_{k})}{\mathbf{M}_{ii}\beta}] which is closest to xki-x_{k}^{i}. If Ri(t)=λi2t2R_{i}(t)=\tfrac{\lambda_{i}}{2}t^{2} (weighted L2 regularizer), then hki=fi(xk)λiMiiβh_{k}^{i}=-\tfrac{f^{\prime}_{i}(x_{k})}{\lambda_{i}\mathbf{M}_{ii}\beta}.

Choice of β\beta. The choice of the step-size parameter β\beta is of paramount significance for the performance of the algorithm, as argued for different but related algorithms by Richtárik & Takáč (2012a); Takáč et al. (2013); Fercoq & Richtárik (2013). We will discuss this issue at length in Sections 4 and 5.

Implementation issues: Note that computer ll needs to know the partial derivatives of ff at xkx_{k} for coordinates iS^lPli\in\hat{S}_{l}\subseteq{\cal P}_{l}. However, xkx_{k}, as well as the data describing ff, is distributed among the cc computers. One thus needs to devise a fast and communication efficient way of computing these derivatives. This issue will be dealt with in Section 6.

Step 6. Here all the τ\tau updates computed in Step 5 are applied to the iterate. Note that the updates are local: computer ll only updates coordinates it owns, which are stored locally. Hence, this step is communication-free.

Step 7. Here we are just establishing a way of labeling iterates. That is, starting with xkx_{k}, all cc computers modify cτc\tau entries of xkx_{k} in total, in a distributed way, and the result is called xk+1x_{k+1}. Our method is therefore inherently synchronous. We do not allow, in our analysis, for the various computers to proceed until all computers have updated all coordinates. In practice, a carefully designed asynchronous implementation will be faster, and our experiments in Section 7 are done with such an implementation.

Convergence rate analysis

Here we define two quantities, σ\sigma^{\prime} and σ\sigma, which, as we shall see, play an important role in the computation of the stepsize parameter β\beta of Algorithm 1, and through it, in understanding its rate of convergence and potential for speedup by parallelization and distribution. As we shall see, these quantities might not be easily computable. We therefore also provide each with an easily computable and interpretable upper bound, ω\omega^{\prime} for σ\sigma^{\prime} and ω\omega for σ\sigma.

for each k,l{1,2,,c}k,l\in\{1,2,\dots,c\}. We now define

A useful consequence of (6) is the inequality

Let arla_{rl} be the rr-th row of Al\mathbf{A}_{l}, and define

where ω(r)\omega^{\prime}(r) is the number of matrices Al\mathbf{A}_{l} with a nonzero in row rr. Likewise, define

where ω(r)\omega(r) is the number of nonzeros in the rr-th row of A\mathbf{A}.

2 Choice of the stepsize parameter β𝛽\beta

We analyze Hydra with stepsize parameter ββ\beta\geq\beta^{*}, where

and s1=max(1,s1)s_{1}=\max(1,s-1). As we shall see in Theorem 5, fixing cc and τ\tau, the number of iterations needed by Hydra find a solution is proportional to β\beta. Hence, we would wish to use β\beta which is as small as possible, but not smaller than the safe choice β=β\beta=\beta^{*}, for which convergence is proved. In practice, β\beta can often be chosen smaller than β\beta^{*}, leading to larger steps and faster convergence. If the quantities σ\sigma and σ\sigma^{\prime} are hard to compute, then one can replace them by the easily computable upper bounds ω\omega and ω\omega^{\prime}, respectively. However, there are cases when σ\sigma can be efficiently approximated and is much smaller than ω\omega. In some ML datasets with A{0,1}n×d\mathbf{A}\in\{0,1\}^{n\times d}, σ\sigma is close to the average number of nonzeros in a row of A\mathbf{A}, which can be significantly smaller than the maximum, ω\omega. On the other hand, if σ\sigma is difficult to compute, ω\omega may provide a good proxy. Similar remarks apply to σ\sigma^{\prime}. In the τ2\tau\geq 2 case (which covers all interesting uses of Hydra), we may ignore β2\beta_{2}^{*} altogether, as implied by the following result.

If τ2\tau\geq 2, then β2β1\beta^{*}\leq 2\beta_{1}^{*}.

This eliminates the need to compute σ\sigma^{\prime}, at the expense of at most doubling β\beta, which translates into doubling the number of iterations.

3 Separable approximation

We first establish a useful identity for the expected value of a random quadratic form obtained by sampling the rows and columns of the underlying matrix via the distributed sampling S^\hat{S}. Note that the result is a direct generalization of Lemma 1 in (Takáč et al., 2013) to the c>1c>1 case.

where α1=1τ1s1\alpha_{1}=1-\tfrac{\tau-1}{s_{1}}, α2=τ1s1\alpha_{2}=\tfrac{\tau-1}{s_{1}}, α3=τsτ1s1\alpha_{3}=\tfrac{\tau}{s}-\tfrac{\tau-1}{s_{1}}.

We now use the above lemma to compute a separable quadratic upper bound on E[(hS^)TMhS^]\mathbf{E}[(h^{\hat{S}})^{T}\mathbf{M}h^{\hat{S}}].

For x:=(DM)1/2hx:=(D^{\mathbf{M}})^{1/2}h, we have (hS^)TMhS^=(xS^)TQxS^(h^{\hat{S}})^{T}\mathbf{M}h^{\hat{S}}=(x^{\hat{S}})^{T}\mathbf{Q}x^{\hat{S}}. Taking expectations on both sides, and applying Lemma 3, we see that E[(hS^)TMhS^]\mathbf{E}[(h^{\hat{S}})^{T}\mathbf{M}h^{\hat{S}}] is equal to (11) for G=Q\mathbf{G}=\mathbf{Q}. It remains to bound the three quadratics in (11). Since DQD^{\mathbf{Q}} is the identity matrix, xTDQx=hTDMhx^{T}D^{\mathbf{Q}}x=h^{T}D^{\mathbf{M}}h. In view of (7), the 2nd term is bounded as xTQxσxTx=σhTDMhx^{T}\mathbf{Q}x\leq\sigma x^{T}x=\sigma h^{T}D^{\mathbf{M}}h. The last term, xT(QBQ)x^{T}(\mathbf{Q}-B^{\mathbf{Q}}), is equal to

It only remains to plug in these three bounds into (11). ∎

Inequalities of type (12) were first proposed and studied by Richtárik & Takáč (2012a)—therein called Expected Separable Overapproximation (ESO)—and were shown to be important for the convergence of parallel coordinate descent methods. However, they studied a different class of loss functions ff (convex smooth and partially separable) and different types of random samplings S^\hat{S}, which did not allow them to propose an efficient distributed sampling protocol leading to a distributed algorithm. An ESO inequality was recently used by Takáč et al. (2013) to design a mini-batch stochastic dual coordinate ascent method (parallelizing the original SDCA methods of Hsieh et al. (2008)) and mini-batch stochastic subgradient descent method (Pegasos of Shalev-Shwartz et al. (2011)), and give bounds on how mini-batching leads to acceleration. While it was long observed that mini-batching often accelerates Pegasos in practice, it was only shown with the help of an ESO inequality that this is so also in theory. Recently, Fercoq & Richtárik (2013) have derived ESO inequalities for smooth approximations of nonsmooth loss functions and hence showed that parallel coordinate descent methods can accelerate on their serial counterparts on a class of structured nonsmooth convex losses. As a special case, they obtain a parallel randomized coordinate descent method for minimizing the logarithm of the exponential loss. Again, the class of losses considered in that paper, and the samplings S^\hat{S}, are different from ours. None of the above methods are distributed.

4 Fast rates for distributed learning with Hydra

where ϕ(x)\phi^{\prime}(x) is a subgradient (or gradient) for ϕ\phi at xx.

We now show that Hydra decreases strongly convex LL with an exponential rate in ϵ\epsilon.

where ββ\beta\geq\beta^{*} and β\beta^{*} is given by (10). If {xk}\{x_{k}\} are the random points generated by Hydra (Algorithm 1), then

To see this, substitute hhS^h\leftarrow h^{\hat{S}} into (2), take expectations on both sides and then use Lemma 4 together with the fact that for any vector aa, E[aThS^]=E[S^]d=τcsc=τs\mathbf{E}[a^{T}h^{\hat{S}}]=\tfrac{\mathbf{E}[|\hat{S}|]}{d}=\tfrac{\tau c}{sc}=\tfrac{\tau}{s}. The rest follows by following the steps in the proof in (Richtárik & Takáč, 2012a, Theorem 20). ∎

A similar result, albeit with the weaker rate O(sβτϵ)O(\tfrac{s\beta}{\tau\epsilon}), can be established in the case when neither ff nor RR are strongly convex. In big data setting, where parallelism and distribution is unavoidable, it is much more relevant to study the dependence of the rate on parameters such as τ\tau and cc. We shall do so in the next section.

Discussion

In this section we comment on several aspects of the rate captured in (13) and compare Hydra to selected methods.

Here we comment in detail on the influence of the various design parameters (cc = # computers, ss = # coordinates owned by each computer, and τ\tau = # coordinates updated by each computer in each iteration), instance-dependent parameters (σ,ω,μR,μf\sigma,\omega,\mu_{R},\mu_{f}), and parameters depending both on the instance and design (σ,ω\sigma^{\prime},\omega^{\prime}), on the stepsize parameter β\beta, and through it, on the convergence rate described in Theorem 5.

Notice that the size of μR>0\mu_{R}>0 mitigates the effect of a possibly large β\beta on the bound (13). Indeed, for large μR\mu_{R}, the factor (β+μR)/(μf+μR)(\beta+\mu_{R})/(\mu_{f}+\mu_{R}) approaches 1, and the bound (13) is dominated by the term dcτ\tfrac{d}{c\tau}, which means that Hydra enjoys linear speedup in cc and τ\tau. In the following comments we will assume that μR=0\mu_{R}=0, and focus on studying the dependence of the leading term dβcτd\tfrac{\beta}{c\tau} on various quantities, including τ,c,σ\tau,c,\sigma and σ\sigma^{\prime}.

Search for small but safe β𝛽\beta.

As shown by Takáč et al. (2013, Section 4.1), mini-batch SDCA might diverge in the setting with μf=0\mu_{f}=0 and R(x)0R(x)\equiv 0, even for a simple quadratic function with d=2d=2, provided that β=1\beta=1. Hence, small values of β\beta need to be avoided. However, in view of Theorem 5, it is good if β\beta is as small as possible. So, there is a need for a “safe” formula for a small β\beta. Our formula (10), β=β\beta=\beta^{*}, is serving that purpose. For a detailed introduction into the issues related to selecting a good β\beta for parallel coordinate descent methods, we refer the reader to the first 5 pages of (Fercoq & Richtárik, 2013).

If c=1c=1, then by Lemma 9, σ=c=1\sigma^{\prime}=c=1, and hence β2=0\beta^{*}_{2}=0. However, for c>1c>1 we may have β2>0\beta^{*}_{2}>0, which can hence be seen as a price we need to pay for using more nodes. The price depends on the way the data is partitioned to the nodes, as captured by σ\sigma^{\prime}. In favorable circumstances, σ1\sigma^{\prime}\approx 1 even if c>1c>1, leading to β20\beta_{2}^{*}\approx 0. However, in general we have the bound σcσd\sigma^{\prime}\geq\tfrac{c\sigma}{d}, which gets worse as cc increases and, in fact, σ\sigma^{\prime} can be as large as cc. Note also that ξ\xi is decreasing in τ\tau, and that ξ(s,s)=0\xi(s,s)=0. This means that by choosing τ=s\tau=s (which effectively removes randomization from Hydra), the effect of β2\beta^{*}_{2} is eliminated. This may not be always possible as often one needs to solve problems with ss vastly larger than the number of updates that can be performed on any given node in parallel. If τs\tau\ll s, the effect of β2\beta^{*}_{2} can be controlled, to a certain extent, by choosing a partition with small σ\sigma^{\prime}. Due to the way σ\sigma^{\prime} is defined, this may not be an easy task. However, it may be easier to find partitions that minimize ω\omega^{\prime}, which is often a good proxy for σ\sigma^{\prime}. Alternatively, we may ignore estimating σ\sigma^{\prime} altogether by setting β=2β1\beta=2\beta_{1}^{*}, as mentioned before, at the price of at most doubling the number of iterations.

Speedup by increasing τ𝜏\tau.

Let us fix cc and compare the quantities γτ:=βcτ\gamma_{\tau}:=\tfrac{\beta^{*}}{c\tau} for τ=1\tau=1 and τ=s\tau=s. We now show that γ1γs\gamma_{1}\geq\gamma_{s}, which means that if all coordinates are updated at every node, as opposed to one only, then Hydra run with β=β\beta=\beta^{*} will take fewer iterations. Comparing the 1st and 3rd row of Table 2, we see that γ1=s+σσ1σ\gamma_{1}=s+\sigma\tfrac{\sigma^{\prime}-1}{\sigma^{\prime}} and γs=σ\gamma_{s}=\sigma. By Lemma 1, γ1γs=sσσ0\gamma_{1}-\gamma_{s}=s-\tfrac{\sigma}{\sigma^{\prime}}\geq 0.

Price of distribution.

For illustration purposes, consider a problem with d=105d=10^{5} coordinates. In Figure 1(a) we depict the size of dβ1cτ\tfrac{d\beta_{1}^{*}}{c\tau} for c=1c=1 and several choices of τ\tau, as a function of σ\sigma. We see that Hydra works better for small values of σ\sigma and that with increasing σ\sigma, the benefit of using updating more coordinates diminishes. In Figure 1(a) we consider the same scenario, but with c=100c=100 and s=1000s=1000, and we plot d2β1cτ\tfrac{d2\beta_{1}^{*}}{c\tau} on the yy axis. Note that the red dotted line in both plots corresponds to a parallel update of 1600 coordinates. In (a) all are updated on a single node, whereas in (b) we have 100 nodes, each updating 16 coordinates at a time. Likewise, the dashed blue dashed and solid black lines are also comparable in both plots. Note that the setup with c=10c=10 has a slightly weaker performance, the lines are a bit lower. This is the price we pay for using cc nodes as opposed to a single node (obviously, we are ignoring communication cost here). However, in big data situations one simply has no other choice but to utilize more nodes.

2 Comparison with other methods

While we are not aware of any other distributed coordinate descent method, Hydra in the c=1c=1 case is closely related to several existing parallel coordinate descent methods.

The Shotgun algorithm (parallel coordinate descent) of Bradley et al. (2011) is similar to Hydra for c=1c=1. Some of the differences: Bradley et al. (2011) only consider RR equal to the L1L1 norm and their method works in dimension 2d2d instead of the native dimension dd. Shotgun was not analyzed for strongly convex ff, and convergence in expectation was established. Moreover, Bradley et al. (2011) analyze the step-size choice β=1\beta=1, fixed independently of the number of parallel updates τ\tau, and give results that hold only in a “small τ\tau” regime. In contrast, our analysis works for any choice of τ\tau.

Hydra vs PCDM.

For c=1c=1, Hydra reduces to the parallel coordinate descent method (PCDM) of Richtárik & Takáč (2012a), but with a better stepsize parameter β\beta. We were able to achieve smaller β\beta (and hence better rates) because we analyze a different and more specialized class of loss functions (those satisfying (2)). In comparison, Richtárik & Takáč (2012a) look at a general class of partially separable losses. Indeed, in the c=1c=1 case, our distributed sampling S^\hat{S} reduces to the sampling considered in (Richtárik & Takáč, 2012a) (τ\tau-nice sampling). Moreover, our formula for β\beta (see Table 2) is essentially identical to the formula for β\beta provided in (Richtárik & Takáč, 2012a, Theorem 14), with the exception that we have σ\sigma where they have ω\omega. By 9, we have σω\sigma\leq\omega, and hence our β\beta is smaller.

Hydra vs SPCDM.

SPCDM of Fercoq & Richtárik (2013) is PCDM applied to a smooth approximation of a nonsmooth convex loss; with a special choice of β\beta, similar to β1\beta_{1}. As such, it extends the reach of PCDM to a large class of nonsmooth losses, obtaining O(1ϵ2)O(\tfrac{1}{\epsilon^{2}}) rates.

Hydra vs mini-batch SDCA.

Takáč et al. (2013) studied the performance of a mini-batch stochastic dual coordinate ascent for SVM dual (“mini-batch SDCA”). This is a special case of our setup with c=1c=1, convex quadratic ff and Ri(t)=0R_{i}(t)=0 for tt\in and Ri(t)=+R_{i}(t)=+\infty otherwise. Our results can thus be seen as a generalization of the results in that paper to a larger class of loss functions ff, more general regularizers RR, and most importantly, to the distributed setting (c>1c>1). Also, we give O(log1ϵ)O(\log\tfrac{1}{\epsilon}) bounds under strong convexity, whereas (Takáč et al., 2013) give O(1ϵ)O(\tfrac{1}{\epsilon}) results without assuming strong convexity. However, Takáč et al. (2013) perform a primal-dual analysis, whereas we do not.

Distributed computation of the gradient

In this section we described some important elements of our distributed implementation.

Note that in Hydra, xkx_{k} is stored in a distributed way. That is, the values xkix_{k}^{i} for iPli\in{\cal P}_{l} are stored on computer ll. Moreover, Hydra partitions A\mathbf{A} columnwise as A=[A1,,Ac]\mathbf{A}=[\mathbf{A}_{1},\dots,\mathbf{A}_{c}], where Al\mathbf{A}_{l} consists of columns iPli\in{\cal P}_{l} of A\mathbf{A}, and stores Al\mathbf{A}_{l} on computer ll. So, A\mathbf{A} is chopped into smaller pieces with stored in a distributed way in fast memory (if possible) across the cc nodes. Note that this allows the method to work with large matrices.

If we write hki=0h_{k}^{i}=0 if ii is not updated in iteration kk, then

Note that the value δgk,l\delta g_{k,l} can be computed on node ll as all the required data is stored locally. Hence, we let each node compute δgk,l\delta g_{k,l}, and then use a reduce all operation to add up the updates to obtain gk+1g_{k+1}, and pass the sum to all nodes. Knowing gk+1g_{k+1}, node ll is then able to compute fi(xk+1)f^{\prime}_{i}(x_{k+1}) for any iPli\in{\cal P}_{l} as follows:

2 Advanced protocols

The basic protocol discussed above has obvious drawbacks. Here we identify them and propose modifications leading to better performance.

alternating Parallel and Serial regions (PS): The basic protocol alternates between two procedures: i) a computationally heavy one (done in parallel) with no MPI communication, and ii) MPI communication (serial). An easy fix would be to dedicate 1 thread to deal with communication and the remaining threads within the same computer for computation. We call this protocol Fully Parallel (FP). Figure 2 compares the basic (left) and FP (right) approaches.

Reduce All (RA): In general, reduce all operations may significantly degrade the performance of distributed algorithms. Communication taking place only between nodes close to each other in the network, e.g., nodes directly connected by a cable, is more efficient. Here we propose the Asynchronous StreamLined (ASL) communication protocol in which each node, in a given iteration, sends only 1 message (asynchronously) to a nearby computer, and also receives only one message (asynchronously) from another nearby computer. Communication hence takes place in an Asynchronous Ring. This communication protocol requires significant changes in the algorithm. Figure 3 illustrates the flow of messages at the end of the kk-th iteration for c=4c=4.

We order the nodes into a ring, denoting ll_{-} and l+l_{+} the two nodes neighboring node ll. Node ll only receives data from ll_{-}, and sends data to l+l_{+}. Let us denote by δGk,l\delta G_{k,l} the data sent by node ll to l+l_{+} at the end of iteration kk. When ll starts iteration kk, it already knows δGk1,l\delta G_{k-1,l_{-}}.Initially, we let δgk,l=δGk,l=0\delta g_{k,l}=\delta G_{k,l}=0 for all k0k\leq 0. Hence, data which will be sent at the end of the kk-th iteration by node ll is given by

ASL needs less communication per iteration. On the other hand, information is propagated more slowly to the nodes through the ring, which may adversely affect the number of iterations till convergence (note that we do not analyze Hydra with this communication protocol). Indeed, it takes c1c-1 iterations to propagate information to all nodes. Also, storage requirements have increased: at iteration kk we need to store the vectors δgt,l\delta g_{t,l} for kctkk-c\leq t\leq k on computer ll.

Experiments

As discussed in Section 6, the advantage of the RA protocol is the fact that Theorem 5 was proved in this setting, and hence can be used as a safe benchmark for comparison with the advanced protocols.

Table 4 compares the average time per iteration for the 3 approaches and 3 choices of τ\tau. We used 128128 nodes, each running 4 MPI processes (hence c=512c=512). Each MPI process runs 8 OpenMP threads, giving 4,096 cores in total. The data matrix A\mathbf{A} has n=109n=10^{9} rows and d=5×108d=5\times 10^{8} columns, and has 3 TB, double precision. One can observe that in all cases, ASL-FP yields largest gains compared to the benchmark RA-PS protocol. Note that ASL has some overhead in each iteration, and hence in cases when computation per node is small (τ=10\tau=10), the speedup is only 1.62. When τ=102\tau=10^{2} (in this case the durations of computation and communication were comparable), ASL-FP is 3.11 times faster than RA-PS. But the gain becomes again only moderate for τ=103\tau=10^{3}; this is because computation now takes much longer than communication, and hence the choice of strategy for updating the auxiliary vector gkg_{k} is less significant. Let us remark that the use of larger τ\tau requires larger β\beta, and hence possibly more iterations (in the worst case).

Huge LASSO problem.

We generated a sparse matrix A\mathbf{A} with block angular structure, depicted in (17).

Extensions

Our results can be extended to the setting where coordinates are replaced by blocks of coordinates, as in (Nesterov, 2012), and to partially separable losses, as in (Richtárik & Takáč, 2012a).

References

Appendix A Proof Lemma 1

The inequality ωc\omega^{\prime}\leq c is obviously true. By considering xx with zeroes in all coordinates except those that belong to Pk{\cal P}_{k} (where kk is an arbitrary but fixed index), we see that xTQx=xTBQxx^{T}\mathbf{Q}x=x^{T}B^{\mathbf{Q}}x, and hence σ1\sigma^{\prime}\geq 1.

Let Uk\mathbf{U}_{k} be a column submatrix of the dd-by-dd identity matrix corresponding to columns iPki\in{\cal P}_{k}. Clearly, Ak=AUk\mathbf{A}_{k}=\mathbf{A}\mathbf{U}_{k} and UkTQek\mathbf{U}_{k}^{T}\mathbf{Q}e_{k} is the kk-th diagonal block of Q\mathbf{Q}, i.e.,

This means that ϕ\phi^{\prime} is block Lipschitz (with blocks corresponding to variables in Pk{\cal P}_{k}), with respect to the norm (k)\|\cdot\|_{(k)}, with Lipschitz constant 11. Indeed, this is, in fact, satisfied with equality:

This is relevant because then, by Richtárik & Takáč (2012a, Theorem 7; see comment 2 following the theorem), it follows that ϕ\phi^{\prime} is Lipschitz with respect to w\|\cdot\|_{w}, where wk=1w_{k}=1 for all k=1,,ck=1,\dots,c, with Lipschitz constant ω\omega^{\prime} (ω\omega^{\prime} is the degree of partial block separability of ϕ\phi with respect to the blocks Pk{\cal P}_{k}). Hence,

which establishes the inequality σω\sigma^{\prime}\leq\omega^{\prime}.

We now show that σsσ\tfrac{\sigma}{s}\leq\sigma^{\prime}. If we let θ:=max{xTBQx:xTx1}\theta:=\max\{x^{T}B^{\mathbf{Q}}x:x^{T}x\leq 1\}, then xTBQxθxTxx^{T}B^{\mathbf{Q}}x\leq\theta x^{T}x and hence {x  :  xTx1}{x  :  xTBQxθ}\{x\;:\;x^{T}x\leq 1\}\subseteq\{x\;:\;x^{T}B^{\mathbf{Q}}x\leq\theta\}. This implies that

In the last step we have used the fact that σ(Q)=σc=dim(Q)\sigma(\mathbf{Q})=\sigma\leq c=\dim(\mathbf{Q}), proved in steps 1 and 2, applied to the setting QQkk\mathbf{Q}\leftarrow\mathbf{Q}^{kk}.

The chain of inequalities 1σωc1\leq\sigma\leq\omega\leq c is obtained as a special case of the chain 1σωd1\leq\sigma^{\prime}\leq\omega^{\prime}\leq d (proved above) when c=dc=d (and hence Pl={l}{\cal P}_{l}=\{l\} for l=1,,dl=1,\dots,d). Indeed, in this case BQ=DQB^{\mathbf{Q}}=D^{\mathbf{Q}}, and so xTBQx=xTDQx=xTxx^{T}B^{\mathbf{Q}}x=x^{T}D^{\mathbf{Q}}x=x^{T}x, which means that σ=σ\sigma^{\prime}=\sigma and ω=ω\omega^{\prime}=\omega.

Appendix B Proof of Lemma 2

It is enough to argue that β2β1\beta_{2}^{*}\leq\beta_{1}^{*}. Notice that β2\beta_{2}^{*} is increasing in σ\sigma^{\prime}. On the other hand, from Lemma 1 we know that σc=ds\sigma^{\prime}\leq c=\tfrac{d}{s}. So, it suffices to show that

After straightforward simplification we observe that this inequality is equivalent to (sτ)+(τ2)σ+σd(s+τ)0(s-\tau)+(\tau-2)\sigma+\tfrac{\sigma}{d}(s+\tau)\geq 0, which clearly holds.

Appendix C Proof of Lemma 3

In the s=1s=1 case the statement is trivially true. Indeed, we must have τ=1\tau=1 and thus Prob(S^={1,2,,d})=1\mathbf{Prob}(\hat{S}=\{1,2,\dots,d\})=1, hS^=hh^{\hat{S}}=h, and hence

This finishes the proof since τ1s1=0\tfrac{\tau-1}{s_{1}}=0.

Consider now the s>1s>1 case. From Lemma 3 in Richtárik & Takáč (2012a) we get

where pij=Prob(iS^  &  jS^)p_{ij}=\mathbf{Prob}(i\in\hat{S}\;\&\;j\in\hat{S}). One can easily verify that

In particular, the first case follows from Eq (32) and the second from Eq (37) in Richtárik & Takáč (2012a). It only remains to substitute pijp_{ij} into (22) and transform the result into the desired form.