Abstract
In distributed machine learning, where agents collaboratively learn from diverse private data sets, there is a fundamental tension between consensus and optimality. In this paper, we build on recent algorithmic progresses in distributed deep learning to explore various consensus-optimality trade-offs over a fixed communication topology. First, we propose the incremental consensus-based distributed stochastic gradient descent (i-CDSGD) algorithm, which involves multiple consensus steps (where each agent communicates information with its neighbors) within each SGD iteration. Second, we propose the generalized consensus-based distributed SGD (g-CDSGD) algorithm that enables us to navigate the full spectrum from complete consensus (all agents agree) to complete disagreement (each agent converges to individual model parameters). We analytically establish convergence of the proposed algorithms for strongly convex and nonconvex objective functions; we also analyze the momentum variants of the algorithms for the strongly convex case. We support our algorithms via numerical experiments, and demonstrate significant improvements over existing methods for collaborative deep learning.
1 Introduction
1.1 Motivation
Scaling up deep learning algorithms in a distributed setting (Recht et al., 2011; LeCun et al., 2015; Jin et al., 2016) is becoming increasingly critical, impacting several applications such as learning in robotic networks (Lenz et al., 2015; Fang et al., 2019), the Internet of Things (IoT) (Gubbi et al., 2013; Lane et al., 2015; Hu et al., 2020), mobile device networks (Lane and Georgiev, 2015; Kang et al., 2020), and sensor networks (Ge et al., 2019; He et al., 2020). For instance, with the development of wireless communication and distributed computing technologies, intelligent sensor network has been emerging as a kind of large-scale distributed network systems, which request more advanced sensor fusion techniques that enable data privacy preservation (Jiang et al., 2017a; He et al., 2019), dynamic optimization (Yang et al., 2016), and intelligent learning (Tan, 2020). This paper aims at developing novel algorithms to facilitate collaborative deep learning in distributed settings such as distributed sensor networks (Lesser et al., 2012). Several distributed deep learning approaches have been proposed to address issues such as model parallelism (Dean et al., 2012), data parallelism (Dean et al., 2012; Jiang et al., 2017a), and the role of communication and computation (Li et al., 2014; Das et al., 2016).
We focus on the constrained communication topology setting where the data is distributed (so that each agent has its own estimate of the deep model) and where information exchange among the learning agents are constrained along the edges of a given communication graph (Jiang et al., 2017a; Lian et al., 2017). In this context, two key aspects arise: consensus and optimality. We refer the reader to Figure 1 for an illustration involving three agents. With sufficient information exchange, the learned model parameters corresponding to each agent, could converge to , in which case they achieve consensus but not optimality (here, θ* is the optimal model estimate if all the data were centralized). On the other hand, if no communication happens, the agents may approach their individual model estimates () while being far from consensus. The question is whether this trade-off between consensus and optimality can be balanced so that all agents collectively agree upon a model estimate close to θ*.
FIGURE 1

A closer look at the optimization updates in distributed deep learning: Blue dots represent the current states (i.e., learned model parameters) of the agents; green dots represent the individual local optima (), that agents converge to without sufficient consensus; the purple dot (θ*) represents the ideal optimal point for the entire agent population; another purple dot represents a possible consensus point for the agents which is far from optimal; blue and red curves signify the convergence trajectories with different step sizes; the green dashed circles indicate the neighborhoods of θ* and , respectively; d2 represents the consensus bound/error and d1 represents the optimality bound/error; ideally, both of these bounds should be small.
1.2 Our Contributions
In this paper, we propose, analyze, and empirically evaluate two new algorithmic frameworks for distributed deep learning that enable us to explore fundamental trade-offs between consensus and optimality. The first approach is called
incremental consensus-based distributed stochastic gradient descent (i-CDSGD), which is a stochastic extension of the descent-style algorithm proposed in (
Berahas et al., 2018). This involves running multiple consensus steps where each agent exchanges information with its neighbors within each SGD iteration. The second approach is called
generalized consensus-based distributed SGD (g-CDSGD), based on the concept of generalized gossip (
Jiang et al., 2017b). This involves a tuning parameter that explicitly controls the trade-off between consensus and optimality. Specifically, we:
•(Algorithmic) propose the i-CDSGD and g-CDSGD algorithms (along with their momentum variants).
•(Theoretical) prove the convergence of g-CDSGD (Theorems 1 and 3) and i-CDSGD (Theorems 2 and 4) for strongly convex and non-convex objective functions;
•(Theoretical) prove the convergence of the momentum variants of g-CDSGD (Theorem 5) and i-CDSGD (Theorem 6) for strongly convex objective functions;
•(Practical) empirically demonstrate that i-CDMSGD (the momentum variant of i-CDSGD) can achieve similar (global) accuracy as the state-of-the-art with lower fluctuation across epochs as well as better consensus;
•(Practical) empirically demonstrate that g-CDMSGD (the momentum variant of g-CDSGD) can achieve similar (global) accuracy as the state-of-the-art with lower fluctuation, smaller generalization error and better consensus.
We use both balanced and unbalanced datasets (i.e., equal or unequal distributions of training samples among the agents) for the numerical experiments with benchmark deep learning data sets. Please see Table 1 for a detailed comparison with existing algorithms.
TABLE 1
| Method | F | Con.Bou | Opt.Bou | Con.Rate | Mom.Ana | CC.T. | Sto |
|---|---|---|---|---|---|---|---|
| FedAvg McMahan et al. (2016) | Nonconvex | N/A | N/A | N/A | No | No | Yes |
| DGDτBerahas et al. (2018) | Str-con | No | Yes | No | |||
| MSDA Scaman et al. (2017) | Str-con | N/A | N/A | Yes | Yes | No | |
| — | — | — | — | — | — | — | |
| — | — | — | — | — | — | — | |
| CDSGD Jiang et al. (2017a) | Str-con | No | Yes | Yes | |||
| Nonconvex | N/A | ||||||
| — | — | — | — | — | — | — | |
| — | — | — | — | — | — | — | |
| Acc-DNGD-SC Qu and Li (2017) | Str-con | N/A | Yes | Yes | No | ||
| — | — | — | — | — | — | — | |
| — | — | — | — | — | — | — | |
| i-CDSGD [This paper] | Str-con | Yes | Yes | Yes | |||
| Nonconvex | Theorem 4 | — | — | — | |||
| — | — | — | — | — | — | — | |
| — | — | — | — | — | — | — | |
| g-CDSGD [This paper] | Str-con | Yes | Yes | Yes | |||
| Nonconvex | Theorem 3 | — | — | — |
Comparisons between different optimization approaches.
Con.Bou.: consensus bound. Opt.Bou.: optimality bound. Con.Rate: convergence rate. Str-con: strongly convex. Mom.Ana.: momentum analysis. α: step size. λ2 ∈ (0, 1): the second largest eigen-value of a stochastic matrix. : positive constant. ω ∈ (0, 1]: a positive constant. ϵ ∈ (0, 1): a positive constant, and it signifies the representative meaning. They are not exactly the same in different methods. Sto.: stochastic. C.C.T.: constrained communication topology. c1, c2 > 0: condition numbers. H: strong convexity constant. γ > 0: smoothness constant. The optimality bounds for i-CDSGD and g-CDSGD with nonconvex functions refer to the constant error bounds in Theorems 4 and 3.
1.3 Related Work
A large literature has emerged that studies distributed deep learning in both centralized and decentralized settings (Dean et al., 2012; Zhang et al., 2015; Blot et al., 2016; Jin et al., 2016; McMahan et al., 2016; Xu et al., 2017; Zhang et al., 2017; Zheng et al., 2017; Esfandiari et al., 2021), and we only attempt to summarize the most recent work (Wangni et al., 2017). proposed a gradient sparsification approach for communication-efficient distributed learning, while (Wen et al., 2017) proposed the concept of ternary gradients to reduce communication costs (Scaman et al., 2017). proposed a multi-step dual accelerated method using a gossip protocol to provide an optimal decentralized optimization algorithm for smooth and strongly convex loss functions. Decentralized parallel stochastic gradient descent (Lian et al., 2017) has also been proposed. In (Duchi et al., 2012), the authors developed a distributed averaging method for convex (possibly nonsmooth) objective functions; additionally (Mokhtari and Ribeiro, 2016), proposed a decentralized double stochastic averaging gradient algorithm. However, non-convex functions were not taken into account in either of the above works. Dual approaches (Uribe et al., 2020; Dvinskikh et al., 2019) were also proposed to address the convergence issues in the distributed optimization over networks while extra parameters need to be updated for obtaining the optimal solutions, which in return could increase the difficulty of solving the problem and the computational complexity. Again, convex problems were the main focus that might not enable the proposed schemes to generalize well for non-convex problems. Another category of approaches, the primal-dual gradient algorithms developed in (Hong et al., 2018; Dvinskikh and Gasnikov, 2019) were not evaluated by real-world datasets and were only originally specific for homogeneous networks where data was assumed independently identically distributed (i.i.d.).
Perhaps most closely related to this paper is the work of (Berahas et al., 2018), who presented a distributed optimization method (called DGDτ) to enable consensus when the cost of communication is cheap. However, the authors only considered convex optimization problems, and only study deterministic gradient updates. Also (Qu and Li, 2017), proposed a class of (deterministic) accelerated distributed Nesterov gradient descent methods to achieve linear convergence rate, for the special case of strongly convex objective functions. In (Tsianos and Rabbat, 2012), both deterministic and stochastic distributed were discussed while the algorithm had no acceleration techniques. To our knowledge, none of these previous works have explicitly studied the trade-off between consensus and optimality. It should also be noted that the proposed approaches guarantee the convergence to the first-order stationary points for non-convex analysis and the avoidance of local maxima and saddle points is out of scope.
Outline: Section 2 presents the problem and several mathematical preliminaries. In Section 3, we present our two algorithmic frameworks, along with their analysis in Section 4. For validating the proposed schemes, several experimental results based on benchmark datasets are presented in Section 5. Concluding remarks are presented in Section 6.
2 Problem Formulation
We consider the standard unconstrained empirical risk minimization (ERM) problem typically used in machine learning problems (such as deep learning):where denotes the parameter vector of interest, denotes a given loss function, and fi is the function value corresponding to a data point i. Our focus is to investigate the case where the ERM problem is solved collaboratively among a number of computational agents. In this paper, we are interested in problems where the agents exhibit data parallelism, i.e., they only have access to their own respective training datasets. However, we assume that the agents can communicate over a static undirected graph , where is a vertex set (with nodes corresponding to agents) and is an edge set. Throughout this paper we assume that the graph is connected.
In this work, we primarily consider the spectrum between consensus and optimality and investigate thoroughly what effect such trade-offs have on the decentralized learning paradigm. Specifically, we analyze the theoretical properties of the proposed algorithms and show the empirical findings over benchmark datasets. However, in realistic scenarios, the graph may be subject to changes, such as the addition of new agents, and robust decentralized learning algorithms need to be developed for tackling such an issue, which is out of the scope and will definitely be one of our future research directions beyond this work.
Let denote the subset of the training data (comprising nj samples) corresponding to the jth agent such that , where N is the total number of agents. With this formulation, and since , we have the following (constrained) reformulation of Eq. 1:
Note that in this context, θj for all j = 1, 2, … , N is the local copy of θ, which means the model architecture for each agent is typically the same. In another line of works where agents own different models, personalized federated/decentralized learning (Fallah et al., 2020) or meta-learning approaches (Fallah et al., 2021) have been developed correspondingly. Equivalently, the concatenated form of the above equation is as follows:where , is the agent interaction matrix with its entries πjl indicating the link between agents j and l, Id is the identity matrix of dimension d × d, and ⊗ represents the Kronecker product. Each element value in Π signifies the connection probability between two agents such that πjl ∈ [0, 1]. One assumption is imposed for Π in the sequel to show the properties of any graph associated with the networked system.
We now introduce several key definitions and assumptions that characterize the above problem.
Definition 1.A functionis said to beH-strongly convex, if for all, we have. It is said to beγ-smooth if. Here, ‖ ⋅‖ represents the Euclidean norm.
Definition 2.A functioncis said to be coercive if it satisfies:c(x) → ∞ when ‖x‖ → ∞.
Assumption 1.The objective functionsare assumed to satisfy the following conditions: a) eachfjisγj-smooth; b) eachfjis proper (not everywhere infinite) and coercive; c) eachfjis Lipschitz continuous.
Assumption 2.The interaction matrix Π is normalized to be doubly stochastic; the second largest eigenvalue of Π is strictly less than 1, i.e.,λ2(Π)<1, whereλ2(Π) is the second largest eigenvalue of Π. If, thenπjl = 0.For convenience, we use λ2 to represent λ2(Π) and similar λN for λN(Π), which signifies the N-largest eigenvalue of Π.We will solve Eq. 2 in a distributed and stochastic manner.For solving stochastic optimization problems, variants of the well-known stochastic gradient descent (SGD) have been commonly employed. For the formulation in Eq. 2, one of the state-of-the-art algorithms is a method called consensus distributed SGD, or CDSGD, recently proposed in (Jiang et al., 2017a). This method estimates θ according to the update equation:where Nb(j) indicates the neighborhood of agent j, α is the step size, is the (stochastic) gradient of fj at , implemented by drawing a minibatch of sampled data points. More precisely, , where b′ is the size of the minibatch selected uniformly at random from the data subset available to Agent j.
3 Proposed Algorithms
State-of-the-art algorithms such as CDSGD alternate between the gradient update and consensus steps. We propose two natural extensions where one can control the emphasis on consensus relative to the gradient update and hence, leads to interesting trade-offs between consensus and optimality.
3.1 Increasing Consensus
Observe that the concatenated form of the CDSGD updates, Eq. 4, can be expressed as
If we perform τ consensus steps interlaced with each gradient update, we can obtain the following concatenated form of the iterations of the parameter estimates:where, . We call this variant incremental consensus-based distributed SGD (i-CDSGD) which is detailed in Algorithm 1. Note, in a distributed setting, that this algorithm incurs an additional factor τ in communication complexity.
In this context, i-CDSGD not only extends traditional decentralized (stochastic) gradient algorithms but also leverages the consensus among agents in a graph, particularly when agents are heterogeneous. Most traditional decentralized algorithms have been properly designed for homogeneous scenarios where agents share common properties such data sampling distributions and cannot be directly applied to heterogeneous networks as only one step of consensus may not be enough to enable agents to converge to the same solution due to the trade-off between the consensus-optimality. Therefore, the analysis presented in the paper for i-CDSGD provides a new perspective different from that most traditional decentralized algorithms delivered. A different and more direct approach to control the trade-off between consensus and gradient would be as follows:where, 0<ω ≤ 1 is a user-defined parameter. We call this algorithm generalized consensus-based distributed SGD (g-CDSGD), and the full procedure is detailed in Algorithm 3.
Algorithm 1
1: Initialization: , α, N, τ, m, Π
2: Distribute the training data set to N agents
3: foreach agentdo
4: andomly shuffle each data subset
5: fork = 0: mdo
6: t = 0
7: forj = 1, … , Ndo
8: {Initialization before incremental consensus}
9: end for
10: whilet ≤ τ − 1 do
11: forj = 1, … , Ndo
12: {Incremental consensus}
13: end for
14: t = t + 1
15: end while
16: {Update after incremental consensus}
17: {Update for iteration}
18: end for
19: end for
Algorithm 2
Algorithm 3
3.2 Tools for Convergence Analysis
We now analyze the convergence of the iterates generated by our algorithms. Specifically, we identify an appropriate Lyapunov function (that is bounded from below) for each algorithm that decreases with each iteration, thereby establishing convergence.
Algorithm 4
Assumption 3.a) There exist scalarsr2 ≥ r1>0 such thatandfor all; b) There exist scalarsB ≥ 0 andBV ≥ 0 such thatfor all.
Remark 1.Assumption 3(a) guarantees sufficient descent of V in the direction of ; Assumption 3(b) states that the variance of is bounded above by the second moment of ∇V(Θk). The constant B can be regarded to represent the second moment of noise involving in the gradient . Therefore, the second moment of can be bounded above aswhere . Note that this is slightly different from the conventional assumption in SGD analysis that the variance of stochastic gradients is bounded above by a single constant; in our context, we control the restriction of via two scalar constants. However, our analysis technique is otherwise similar.For convergence analysis, we assume:
Assumption 4.There exists a constantG>0 such that.We justify this assumption. As the Lyapunov function is a composite function with the true cost function which is Lipschitz continuous and the regularization term associated with consensus, it can be immediately obtained that ‖∇V(x)‖ is bounded above by some positive constant.Before turning to our main results, we present two auxiliary technical lemmas.
Lemma 1.Let Assumptions 1 and 2 hold. The iterates of g-CDSGD (Algorithm 3) satisfy the following inequality:
Lemma 2.Let Assumptions 1, 2, and 3 hold. The iterates of g-CDSGD (Algorithm 3) satisfy the following inequality:We provide the proof of Lemmas 1 and 2 in the Supplementary Section S1. To guarantee that the first term on the right hand side is strictly negative, the step size α should be chosen such that
4 Analysis and Main Results
This section presents the main results by analyzing the convergence properties of the proposed algorithms. Our main results are grouped as follows: 1) we provide rigorous convergence analysis for g-CDSGD and i-CDSGD for both strongly convex and non-convex objective functions. 2) we analyze their momentum variants only for strongly convex objective functions. It is noted that the proofs of theorems are provided in the main body while the proofs of lemmas and propositions are provided in the Supplementary Section S1.
4.1 Convergence Analysis for I-CDSGD and G-CDSGD
Our analysis will consist of two components: establishing an upper bound on how far away the estimates of the individual agents are with respect to their empirical mean (which we call the consensus bound), and establishing an upper bound on how far away the overall procedure is with respect to the optimum (which we call the optimality bound).
First, we obtain consensus bounds for the g-CDSGD and i-CDSGD as follows.
Proposition 1.(Consensus with fixed step size, g-CDSGD) Let Assumptions 1, 2, 4 hold. The iterates of g-CDSGD (Algorithm 3) satisfy the following inequality, whenαsatisfiesEq. 15,where,is the second-largest eigenvalue of the matrixQ = (1 − ω)P + ωINd.
Proposition 2.(Consensus with fixed step size, i-CDSGD) Let Assumptions 1, 2, 4 hold. The iterates of i-CDSGD (Algorithm 1) satisfy the following inequality, whenαsatisfies,We provide a discussion on comparing the consensus bounds in the Supplementary Section S1. Next, we obtain optimality bounds for g-CDSGD and i-CDSGD.
(Convergence of g-CDSGD in strongly convex case) Let Assumptions 1, 2, and 3 hold. When the step size satisfies Eq. 15, the iterates of g-CDSGD (Algorithm 3) satisfy the following inequality :where.
P
ROOF
. Recalling Lemma 2 and using Definition 1 yield:The second inequality follows from that , which is implied by Eq. 15. The expectation taken in the above inequalities is only related to θk+1. Hence, recursively taking the expectation and subtracting V* from both sides, we get:As , the conclusion follows by applying Eq. 1 recursively through iteration and letting .(Convergence of i-CDSGD in strongly convex case) Let Assumptions 1, 2, and 3 hold. When the step size satisfies , the iterates of i-CDSGD (Algorithm 1) satisfy the following inequality :whereDk = V (Θk) − V*,,.
P
ROOF
. We omit the proof here and one can easily get it following the proof techniques shown for Theorem 1. The desired result is obtained by replacing C1 with C3 and C2 with C4, respectively.Although we show the convergence for strongly convex objectives, we note that objective functions are highly non-convex for most deep learning applications. While convergence to a global minimum in such cases is extremely difficult to establish, we prove that g-CDSGD and i-CDSGD still exhibits weaker (but meaningful) notions of convergence.(Convergence to the first-order stationary point for non-convex case of g-CDSGD) Let Assumptions 1, 2, and 3 hold. When the step size satisfiesEq. 15, the iterates of g-CDSGD (Algorithm 3) satisfy the following inequality:
P
ROOF
. Recalling Lemma 2 and taking expectations on both sides lead to the following relation:If the step size is such that , we get:Applying the above inequality from 1 to K and summing them up can give the following relationThe last inequality follows from the Assumption 3. Rearrangement of the above inequality, substituting , and dividing by K yields the desired result.(Convergence to the first-order stationary point for non-convex case of i-CDSGD) Let Assumptions 1, 2, and 3 hold. When the step size satisfies, the iterates of i-CDSGD (Algorithm 1) satisfy the following inequality:
P
ROOF
. The proof for this theorem is rather similar to the one provided for Theorem 3 above, and we omit the details. □Remark 2. In the literature, to eliminate the negative effect of “noise” caused by the stochastic gradients, a diminishing step size is used. However, in our context, we observe from Theorems 1 and 2 that a constant step size itself can result in convergence, up to a neighborhood, of the local minimum. In fact, using a constant step size can lead to a linear convergence rate instead of a sub-linear convergence rate. To summarize, one can speed up the convergence rate at the cost of solution accuracy, which has also been reported in the recent work Pu and Nedić (2018).In our context, we have shown the convergence of the function value sequence {V (Θk)} to a neighborhood of V*. As , then we have . Since , which leads to that . It can be obtained that . Then using Theorems 1 and 2 can establish analogous convergence rate for the true value function sequence .
Remark 3. Let us discuss the rates of convergence suggested by Theorems 1 and 3. We observe that when the objective function is strongly convex, the function value sequence {V(Θk)} can linearly converge to within a fixed radius of convergence, which can be calculated as follows:When the objective function is non-convex, we cannot claim linear convergence. However, Theorem 3 asserts that the average of the second moment of the Lyapunov gradient is bounded from above. Recall that the parameter B bounds the variance of the “noise” due to the stochasticity of the gradient, and if B = 0, Theorem 3 implies that {Θk} asymptotically converges to a first-order stationary point.
Remark 4.For g-CDSGD, let us investigate the corner cases where ω → 0 or ω → 1. For the strongly convex case, when ω → 1, we have , where is the condition number. This suggests that if consensus is not a concern, then each iterate converges to its own respective , as depicted in Figure 1. On the other hand, when ω → 0, the upper bound converges to . In such a scenario, each agent sufficiently communicates its own information with other agents to arrive at an agreement. In this case, the upper bound depends on the topology of the communication network. If λN ≈ 0, this results in:For the non-convex case, when ω → 1, the upper bound suggested by Theorem 3 is , while ω → 0 leads to , which is roughly if λN ≈ 0.We also compare i-CDSGD and CDSGD with g-CDSGD in terms of the optimality upper bounds to arrive at a suitable lower bound for ω. However, due to the space limit, the analysis is presented in the Supplementary Section S1.
4.2 Convergence Analysis for Momentum Variants
We next provide a convergence analysis for the g-CDMSGD algorithm, summarized in the update laws given in Eq. 12. A similar analysis can be applied to i-CDMSGD. The proof techniques are developed on top of the estimate sequence method that has been applied to the centralized version (Nesterov, 2013). In the following analysis, we focus on the basic variant where . Before stating the main result, we define the sequence ϕk(Θ), k = 1, 2, … as:where represents the average of the objective function values of a mini-batch. We define as follows
Further, from Assumption 3, we see that . Combining Assumption 4 and , we have .
We now state our main result, which characterizes the performance of g-CDMSGD. To our knowledge, this is the first theoretical result for momentum-based versions of consensus-distributed SGD.
(Convergence of g-CDMSGD, strongly convex case) Let Assumptions 1, 2, 3, and 4 hold. If the step size satisfies, we have:
Proof
. From Lemma 5 in Supplementary Section S1., it can be obtained thatThe last inequality follows from that the coefficient . Recalling Eq. S20 of Lemma 5 in Supplementary Section S1 and letting Θ = Θ*, and combining Eq. 29, we haveAs , therefore, the following inequality can be acquiredUsing completes the proof.(Convergence of i-CDMSGD, strongly convex case) Let Assumptions 1, 2, 3, and 4 hold. If the step size satisfies, we have:
Note, although the theorem statements look the same for g-CDMSGD and i-CDMSGD, the constants are significantly different from each other. Theorem 5 suggests that with a sufficiently small step size, using Nesterov acceleration results in a linear convergence (with parameter ) up to a neighborhood of V* of radius . When k → ∞, the first term on the right hand side vanishes and substituting into , we havewhich implies that the upper bound is related to the spectral gap 1 − λ2 of the network; hence, a similar conclusion as Theorem 1 can be deduced. When ω → 0, the upper bound becomes . However, ω → 1 leads to . These two scenarios demonstrates that the “gradient noise” cased by the stochastic sampling negatively affects the convergence. One can use ω to trade-off the consensus and optimality updates. Evidently, when compared with the non-momentum version, the upper bound is looser due to the BVG2 even when B = 0. However, it should be noted that B+ BVG2 represents the upper bound of variance of . The analysis below shows the faster convergence rate with the cost solution accuracy.
Next, we discuss the upper bounds obtained when k → ∞ for g-CDSGD and g-CDMSGD. 1) ω → 0: When BV is sufficiently small and , it can be observed that the optimality bound for the Nesterov momentum variant is smaller than that for g-CDSGD as ; 2) ω → 1: When γm and r1 are carefully selected such that , we have when . Therefore, introducing the momentum can speed up the convergence rate with appropriately chosen hyperparameters.
5 Experimental Results
We validate our algorithms with several experimental results using the CIFAR-10 image recognition dataset (with standard training and testing sets). We have performed the experiments with different network architectures and hyperparameters. Out of several offline hyperparameters chosen, for brevity, we present results obtained with the LeNet architecture (LeCun et al., 1998). However, we note that, the behavior for other networks remain the same. Please see Supplement for results on other hyperparameters. The LeNet architecture is a convolutional neural network (CNN) (with ReLU activations) which includes 2 convolutional layers with 32 filters each followed by a max pooling layer, then 2 more convolutional layers with 64 filters each followed by another max pooling layer, and a dense layer with 512 units. The mini-batch size is set to 512, and step size is set to 0.01 in all experiments. All experiments were performed using Keras with TensorFlow (Chollet, 2015; Abadi et al., 2016). We use a sparse network topology with five agents. We use both balanced and unbalanced data sets for our experiments. In the balanced case, agents have an equal share of the entire training set. However, in the unbalanced case, agents have (randomly selected) unequal parts of the training set while making sure that each agent has at least half of the equal share amount of examples. We summarize our key experimental results in this section, with more details and results provided in the Supplementary Section 2.
Performance of algorithms. In Figure 2, we compare the performance of the momentum variants of our proposed algorithms, i-CDMSGD and g-CDMSGD (with ω = 0.1) with state-of-the art techniques such as CDMSGD and Federated Averaging using an unbalanced data set. All algorithms were run for 3,000 epochs. Observing the average accuracy over all the agents for both training and test data, we note that i-CDMSGD can converge as fast as CDMSGD with lesser fluctuation in the performance across epochs. While being slower in convergence, g-CDMSGD achieves similar performance (with test data) with less fluctuation as well as smaller generalization gap (i.e., difference between training and testing accuracy). All algorithms significantly outperform Federated Averaging in terms of average accuracy. We also vary the tuning parameter ω for g-CDMSGD to show (in Figure 3) that it is able to achieve similar (or better) convergence rate as CDMSGD using higher ω values with some sacrifice in terms of the generalization gap.
FIGURE 2

Performance of different algorithms with unbalanced sample distribution among agents (Dashed lines represent test accuracy and solid lines represent training accuracy.)
FIGURE 3

Performance of g-CDMSGD for different ω values (Dashed lines represent test accuracy and solid lines represent training accuracy.)
Degree of Consensus. One of the main contribution of our paper is to show that one can control the degree of consensus while maintaining average accuracy in distributed deep learning. We demonstrate this by observing the accuracy difference between the best and the worst performing agents (identified by computing the mean accuracy for the last 100 epochs). As shown in Figure 4, the degree of consensus is similar for all three algorithms for balanced data set, with i-CDMSGD performing slightly better than the rest. However, for an unbalanced set, both i-CDMSGD and g-CDMSGD perform significantly better compared to CDMSGD. Note, the degree of consensus can be further improved for g-CDMSGD using lower values of ω as shown in Figure 5. However, the convergence becomes relatively slower as shown in Figure 3. We do not compare these results with the Federated Averaging algorithm as it performs a brute force consensus at every epoch using centralized parameter server. In Figure 6, we show the performance of i-CDMSGD with different τ values. We observe that while there is better performance by increasing the value of τ, we see that the performance degrades after a while and then quickly stabilizes to similar performance. This is because the doubly stochastic agent interaction matrix for the small agent population becomes stationary very quickly with a very small value of τ. However, this will be explored in our future work with significantly bigger networks.
FIGURE 4

The accuracy percentage difference between the best and the worst agents for different algorithms with unbalanced and balanced sample distribution among agents.
FIGURE 5

The accuracy percentage difference between the best and the worst agents with balanced sample distribution for CDMSGD, i-CDMSGD and g-CDMSGD (varying ω.).
FIGURE 6

Performance of i-CDMSGD for different τ values (Dash lines represent test accuracy and solid lines represent training accuracy).
Finally, we also compare our proposed algorithms to CDMSGD on another benchmark dataset—MNIST. The performance of the algorithms is shown in Figure 7 which follows similar trend as observed for CIFAR-10.
FIGURE 7

Performance of different algorithms with a balanced data distribution on MNIST dataset.
6 Conclusion and Future Work
For investigating the trade-off between consensus and optimality in distributed deep learning with constrained communication topology, this paper presents two new algorithms, called i-CDSGD and g-CDSGD and their momentum variants. We show the convergence properties for the proposed algorithms and the relationships between the hyperparameters and the consensus and optimality bounds. Theoretical and experimental comparison with the state-of-the-art algorithm called CDSGD, shows that i-CDSGD, and g-CDSGD can improve the degree of consensus among the agents while maintaining the average accuracy especially when there is data imbalance among the agents. Future research directions include learning with non-uniform data distributions among agents and time-varying networks.
Statements
Data availability statement
Publicly available datasets were analyzed in this study. This data can be found here MNIST: http://yann.lecun.com/exdb/mnist/, CIFAR: https://www.cs.toronto.edu/∼kriz/cifar.html.
Author contributions
ZJ: Writing the whole paper, give the analytical results, and help implement the experiments AB: Help write the paper, mainly implement the experiments and present the numerical results, help finalize the paper CH: Check the writing, analytical and experimental results, and help finalize the paper SS: Check the writing, analytical and experimental results, and help finalize the paper.
Funding
The funder information is: National Science Foundation grant CNS-1954556; National Science Foundation under the CAREER grant CNS-1845969; National Science Foundation under the CAREER grant CCF-1750920/2005804.
Conflict of interest
The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors, and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
Supplementary material
The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/frai.2021.573731/full#supplementary-material
Footnotes
1.^As our proposed algorithm is a distributed variant of SGD, the noise in the performance is caused by the random sampling Song et al. (2015).
References
1
AbadiM.BarhamP.ChenJ.ChenZ.DavisA.DeanJ.et al (2016). “Tensorflow: A System for Large-Scale Machine Learning,” in Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI-16), Savannah, GA, November 2–4, 2016, 265–283.
2
BerahasA. S.BollapragadaR.KeskarN. S.WeiE. (2018). Balancing communication and computation in distributed optimization. IEEE Transactions on Automatic Control64(8), 3141–3155.
3
BlotM.PicardD.CordM.ThomeN. (2016). Gossip Training for Deep Learning. Barcelona, Spain: arXiv. preprint arXiv:1611.09726.
4
BottouL.CurtisF. E.NocedalJ. (2018). Optimization Methods for Large-Scale Machine Learning. Siam Review60(2), 223–311.
5
CholletF. (2015). Keras. [Dataset].
6
DasD.AvanchaS.MudigereD.VaidynathanK.SridharanS.KalamkarD.et al (2016). Distributed Deep Learning Using Synchronous Stochastic Gradient Descent. arXiv. preprint arXiv:1602.06709.
7
DeanJ.CorradoG.MongaR.ChenK.DevinM.MaoM.et al (2012). “Large Scale Distributed Deep Networks,” in Advances in neural information processing systems, Lake Tahoe, NV, December 3–8, 2012, 1223–1231.
8
DuchiJ. C.AgarwalA.WainwrightM. J. (2012). Dual Averaging for Distributed Optimization: Convergence Analysis and Network Scaling. IEEE Trans. Automat. Contr.57, 592–606. 10.1109/tac.2011.2161027
9
DvinskikhD.GasnikovA. (2021). Decentralized and Parallelized Primal and Dual Accelerated Methods for Stochastic Convex Programming Problems. Journal of Inverse and Ill-posed Problems29 (3), 385–405.
10
DvinskikhD.GorbunovE.GasnikovA.DvurechenskyP.UribeC. A. (2019). On Dual Approach for Distributed Stochastic Convex Optimization over Networks. Nice, France: arXiv. preprint arXiv:1903.09844.
11
EsfandiariY.TanS. Y.JiangZ.BaluA.HerronE.HegdeC.et al (2021). “Cross-Gradient Aggregation for Decentralized Learning from Non-IID Data,” in Proceedings of the 38th International Conference on Machine Learning, in Proceedings of Machine Learning Research139, 3036–3046.
12
FallahA.MokhtariA.OzdaglarA. (2021). Generalization of Model-Agnostic Meta-Learning Algorithms: Recurring and Unseen Tasks. arXiv. preprint arXiv:2102.03832.
13
FallahA.MokhtariA.OzdaglarA. (2020). Personalized federated learning: A meta-learning approach. in Advances in Neural Information Processing Systems. Virtual-only Conference, December 6–12, 2020.
14
FangX.PangD.XiJ.LeX. (2019). Distributed Optimization for the Multi-Robot System Using a Neurodynamic Approach. Neurocomputing367, 103–113. 10.1016/j.neucom.2019.08.032
15
GeX.HanQ.-L.ZhangX.-M.DingL.YangF. (2019). Distributed Event-Triggered Estimation over Sensor Networks: A Survey. IEEE Trans. cybernetics.
16
GubbiJ.BuyyaR.MarusicS.PalaniswamiM. (2013). Internet of Things (Iot): A Vision, Architectural Elements, and Future Directions. Future Gen. Comput. Syst.29, 1645–1660. 10.1016/j.future.2013.01.010
17
HeJ.CaiL.ChengP.PanJ.ShiL. (2019). Consensus-based Data-Privacy Preserving Data Aggregation. IEEE Trans. Automat. Contr.64, 5222–5229. 10.1109/tac.2019.2910171
18
HeS.ShinH.-S.XuS.TsourdosA. (2020). Distributed Estimation over a Low-Cost Sensor Network: A Review of State-Of-The-Art. Inf. Fusion54, 21–43. 10.1016/j.inffus.2019.06.026
19
HongM.LeeJ. D.RazaviyaynM. (2018). Gradient primal-dual algorithm converges to second-order stationary solution for nonconvex distributed optimization over networks. International Conference on Machine Learning (pp. 2009-2018). PMLR. preprint arXiv:1802.08941.
20
HuR.GuoY.RatazziE. P.GongY. (2020). Differentially Private Federated Learning for Resource-Constrained Internet of Things. arXiv. preprint arXiv:2003.12705.
21
JiangZ.BaluA.HegdeC.SarkarS. (2017a). “Collaborative Deep Learning in Fixed Topology Networks,” in Neural Information Processing Systems (NIPS), Long Beach, CA, December 4–9, 2017.
22
JiangZ.MukherjeeK.SarkarS. (2017b). Generalised Gossip-Based Subgradient Method for Distributed Optimisation. Int. J. Control., 1–17. 10.1080/00207179.2017.1387288
23
JinP. H.YuanQ.IandolaF.KeutzerK. (2016). How to Scale Distributed Deep Learning?arXiv. preprint arXiv:1611.04581.
24
KangJ.XiongZ.NiyatoD.ZouY.ZhangY.GuizaniM. (2020). Reliable Federated Learning for mobile Networks. IEEE Wireless Commun.27, 72–80. 10.1109/mwc.001.1900119
25
LaneN. D.BhattacharyaS.GeorgievP.ForlivesiC.KawsarF. (2015). “An Early Resource Characterization of Deep Learning on Wearables, Smartphones and Internet-Of-Things Devices,” in Proceedings of the 2015 International Workshop on Internet of Things towards Applications (ACM), Seoul, South Korea, November 1, 2015, 7–12. 10.1145/2820975.2820980
26
LaneN. D.GeorgievP. (2015). “Can Deep Learning Revolutionize mobile Sensing?,” in Proceedings of the 16th International Workshop on Mobile Computing Systems and Applications (ACM), Santa Fe, New Mexico, February 12–13, 2015, 117–122.
27
LeCunY.BengioY.HintonG. (2015). Deep Learning. Nature521, 436–444. 10.1038/nature14539
28
LeCunY.BottouL.BengioY.HaffnerP. (1998). Gradient-based Learning Applied to Document Recognition. Proc. IEEE86, 2278–2324. 10.1109/5.726791
29
LenzI.LeeH.SaxenaA. (2015). Deep Learning for Detecting Robotic Grasps. Int. J. Robot. Res.34, 705–724. 10.1177/0278364914549607
30
LesserV.OrtizC. L.JrTambeM. (2012). Distributed Sensor Networks: A Multiagent Perspective, 9. Springer Science & Business Media.
31
LiM.AndersenD. G.SmolaA. J.YuK. (2014). “Communication Efficient Distributed Machine Learning with the Parameter Server,” in Advances in Neural Information Processing Systems, Montreal, Canada, December 8–13, 2014, 19–27.
32
LianX.ZhangC.ZhangH.HsiehC.-J.ZhangW.LiuJ. (2017). “Can Decentralized Algorithms Outperform Centralized Algorithms? a Case Study for Decentralized Parallel Stochastic Gradient Descent,” in Advances in Neural Information Processing Systems, Long Beach, CA, December 4–9, 2017, 5336–5346.
33
McMahanH. B.MooreE.RamageD.HampsonS.ArcasB. A. y. (2017). Communication-efficient Learning of Deep Networks from Decentralized Data. In Artificial intelligence and statistics, 1273–1282.
34
MokhtariA.RibeiroA. (2016). Dsa: Decentralized Double Stochastic Averaging Gradient Algorithm. J. Machine Learn. Res.17, 1–35.
35
NesterovY. (2013). Introductory Lectures on Convex Optimization: A Basic Course, 87. Springer Science & Business Media.
36
PuS.NedićA. (2018). Distributed Stochastic Gradient Tracking Methods. Mathematical Programming187 (1), 409–457.
37
QuG.LiN. (2017). Accelerated distributed Nesterov gradient descent. IEEE Transactions on Automatic Control65 (6), 2566–2581.
38
RechtB.ReC.WrightS.NiuF. (2011). “Hogwild: A Lock-free Approach to Parallelizing Stochastic Gradient Descent,” in Advances in Neural Information Processing Systems, Granada, Spain, December 12–17, 2011, 693–701.
39
ScamanK.BachF.BubeckS.LeeY. T.MassouliéL. (2017). “Optimal Algorithms for Smooth and Strongly Convex Distributed Optimization in Networks,” in International Conference on Machine Learning, Sydney, Australia, Auguset 6–11, 2017, 3027–3036.
40
SongS.ChaudhuriK.SarwateA. D. (2015). Learning from Data with Heterogeneous Noise Using Sgd. In Artificial Intelligence and Statistics, 894–902.
41
SutskeverI.MartensJ.DahlG.HintonG. (2013). “On the Importance of Initialization and Momentum in Deep Learning,” in International conference on machine learning, Atlanta, GA, June 16–21, 2013, 1139–1147.
42
TanF. (2020). The Algorithms of Distributed Learning and Distributed Estimation about Intelligent Wireless Sensor Network. Sensors20 (5), 1302. 10.3390/s20051302
43
TsianosK. I.RabbatM. G. (2012). “Distributed Strongly Convex Optimization,” in Communication, Control, and Computing (Allerton), 2012 50th Annual Allerton Conference on (IEEE), Allerton Park and Retreat Center, IL, October 1–5, 2012, 593–600. 10.1109/allerton.2012.6483272
44
UribeC. A.LeeS.GasnikovA.NedićA. (2020). A Dual Approach for Optimal Algorithms in Distributed Optimization over Networks. In 2020 Information Theory and Applications Workshop (ITA). IEEE, 1–37.
45
WangniJ.WangJ.LiuJ.ZhangT. (2017). Gradient Sparsification for Communication-Efficient Distributed Optimization. Montreal, Canada: arXiv. preprint arXiv:1710.09854.
46
WenW.XuC.YanF.WuC.WangY.ChenY.et al (2017). “Terngrad: Ternary Gradients to Reduce Communication in Distributed Deep Learning,” in Advances in Neural Information Processing Systems, Long Beach, CA, December 4–9, 2017, 1508–1518.
47
XuZ.TaylorG.LiH.FigueiredoM.YuanX.GoldsteinT. (2017). “Adaptive Consensus Admm for Distributed Optimization,” in International Conference on Machine Learning, Sydney, Australia, August 6–11, 2017, 3841–3850.
48
YangS.TahirY.ChenP.-y.MarshallA.McCannJ. (2016). “Distributed Optimization in Energy Harvesting Sensor Networks with Dynamic In-Network Data Processing,” in IEEE INFOCOM 2016-The 35th Annual IEEE International Conference on Computer Communications (IEEE), San Francisco, CA, April 10–15, 2016, 1–9. 10.1109/infocom.2016.7524475
49
ZhangS.ChoromanskaA. E.LeCunY. (2015). “Deep Learning with Elastic Averaging Sgd,” in Advances in Neural Information Processing Systems, Montreal, Canada, December 7–12, 2015, 685–693.
50
ZhangW.ZhaoP.ZhuW.HoiS. C.ZhangT. (2017). “Projection-free Distributed Online Learning in Networks,” in International Conference on Machine Learning, Sydney, Australia, August 6–11, 2017, 4054–4062.
51
ZhengS.MengQ.WangT.ChenW.YuN.MaZ.-M.et al (2017). “Asynchronous Stochastic Gradient Descent with Delay Compensation for Distributed Deep Learning,” in International Conference on Machine Learning, Sydney, Australia, August 6–11, 2017, 4120–4129.
Summary
Keywords
distributed optimization, consensus-optimality, collaborative deep learning, sgd, convergence
Citation
Jiang Z, Balu A, Hegde C and Sarkar S (2021) On Consensus-Optimality Trade-offs in Collaborative Deep Learning. Front. Artif. Intell. 4:573731. doi: 10.3389/frai.2021.573731
Received
18 June 2020
Accepted
19 August 2021
Published
14 September 2021
Volume
4 - 2021
Edited by
Fabrizio Riguzzi, University of Ferrara, Italy
Reviewed by
Arnaud Fadja Nguembang, University of Ferrara, Italy
Claudio Gallicchio, University of Pisa, Italy
Updates
Copyright
© 2021 Jiang, Balu, Hegde and Sarkar.
This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Zhanhong Jiang, starkjiang@gmail.com
This article was submitted to Machine Learning and Artificial Intelligence, a section of the journal Frontiers in Artificial Intelligence
Disclaimer
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.