On Consensus-Optimality Trade-offs in Collaborative Deep Learning

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.


INTRODUCTION
1.1 Motivation the reader to Figure 1 for an illustration involving three agents. With sufficient information exchange, the learned model parameters corresponding to each agent, θ j k , j 1, 2, 3 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 (θ i * ) 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 θ * .

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.

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 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 (θ i * ), 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; d 2 represents the consensus bound/error and d 1 represents the optimality bound/error; ideally, both of these bounds should be small. 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 nonconvex 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.

PROBLEM FORMULATION
We consider the standard unconstrained empirical risk minimization (ERM) problem typically used in machine learning problems (such as deep learning): where θ ∈ R d denotes the parameter vector of interest, f : R d → R denotes a given loss function, and f i 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 G (V, E), where V is a vertex set (with nodes corresponding to agents) and E is an edge set. Throughout this paper we assume that the graph G 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 D j , j 1, . . . , n denote the subset of the training data (comprising n j samples) corresponding to the j th agent such that N j 1 n j n, where N is the total number of agents. With this formulation, and since f (θ) N j 1 f j (θ), 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.  Berahas et al. (2018) Str-con Scaman et al. (2017) Str-con Qu and Li (2017) Str-con Equivalently, the concatenated form of the above equation is as follows: where Θd[θ 1 ; θ 2 ; . . . ; θ N ] T ∈ R dN , Π ∈ R N×N is the agent interaction matrix with its entries π jl indicating the link between agents j and l, I d 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.
Assumption 1. The objective functions f j : R d → R are assumed to satisfy the following conditions: a) each f j is c j -smooth; b) each f j is proper (not everywhere infinite) and coercive; c) each f j is Lipschitz continuous.
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, g j (θ j k ) is the (stochastic) gradient of f j at θ j k , implemented by drawing a minibatch of sampled data points. More precisely, where b′ is the size of the minibatch D ′ selected uniformly at random from the data subset D j available to Agent j.

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.

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: 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 consensusoptimality. 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 Incremental Consensus-based Distributed Stochastic Gradient Descent Distribute the training data set to N agents 3: for each agent do 4: andomly shuffle each data subset 5: for k 0: m do 6: t 0 7: for j 1, . . . , N do 8: θ j t θ j k {Initialization before incremental consensus} 9: end for 10: while t ≤ τ − 1 do 11: for j 1, . . . , N do 12: θ j t+1 l∈Nb(j) π jl θ l t {Incremental consensus} {Update of decision variable for iteration} 22: end for 23: end for By examining Eq. 6, we observe that when ω approaches 0, the update law boils down to a only consensus protocol, and that when ω approaches 1, the method reduces to standard stochastic gradient descent (for individual agents).
Next, we introduce the Nesterov momentum variants of our aforementioned algorithms. The momentum term is typically used for speeding up the convergence rate with high momentum constant close to Eq. 1 (Sutskever et al., 2013). More details can be found in Algorithms 2 and 4.
We provide a discussion on the trade-off between the consensus and optimality to conclude this section. The tradeoff between consensus and optimality can vary from convex to non-convex optimization problems. For most convex distributed optimization problems, they are well defined and globally optimal solution are not empty (probably unique if strongly convex) so each agent can communicate with other agents in its neighborhood to reach consensus and their local gradient updates will guide them to an minimizer. Therefore, the tradeoff can be perfectly balanced to get to good optimal solutions. However, for non-convex problems, there exist possibly numerous locally optimal solutions such that the trade-off plays a critical role in the distributed optimization. The consensus among agents may not be necessarily a good optimal solution since the local gradient update of an agent may "dominate" the solution searching process and allows for "bias". Hence, the investigation of such a trade-off is quite critical.

Tools for Convergence Analysis
We now analyze the convergence of the iterates {θ j k } 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.  In our analysis, we use the concatenated (Kronecker) form of the updates. For simplicity, let P Π⊗I d ∈ R Nd×Nd .
We begin the analysis for g-CDSGD by constructing a Lyapunov function that combines the true objective function with a regularization term involving a quadratic form of consensus as follows: It is easy to show that N j 1 f j (θ j ) is cmdmaxj{c j }-smooth, and that V(Θ) isĉ-smooth with Likewise, it is easy to show that N j 1 f j (θ j ) is Hmd minj{Hj}strongly convex; therefore V(Θ) isĤ-strongly convex witĥ We also assume that there exists a lower bound Vinf for the function value sequence {V (Θk)}, ∀k. When the objective functions are strongly convex, we have Vinf V (Θ*), where Θ* is the optimizer. Due to Assumptions 1 and 2, it is straightforward to obtain an equivalence between the gradient of Eq. 7 and the update law of g-CDSGD. Rewriting (6), we get: Therefore, we obtain: The last term in Eq. 9 is precisely the gradient of V(Θ). In the stochastic setting, g (Θk) can be approximated by sampling one data point (or a mini-batch of data points) and the stochastic Lyapunov gradient is denoted by S(Θ k ), ∀k. Similarly, the update laws for our proposed Nesterov momentum variants can be compactly analyzed using the above Lyapunov function. First, we rewrite the updates for g-CDMSGD as follows: With a few algebraic manipulations, we get: The above derivation simplifies the Nesterov momentum-based updates into a regular form which is more convenient for convergence analysis. For clarity, we separate this into two sub-equations. Let S(y k+1 ) ωg(y k+1 ) + 1−ω α (I Nd − P)y k+1 . Thus, the updates for g-CDMSGD can be expressed as Please find the similar transformation for i-CDMSGD in Supplementary Section S1. For analysis, we require a bound on the variance of the stochastic Lyapunov gradient S(Θ k ) such that the variance of the gradient noise 1 can be bounded from above. The variance of S(Θ k ) is defined as: The following assumption is standard in SGD convergence analysis, and is based on Bottou et al. (2018).
Assumption 3. a) There exist scalars r 2 ≥ r 1 >0 such that Remark 1. Assumption 3(a) guarantees sufficient descent of V in the direction of −S(Θ k ); Assumption 3(b) states that the variance of S(Θ k ) 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 S(Θ k ). Therefore, the second moment of S(Θ k ) can be bounded above as where B m dB V + r 2 2 ≥ r 2 1 ≥ 0. 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 S(Θ k ) via two scalar constants. However, our analysis technique is otherwise similar. For convergence analysis, we assume: Assumption 4. There exists a constant G>0 such that ∇V(x) ≤ G, ∀x ∈ R dN .
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 ∀k ∈ N: Lemma 2. Let Assumptions 1, 2, and 3 hold. The iterates of g-CDSGD (Algorithm 3) satisfy the following inequality ∀k ∈ N: 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

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.

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 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 ∀k ∈ N, when α 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.
Theorem 1. (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 ∀k ∈ N: λN ))B 2 . PROOF. Recalling Lemma 2 and using Definition 1 yield: The second inequality follows from that α ≤ r1 cBm , 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 0 ≤ αĤr 1 ≤Ĥ r 2 1 cBm ≤Ĥ r 2 1 cr 2 1 Ĥ c ≤ 1, the conclusion follows by applying Eq. 1 recursively through iteration k ∈ N and Theorem 2. (Convergence of i-CDSGD in strongly convex case) Let Assumptions 1, 2, and 3 hold. When the step size , the iterates of i-CDSGD (Algorithm 1) satisfy the following inequality ∀k ∈ N: PROOF. 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 C 1 with C 3 and C 2 with C 4 , 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.
Theorem 3. (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 satisfies Eq. 15, the iterates of g-CDSGD (Algorithm 3) satisfy the following inequality ∀K ∈ N: PROOF. Recalling Lemma 2 and taking expectations on both sides lead to the following relation: If the step size is such that α ≤ r1 cBm , we get: Applying the above inequality from 1 to K and summing them up can give the following relation The last inequality follows from the Assumption 3. Rearrangement of the above inequality, substitutingĉ ωc m + α −1 (1 − ω)(1 − λ N ), and dividing by K yields the desired result.
Theorem 4. (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 0 ≤ α ≤ , the iterates of i-CDSGD (Algorithm 1) satisfy the following inequality ∀K ∈ N: (26) PROOF. 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 using Theorems 1 and 2 can establish analogous convergence rate for the true value function sequence {F (Θ k )}.
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 firstorder 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 αcB 2r 1 , where c c m H m is the condition number. This suggests that if consensus is not a concern, then each iterate {θ j k } converges to its own respective θ j * , as depicted in Figure 1. On the other hand, when ω → 0, the upper bound converges to αB(1−λ N ) 2r1(1−λ2) . 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 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.

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 μ 1− Ĥ α √ 1+ Ĥ α √ . Before stating the main result, we define the sequence ϕk(Θ), k 1, 2, . . . as: whereV represents the average of the objective function values of a mini-batch. We define ϕ * k as follows 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.
Theorem 5. (Convergence of g-CDMSGD, strongly convex case) Let Assumptions 1, 2, 3, and 4 hold. If the step size satisfies PROOF. From Lemma 5 in Supplementary Section S1., it can be obtained that The last inequality follows from that the coefficient −Ĥ 2 Recalling Eq. S20 of Lemma 5 in Supplementary Section S1 and letting Θ Θ*, and combining Eq. 29, we have As E[ S(y k ) − ∇V(y k ) 2 ] ≤ B + B V G 2 , therefore, the following inequality can be acquired Theorem 6. (Convergence of i-CDMSGD, strongly convex case) Let Assumptions 1, 2, 3, and 4 hold. If the step size satisfies 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 1 − Ĥ α ) up to a neighborhood of V* of radius α H (B + B V G 2 ). When k → ∞, the first term on the right hand side vanishes and substitutinĝ which 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 α 1 2(1−λ) (B + B V G 2 ). However, ω → 1 leads to α H m (B + B V G 2 ). 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 B V G 2 even when B 0. However, it should be noted that B+ B V G 2 represents the upper bound of variance of S(Θ k ). 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 B V is sufficiently small and r 1 ≈ 1 2 2 √ , it can be observed that the optimality bound for the Nesterov momentum variant is smaller than that for g-CDSGD as Bα 1−λ 2 ≥ Bα 1−λ 2 √ ; 2) ω → 1: When c m and r 1 are carefully selected such that c m 2r 1 ≈ 1, we have B α H m ≤ Bα H m when α H m > 1. Therefore, introducing the momentum can speed up the convergence rate with appropriately chosen hyperparameters.

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.    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.
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.

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.

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.