FedDANE: A Federated Newton-Type Method

2020·Arxiv

Abstract

Abstract

Federated learning aims to jointly learn statistical models over massively distributed remote devices. In this work, we propose FedDANE, an optimization method that we adapt from DANE [9, 10], a method for classical distributed optimization, to handle the practical constraints of federated learning. We provide convergence guarantees for this method when learning over both convex and non-convex functions. Despite encouraging theoretical results, we find that the method has underwhelming performance empirically. In particular, through empirical simulations on both synthetic and real-world datasets, FedDANE consistently underperforms baselines of FedAvg [8] and FedProx [6] in realistic federated settings. We identify low device participation and statistical device heterogeneity as two underlying causes of this underwhelming performance, and conclude by suggesting several directions of future work.

I. INTRODUCTION

Federated learning is a distributed learning paradigm that considers training statistical models in heterogeneous networks of remote devices [5, 8]. Learning a model while keeping data localized can provide both computational and privacy benefits compared to transmitting raw data across the network.

To handle heterogeneity and high communication costs in federated networks, a popular approach for federated optimization methods involves allowing for local updating and low participation [5]. One method along these lines is FedAvg [8], which has demonstrated robust empirical performance in non-convex settings. FedAvg assumes only a small subset of devices (e.g., 1% out of thousands to millions) participate in training at each communication round. Each selected device then performs variable amounts of local work before sending model updates back to the server, which can enable a flexible trade-off between communication and computation.

Although FedAvg performs well empirically, it can diverge when the data is statistically heterogeneous (i.e., generated in a non-identically distributed manner across the network) [6, 8]. A recent approach, FedProx [6], has attempted to mitigate this issue by adding a proximal term to the subproblem on each device, which helps to improve the stability of the method.

In this work, we take a similar approach to FedProx, and draw inspiration from DANE and variants [9, 10], which are popular methods developed for the distributed data center setting. In particular, Reddi et al. [9] propose inexact-DANE, a variant of DANE that allows for local updating, which is beneficial when communication is a bottleneck. Compared with FedAvg, DANE and inexact-DANE use a different local subproblem which includes two additional terms—a gradient correction term and a proximal term. As data is statistically heterogeneous in federated networks, these terms can potentially improve convergence by forcing model updates to be closer to the current global model, making the method more stable and amenable to theoretical analysis. Including the gradient correction term also allows the update to take on the form of an approximate Newton-type method, which can lead to provably improved convergence for certain well-behaved objectives [10].

Despite the merits of (inexact) DANE, the method has not been analyzed in settings with statistically heterogeneous data or low participation amongst the devices, which are critical challenges in realistic federated networks. Indeed, at each communication round, DANE requires every device to collectively evaluate the gradient of the global function. This is prohibitive in federated networks as it requires the server to communicate with each device in a potentially massive network, and does not allow for the case of devices dropping out. A natural way to address this issue is to approximate the gradient via a subsample of the devices. Based on this idea, we propose FedDANE, a variant of inexact DANE for federated learning.1 Similar to inexact DANE, FedDANE inexactly solves an approximate Newton-type subproblem, but only collects gradient updates from a subset of devices at each round.

We provide convergence guarantees for FedDANE for both convex and non-convex functions in low participation settings, and allow for the scenario that each device generates data from a possibly differing distribution. Despite encouraging theoretical results, our empirical evaluation indicates that while FedDANE is more expensive as it needs two rounds of communication for one update, it consistently underperforms FedAvg and FedProx due to the inexact estimation of the full gradient and the statistical heterogeneity in the network. Our study highlights the drawbacks of the gradient correction term in FedDANE, and suggests the superiority of FedProx which leverages just the proximal term to achieve improved performance for federated optimization. Our work also suggests several directions of future work in federated optimization.

II. RELATED WORK

DANE and Other Communication-efficient Distributed Methods. Methods that employ local updating (i.e., computing and applying a variable number of updates locally, rather than just evaluating the gradients once and sending them back for aggregation) are a popular approach for improving communication-efficiency in distributed optimization. By solving the local subproblems inexactly at each round, such schemes enable a flexible trade-off between communication and computation. For example, COCOA [12] is a communication-efficient primal-dual framework that leverages duality to decompose the global objective into subproblems that can be solved inexactly. Several primal methods [e.g., 9, 10, 13, 14, 17, 18], including DANE [10] and inexact DANE [9], have also been proposed, and have the added benefit of being applicable to non-convex objectives. While these methods make a seemingly small change over standard mini-batch methods, they enable drastically improved performance in practice, and have been shown to achieve orders-of-magnitude speedups over mini-batch methods in real-world data center environments. This is especially critical in communication-constrained environments such as federated settings.

Heterogeneity-aware Federated Optimization. An important distinction between federated optimization and classical distributed optimization is the presence of heterogeneity, i.e., non-identically distributed data and heterogeneous systems across the network. Smith et al. [11] propose a primal-dual optimization method that learns separate but related models for each device through a multi-task learning framework. This setup naturally captures statistical heterogeneity, and also considers systems issues such as stragglers in the method and theory. However, such an approach is not generalizable to non-convex problems. There are several recent works that provide theoretical analysis specifically for federated optimization. FedProx [6] characterizes the convergence behavior under a dissimilarity assumption of local functions, while accounting for the low participation of devices. Other works analyze different methods with non-identically distributed data, but under different (possibly) limiting assumptions, such as using SGD as a specific local solver [7], full device participation [15, 16], convexity [4, 7, 15], or uniformly-bounded gradients [7, 16]. For instance, SCAFFOLD [4] is a recent method for federated optimization related to DANE where it maintains a similar gradient correction term in the local subproblem. However, its convergence results are limited to strongly convex functions, and the method has yet to be explored empirically. Our convergence analysis of FedDANE also accounts for low device participation and data heterogeneity, and covers both convex and non-convex functions (Section IV).

III. METHODS

In this section, we propose FedDANE, a heterogeneity-aware federated optimization method. Before introducing FedDANE (Section III-C), we first formally define the optimization objective we consider in this paper (Section III-A), and provide some background on FedAvg and DANE (Section III-B).

A. Problem Setup

Federated learning typically aims to minimize the empirical risk over heterogeneous data distributed across multiple devices:

where N is the number of devices, , and . In general, the local objectives measure the local empirical risk over possibly differing data distributions , i.e., , with samples available at each device k. Hence, we can set is the total number of data points on all devices. In this work, we consider the typical centralized setup where N devices are connected to one central server.

B. Preliminaries: FedAvg and DANE

In FedAvg [8], a subset of devices are sampled, and perform variable iterations of SGD to solve their local subproblems inexactly at each communication round. In particular, each selected device k runs E epochs of SGD on the local function to obtain local updates, then sends the updates back for aggregation in a synchronous manner. The details are summarized in Algorithm 1.

In data center settings, DANE [10] and its inexact variants [9] are another set of approaches which have been analyzed in depth. In its simplest form, DANE has each worker k solve the following subproblem:

Similarly, after each worker solves its subproblem, the central server collects those updates and aggregates them to obtain The update is in fact a two-step process, as (2) requires the workers to first collectively compute the overall gradient of the function, , and can be interpreted as a distributed variant of SVRG [9]. Inexact DANE allows the flexibility of solving (2) inexactly [9]. Based on inexact DANE, we next introduce FedDANE.

C. Proposed Method: FedDANE

The inexact DANE method mentioned above cannot be directly applied to federated settings. One critical challenge is that computing the full gradient requires the server to communicate with all the devices and then average the local gradients, which is infeasible in massive federated networks.

In FedDANE, we propose to approximate the full gradients using a subset of gradients from randomly sampled devices.

Collecting the gradients from a subset ) of devices at each iteration t yields:

After computing selects another subset of devices where each device solves the following subproblem inexactly:

The server then aggregates the updates from the selected devices. See Algorithm 2 for details. We note that one limitation of FedDANE is that each outer iteration incurs two rounds of communication, making it less efficient than FedAvg and FedProx. This leads us to suggest a variant of FedDANE leveraging a pipelined approach to perform one update in a single round of communication (see Section V-C for more discussions). However, as we will see in our empirical valuation (Section V), even the less efficient (and more accurate) FedDANE proposed here results in inferior practical performance compared to FedAvg and FedProx.

IV. ANALYSIS

We now provide our convergence analysis of FedDANE for both convex and non-convex problems. Recall that FedDANE allows each selected device to solve a subproblem inexactly at each updating round to reduce communication. We first formally define a parameter to quantify the inexactness, which will be used throughout our analysis.

Definition 1 (-inexact Solution). We say that is a -inexact minimizer of (3) if , where , and is the exact minimizer of (3). Note that a smaller corresponds to higher accuracy.

In order to quantify the dissimilarity between devices in a federated network, following Li et al. [6], we define B-local dissimilarity as follows.

Definition 2 (B-local Dissimilarity). The local functions are B-locally dissimilar at w if . We further define for

When the devices are homogeneous with I.I.D. data, B(w) = 1 for every w. The more heterogeneous the data are in the network, the larger B(w) is. As discussed later, our convergence results are a function of the device dissimilarity bound B.

A. Convex Case

We first investigate the convergence results for convex

Theorem 3 (Sufficient Decrease). Assume ’s are convex, and have L-Lipschitz continuous gradients. Moreover, assume B-dissimilarity is bounded by B at point . Given the inexact criterion in Definition 1, if

then at iteration t of Algorithm 2, we have the following expected decrease in the global objective:

where represents the distribution of a set of random devices selected at time t.

We defer the readers to Appendix V-D for a complete proof. At a high-level, we first use the -inexactness and other assumptions to attain a decrease in the objective, then take an expectation over randomly selected devices and apply the bounded B-dissimilarity to obtain the above results.

Corollary 4 (Convergence: Convex Case). Let the assertions of Theorem 3 hold. In addition, let problems are solved exactly, if then we choose from which it follows that

B. Non-convex Case

We have the following convergence characterization for non-convex functions.

Theorem 5 (Sufficient Decrease). Assume ’s are non-convex, and have L-Lipschitz continuous gradients. Moreover, assume there exists a Assume B-dissimilarity is bounded by the inexact criterion in Definition 1, if

then at iteration t of Algorithm 2, we have the following expected decrease in the global objective:

where represents the devices randomly selected at time t.

The proof (Appendix V-E) is similar to the proof for Theorem 3. Now we can use the above sufficient decrease to the characterize the rate of convergence to the set of approximate stationary solutions

Theorem 6 (Convergence: Non-convex Case). Let the assumption Theorem 5 hold at each iteration of FedDANE. Moreover, . Then, after iterations, we have

Note that the convergence rates of FedDANE derived here recover the results in FedProx [6], which are also asymptotically the same as SGD [3].

C. Device-specific Constants

While the previous results assume the same constants L (the Lipschitz constant of gradients), (the penalty constant of the proximal term), and (the degree of inexactness) across all devices, we can easily extend the analysis to allow for variable constants across devices.

Theorem 7 (Convergence with Device-specific Constants). Assume ’s are convex, and have -Lipschitz continuous gradients. Moreover, assume B-dissimilarity is bounded by B at point . Given the inexact criterion in Definition 1, if constants are chosen such that

then at iteration t of Algorithm 2, we have the following expected decrease in the global objective:

where represents the distribution of a set of random devices selected at time t.

See Appendix V-F for a full proof. Note that our analysis is general in that it is agnostic of any specific local solver, and covers both cases of sampling devices with and without replacement.

V. EXPERIMENTS

A. Experimental Setup

Datasets. We evaluate the performance of FedDANE using both synthetic and real-world federated datasets. The datasets are curated from the LEAF benchmark [2] as well as previous work on federated learning [6]. In particular, we use a set of synthetic datasets with varying degrees of data heterogeneity following the setup in Li et al. [6]. We also study three real datasets in LEAF: FEMNIST for image classification with a convex model, Shakespeare for next-character prediction, and Sent140 for sentiment analysis, both with non-convex deep neural network models. These datasets are naturally partitioned into different devices in the network [2]. Data statistics are summarized in Table I below.

TABLE I: Statistics of three real federated datasets.

Implementation & Hyper-parameters. We implement all code in Tensorflow [1], simulating a federated setup where N devices (N is the total number of devices shown in Table I) are connected with a central server. For FedAvg and FedProx, we directly take the tuned hyper-parameters reported in [6]. For FedDANE, we use the same learning rates and batch sizes as in FedAvg on the same dataset. We tune (the penalty constant in the proximal term) for FedDANE from a candidate set {0, 0.001, 0.01, 0.1, 1} and pick a best based on the training loss. All code, data, and experiments are publicly available at github.com/litian96/FedDANE.

B. Evaluation Results

We compare the convergence of FedDANE with FedAvg and FedProx. For each method, we select 10 devices at each updating round, and let each device perform E epochs of local updates (E = 20). We plot the training loss versus the updating rounds (treating two communication rounds in FedDANE as one). The results are shown in Figure 1. We see that FedDANE consistently performs worse than both FedAvg and FedProx. This indicates that statistical heterogeneity and low device participation (the inaccurate approximation of the full gradients) may hurt the convergence of FedDANE. We further investigate the effects of varying participating devices and show that whether selecting more devices to get a better approximation of the full gradients can lead to improved performance depends on the degree of data heterogeneity. We then create an extreme ‘unrealistic’ setting that favors FedDANE, where we select a large subset of devices (78% of the total devices on average) and let each device perform only one epoch of local updates, trying to prevent local models from deviating too much from the global model. Even in this unrealistic setting, the performance of FedDANE is still

Fig. 1: Convergence of FedDANE compared with FedAvg and FedProx. For synthetic datasets in the first row, from left to right, data are becoming more heterogeneous. Except for the perfect I.I.D. dataset (Synthetic IID), FedDANE underperforms both FedAvg and FedProx on all datasets—either converging more slowly or diverging.

disappointing. The results of all the additional experiments are provided in Appendix V-G.

C. Discussions

Despite encouraging theoretical results, FedDANE demonstrates underwhelming empirical performance. This indicates that several of our theoretical assumptions may not hold in practical scenarios. These violations may include (1) the lowest eigenvalue of the Hessian is too small, (2) the choice of does not make the local subproblem strongly convex, and (3) the choices of the constants may not guarantee sufficient decrease. More generally, the discrepancy between theory and practice suggests that the practical issues of low device participation and statistical heterogeneity in distributed optimization require careful theoretical consideration—for FedDANE as well as for methods such as FedAvg and FedProx. Developing a better understanding of this setting may help to enable improved empirical performance for the increasingly prevalent problem of federated learning.

We note that there are other possible variants of DANE that may address the drawbacks of FedDANE. For instance, in order to mitigate the negative effects of the gradient correction term, we can consider decaying this term over the optimization process. The ‘decayed’ FedDANE will eventually reduce to FedProx as the gradient correction term becomes closer to zero. Another limitation with the proposed FedDANE method is that it requires two rounds of communication for one update. One could imagine a ‘pipelined’ variant of FedDANE where the overall gradient and the local model updates are transmitted together to the server. In this way, however, the selected devices have to use the stale gradients for the gradient correction term in the local subproblem. Exploring such variants is an interesting direction of future research.

This work was supported in part by DARPA FA875017C0141, the National Science Foundation grants IIS1705121 and IIS1838017, an Okawa Grant, a Google Faculty Award, an Amazon Web Services Award, a JP Morgan A.I. Research Faculty Award, a Carnegie Bosch Institute Research Award, and the CONIX Research Center, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of DARPA, the National Science Foundation, or any other funding agency.

REFERENCES

[1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. K. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and X. Zheng. Tensorflow: A system for large-scale machine learning. In OSDI, 2016.

[2] S. Caldas, P. Wu, T. Li, J. Koneˇcn`y, H. B. McMahan, V. Smith, and A. Talwalkar. Leaf: A benchmark for federated settings. arXiv:1812.01097, 2018.

[3] S. Ghadimi and G. Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIOPT, 2013.

[4] S. P. Karimireddy, S. Kale, M. Mohri, S. J. Reddi, S. U. Stich, and A. T. Suresh. Scaffold: Stochastic

controlled averaging for on-device federated learning. arXiv:1910.06378, 2019.

[5] T. Li, A. Sahu, A. Talwalkar, and V. Smith. Federated learning: Challenges, methods, and future directions. arXiv preprint arXiv:1908.07873, 2019.

[6] T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith. Federated optimization in heterogeneous networks. In MLSys, 2020.

[7] X. Li, K. Huang, W. Yang, S. Wang, and Z. Zhang. On the convergence of fedavg on non-iid data. In ICLR, 2020.

[8] H. B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas. Communication-efficient learning of deep networks from decentralized data. In AISTATS, 2017.

[9] S. J. Reddi, J. Koneˇcn`y, P. Richt´arik, B. P´ocz´os, and A. Smola. Aide: Fast and communication efficient distributed optimization. arXiv:1608.06879, 2016.

[10] O. Shamir, N. Srebro, and T. Zhang. Communication-efficient distributed optimization using an approximate newton-type method. In ICML, 2014.

[11] V. Smith, C.-K. Chiang, M. Sanjabi, and A. Talwalkar. Federated multi-task learning. In NeurIPS, 2017.

[12] V. Smith, S. Forte, C. Ma, M. Takac, M. I. Jordan, and M. Jaggi. Cocoa: a general framework for communication-efficient distributed optimization. JMLR, 2018.

[13] S. U. Stich. Local sgd converges fast and communicates little. In ICLR, 2019.

[14] J. Wang and G. Joshi. Cooperative sgd: A unified framework for the design and analysis of communication-efficient sgd algorithms. arXiv:1808.07576, 2018.

[15] S. Wang, T. Tuor, T. Salonidis, K. K. Leung, C. Makaya, T. He, and K. Chan. Adaptive federated learning in resource constrained edge computing systems. J-SAC, 2019.

[16] H. Yu, S. Yang, and S. Zhu. Parallel restarted sgd for non-convex optimization with faster convergence and less communication. In AAAI, 2018.

[17] S. Zhang, A. E. Choromanska, and Y. LeCun. Deep learning with elastic averaging sgd. In NeurIPS, 2015.

[18] F. Zhou and G. Cong. On the convergence properties of a k-step averaging stochastic gradient descent algorithm for nonconvex optimization. In IJCAI, 2018.

D. Proof for Theorem 3

Proof. We have by the Lipschitz continuity of the gradients:

By optimality conditions, we have that

We denote the local subproblem (3) as . We also note that, -strongly convex,

Using (5)-(6) in (4), we have,

Taking expectation with respect to the randomly chosen devices

where in the last step, we used the inequality that

Note that

Plugging into (9), we get

where

E. Proof for Theorem 5

Proof. We have by the Lipschitz continuity of the gradients:

By optimality conditions, we have that

We denote the local subproblem (3) as . We also note that, -strongly convex,

Using (15)-(16) in (14), we have,

where in the last step, we used the inequality in (10). Note that

Plugging into (17), we get

where

F. Proof for Theorem 7

Proof. We have by the Lipschitz continuity of the gradients:

By optimality conditions, we have that

Similarly, we denote the local subproblem (3) as . We also note that, -strongly convex,

Using (22)-(23) in (21), we have,

Plugging into (25), we get

where

G. Additional Experiments

Fig. 2: Effects of low device participation. For the three synthetic datasets with varying statistical heterogeneity, we randomly select 1, 5, 10, or 30 devices (out of 30) at each communication round. We set E to be 20. From the top row to the bottom row, data heterogeneity is increasing. We see that (1) low device participation hurts the performance of FedDANE in statistically heterogeneous settings, and (2) in highly heterogeneous environments (e.g., on the Synthetic (0.5,0.5) dataset), even full device participation does not help improve the performance of FedDANE.

Fig. 3: Convergence of FedDANE compared with FedAvg and FedProx in unrealistic settings (nearly full device participation, small local epochs E = 1) which favor FedDANE. For synthetic datasets, we let all devices participate in learning at each iteration. For FEMNIST, Sent140, and Shakespeare, we select 50%, 26%, and 70% devices respectively at each round in order to better estimate the full gradients. FedDANE still performs worse than the other two methods, especially on highly heterogeneous datasets.