A NALYSIS OF E RROR F EEDBACK IN C OMPRESSED F EDERATED N ON -C ONVEX O PTIMIZATION
Anonymous authors
Paper under double-blind review
A BSTRACT
Communication cost between the clients and the central server could be a bottleneck in real-world Federated Learning (FL) systems.
In classical distributed learning, the method of Error Feedback (EF) has been a popular technique to remedy the downsides of biased gradient compression, but literature on applying EF to FL is still very limited.
In this work, we propose a compressed FL scheme equipped with error feedback, named Fed-EF, with two variants depending on the global optimizer.
We provide theoretical analysis showing that Fed-EF matches the convergence rate of the full-precision FL counterparts in non-convex optimization under data heterogeneity.
Moreover, we initiate the first analysis of EF under partial client participation, which is an important scenario in FL, and demonstrate that the convergence rate of Fed-EF exhibits an extra slow down factor due to the “stale error compensation” effect.
Experiments are conducted to validate the efficacy of
Fed-EF in practical FL tasks and justify our theoretical findings.
I NTRODUCTION
Federated Learning (FL) has seen numerous applications in, e.g., computer vision, language processing, public health, Internet of Things (IoT) [19; 44; 62; 39; 49; 29; 25].
A centralized FL system includes multiple clients each with local data, and one central server that coordinates the training process.
The goal of FL is for n clients to collaboratively find a global model, parameterized by θ , such that
[Equation]
where f i ( θ ) :
= E D ∼D i (cid:2)
F i ( θ ; D ) (cid:3) is a non-convex loss function for the i -th client w.r.t.
the local data distribution D i .
Taking standard local SGD [42; 53] as an example, in each training round, the server first broadcasts the model to the clients.
Then, each client trains the model based on the local data, after which the updated local models are transmitted back to the server and aggregated.
The number of clients, n , can be either tens/hundreds ( cross-silo FL [41; 21], e.g., clients are companies) or as large as millions ( cross-device
FL [26; 29], e.g., clients are personal devices).
There are two primary benefits of FL: (i) the clients train the model simultaneously, which is efficient in terms of computational resources; (ii) each client’s data are kept local throughout training and never transmitted to other parties, which promotes data privacy.
However, the efficiency and broad application scenarios also brings challenges for FL method design:
• Communication cost: In most FL algorithms, clients are allowed to conduct multiple training steps (e.g., local SGD updates) in each round.
Though this has reduced the communication frequency, the one-time communication cost is still a challenge in real-world FL systems with limited bandwidth, e
g., portable devices at the wireless network edges [5; 61; 29].
• Data Heterogeneity: Unlike in the classical distributed training, the local data distribution in FL ( D i in (1)) can be different (non-iid), reflecting many real-world scenarios where the local data held by different clients (e.g., app/website users) are highly personalized.
When multiple local training steps are taken, the local models could become “biased” towards minimizing the local losses, instead of the global loss.
This data heterogeneity may hinder the global model to converge to a good solution [34; 67; 33].
• Partial participation (PP): Another practical issue, especially for cross-device FL, is the partial participation (PP) where the clients do not join training consistently, e.g., due to unstable connection or user change.
That is, only a fraction of clients are involved in each FL training round, which may also slow down the convergence of the global model [10; 12].
FL under compression.
In order to overcome the main challenge of communication bottleneck, several works have considered federated learning with compressed message passing.
Examples include FedPaQ [47], FedCOM [18] and FedZip [40].
All these algorithms are built upon directly compressing model updates communicated from clients to server.
In particular, [47; 18] proposed to use unbiased stochastic compressors such as stochastic quantization [3] and sparsification [57], which showed that with considerable communication saving, applying unbiased compression in FL could approach the learning performance of un-compressed FL algorithms.
However, unbiased (stochastic) compressors typically require additional computation (sampling) which is less efficient in real-world large training systems.
Biased gradients/compressors are also common in many applications [2].
Error feedback (EF) for distributed training.
One simpler and popular type of compressor is the deterministic compressor, including fixed quantization [13], TopK sparsification [54; 52; 35],
SignSGD [50; 7; 8], etc., which belong to biased compression operators.
In classical distributed learning literature, it has been shown that directly updating with the biased gradients may slow down the convergence or even lead to divergence [28; 2].
A popular remedy is the so-called error feedback (EF) strategy [54]: in each iteration, the local worker sends a compressed gradient to the server and records the local compression error, which is subsequently used to adjust the gradient computed in next iteration, conceptually “correcting the bias” due to compression.
It is known that biased gradient compression with EF can achieve same convergence rate as the full-precision counterparts [28; 35].
Our contributions.
Despite the rich literature on EF in classical distributed training, it has not been well explored in the context of federated learning.
In this paper, we provide a thorough analysis of EF in FL.
In particular, the three key features of FL, local steps, data heterogeneity and partial participation, pose interesting questions regarding the performance of EF in federated learning: (i)
Can EF still achieve the same convergence rate as full-precision FL algorithms, possibly with highly non-iid local data distribution?
(ii) How does partial participation change the situation and the results?
We present new algorithm and results to address these questions:
• We study a FL framework with biased compression and error feedback, called Fed-EF, with two variants (Fed-EF-SGD and Fed-EF-AMS) depending on the global optimizer (SGD and adaptive AMSGrad [46], respectively).
Under data heterogeneity, Fed-EF has asymptotic convergence rate O ( 1 √ TKn ) where T is the number of communication rounds, K is the number of local training steps and n is the number of clients.
Our new analysis matches the convergence rate of full-precision FL counterparts, improving the previous convergence result [6] on error compensated FL (see detailed comparisons in Section 3).
Moreover, Fed-EF-AMS is the first compressed adaptive FL algorithm in literature.
• Partial participation (PP) has not been considered for standard error feedback in distributed learning.
We initiate new analysis of Fed-EF in this setting, with local steps and non-iid data all considered at the same time.
We prove that under PP, Fed-EF exhibits a slow down of factor (cid:112) n/m compared with the best full-precision rate, where m is the number of active clients per round, which is caused mainly by the “delayed error compensation” effect.
• Experiments are conducted to illustrate the effectiveness of the proposed methods, where we show that Fed-EF matches the performance of full-precision FL with significant reduction in communication, and compares favorably against the algorithms using unbiased compression without error feedback.
Numerical examples are also provided to justify our theory.
B ACKGROUND AND R ELATED W ORK
Distributed SGD with compressed gradients.
In distributed SGD training systems, extensive works have considered compression applied to the communicated gradients.
Unbiased stochastic compressors include stochastic rounding and QSGD [3; 66; 58; 38], and magnitude based random sparsification [57].
The works [50; 7; 8; 28; 24] analyzed communication compression using only the sign (1-bit) information of the gradients.
Unbiased compressors can be combined with variance reduction techniques for acceleration, e.g., [17].
On the other hand, examples of popular biased compressors include TopK [37; 54; 52], which only transmits gradient coordinates with largest magnitudes, and fixed (or learned) quantization [13; 66].
See [9] for a summary of more biased compressors.
There exist other compression schemes, such as vector quantization [64; 40], low-rank approximation [56] and sketching [22], which will not be the focus of this paper.
Error Feedback (EF) for biased compression.
It has been shown that directly implementing biased compression in distributed SGD leads to worse convergence and generalisation [2; 9].
Error feedback (EF), as proposed in [54], can fix this issue [28].
With EF, distributed SGD under biased compression can match the convergence rate of the full-precision distributed SGD, e.g., also achieving linear speedup ( O (1 / √ Tn ) )
w.r.t.
the number of workers n in distributed SGD [23; 51; 4; 68; 55].
Recently, a variant of EF, called EF21, was proposed [48], which is different from EF in algorithm design.
[15] applied EF21 to FL under several settings.
Our work is different, where we analyze the standard EF in FL, design new algorithms and derive faster convergence rates with different analysis.
Finally, in federated learning, as mentioned earlier, several works have applied compression to the client-to-server communication, e.g., [47; 40; 18].
Among the limited related literature on adopting EF to FL, the most relevant method is QSparse-local-SGD [6] which is a special case of the Fed-EF framework studied in this paper.
In Section 3 and Section 4, we will compare our proposed Fed-EF framework with these related methods in terms of both algorithm and theory.
Our algorithm also exploits adaptive gradient method AMSGrad [46], which has been applied to distributed and federated learning [45; 35].
See, for instance, [14; 65; 30] for the series of works on adaptive gradient methods.
F ED -EF: C OMPRESSED F EDERATED L EARNING WITH E RROR F EEDBACK
In this paper, we consider deterministic compressors which are simple and computational efficient.
Throughout the paper, [ n ] will denote the integer set { 1 , ..., n } .
Definition 1 ( q C -deviate compressor) .
The q C -deviate compressor C : R d (cid:55)→ R d is defined such that for ∀ x ∈ R d , ∃ 0 ≤ q C < 1 s.t. ∥C
( x ) − x ∥ 2 ≤ q 2 C ∥ x ∥ 2 .
In particular, two examples are [54; 68]:
• Let S =
{ i ∈ [ d ] : | x i | ≥ t } where t is the (1 − k ) -quantile of | x i | , i ∈
[ d ] .
The TopK compressor with compression rate k is defined as C ( x ) i
= x i , if i ∈ S ; C ( x ) i = 0 otherwise.
• Divide [ d ] into M groups (e
g., neural network layers) with index sets I i , i = 1 , ..., M , and d i := |I
i | .
The (Grouped) Sign compressor is defined as C ( x ) = (cid:2)
∥ x I 1 ∥ 1 dsign ( x I 1 ) , ..., ∥ x I M
[Figure]
M sign ( x I M ) (cid:3) , with x I i the sub-vector of x at indices I i .
[Figure]
Larger q C indicates heavier compression, and q C = 0 implies no compression, i.e. C ( x )
= x .
Additionally, these two compression operations can be combined to derive the so-called “ heavy-Sign ”, where we first apply TopK and then Sign .
This strategy is also q -deviate (see Appendix A for details) and will also be tested in our experiments in Section 5.
Can we simply use biased compressors in communicationefficient FL?
As an example, in Figure 1, we report the test accuracy of a Multi-Layer Perceptron (MLP) trained on MNIST in non-iid FL environment (see Section 5 for more description), of Fed-SGD [53] with full communication v.s. Sign compression.
We observe a catastrophic performance loss of using biased compression directly.
Fed-EF algorithm.
To resolve this problem, error feedback (EF), which is a popular tool in distributed training, can be adapted to federated learning.
In Algorithm 1, we present a FL framework with biased compression, named Fed-EF, whose main steps are summarized below.
In round t : 1)
The server broadcast the global model θ t to all clients (line 5); 2) The i -th client performs K steps of local SGD updates to get local model θ ( K ) t,i , compute the compressed local model update ˜ ∆ t,i , updates the local error accumulator e t,i , and sends the compressed ˜∆ t,i back to the server (line 6-12); 3)
The server receives ˜∆ t,i , i ∈ [ n ] from all clients, takes the average, and perform a global model update using the averaged compressed local model updates (line 15-19).
Depending on the global model optimizer, we propose two variants: Fed-EF-SGD (green) which applies SGD global updates, and Fed-EF-AMS (blue), whose global optimizer is AMSGrad [46].
1: Input : learning rates η , η l , hyper β 1 , β 2 , ϵ 2: Initialize
; m
3: for t = 1 , . . .
, T do 4: parallel for worker i ∈
[ n ] do : 5:
Receive model parameter θ t from central server, set θ (1) t,i =
θ t 6: for k = 1 , . .
, K do 7:
Compute stochastic gradient g ( k ) t,i at θ ( k ) t,i 8:
Local update θ ( k +1) t,i
= θ ( k ) t,i − η l g ( k ) t,i 9: end for 10:
Compute the local model update ∆ t,i =
θ ( K +1) t,i − θ t 11:
Send compressed adjusted local model update (cid:101)
∆ t,i = C (∆ t,i + e t,i ) to central server 12:
Update the error e t +1 ,i =
e t,i + ∆ t,i − (cid:101) ∆ t,i 13: end parallel 14:
Central server do: 15:
Global aggregation (cid:101) ∆ t = 1 n (cid:80) ni =1 (cid:101) ∆ t,i 16:
Update the global model θ t +
=
θ t − η (cid:101)
∆ t ▷ Fed-EF-SGD 17: m
[Equation]
▷ Fed-EF-AMS 18:
[Equation]
Update the global model θ t [-+
-]+1 =
[Equation]
ˆ
[Equation]
ϵ 20: end for
In Fed-EF-AMS, by the nature of adaptive gradient methods, we incorporate momentum ( m t ) with different implicit dimension-wise learning rates η/ ˆ v t .
Additionally, for conciseness, the presented algorithm employs one-way compression (clients-to-server).
In Appendix D, we also provide a twoway compressed Fed-EF framework and demonstrate that adding the server-to-clients compression would not affect the convergence rates.
Comparison with prior work.
Compared with EF approaches in the classical distributed training, e.g., [54; 28; 68; 38; 16; 35], our algorithm allows local steps (more communication-efficient) and uses two-side learning rates.
When η ≡ 1 , the Fed-EF-SGD method reduces to QSparse-localSGD [6].
In Section 4, we will demonstrate how the two-side learning rate schedule improves the convergence analysis of the one-side learning rate approach [6].
On the other hand, several recent works considered compressed FL using unbiased stochastic compressors (all of which use SGD as the global optimizer).
FedPaQ [47] applied stochastic quantization without error feedback to local SGD, which is improved by [18] using a gradient tracking trick that, however, requires communicating an extra vector from server to clients, which is less efficient than Fed-EF.
[40] provided an empirical study on directly compressing the local updates using various compressors in Fed-SGD, while we use
EF to compensate for the bias.
[43] proposed FedLin, which only uses compression for synchronizing a local memory term but still requires transmitting full-precision updates.
Finally, to our knowledge,
Fed-EF-AMS is the first compressed adaptive FL method in literature.
T HEORETICAL R ESULTS
Assumption 1 (Smoothness) .
For ∀ i ∈ [ n ] , f i is L-smooth: ∥∇ f i ( x ) − ∇ f i ( y )
∥
≤ L ∥ x − y ∥ .
Assumption 2 (Bounded variance) .
For ∀ t ∈ [ T ] , ∀ i ∈ [ n ] , ∀ k ∈
[ K ] : (i) the stochastic gradient is unbiased:
Both assumptions are standard in the convergence analysis of stochastic gradient methods.
The global variance bound σ 2 g in Assumption 2 characterizes the difference among local objective functions, which, is mainly caused by different local data distribution X i in (1), i.e., data heterogeneity.
Assumption 3 (Compression discrepancy) .
There exists some q A < 1 such that E (cid:2) ∥ 1 n (cid:80) ni
=1 C (cid:0) ∆ t,i + e t,i (cid:1) − 1 n (cid:80) ni
=1 (∆ t,i + e t,i ) ∥ 2 (cid:3) ≤ q 2 A E (cid:2)
∥ 1 n (cid:80) ni =1 (∆ t,i + e t,i ) ∥ 2 (cid:3) in every round t ∈ [ T ] .
In Assumption 3, if we replace “the average of compression”, 1 n (cid:80) ni =1 C (cid:0) ∆ t,i + e t,i (cid:1) , by “the compression of average”, C (cid:0) 1 n (cid:80) ni =1 (∆ t,i + e t,i ) (cid:1) , the statement immediately holds by Definitionwith q A
= q C .
Thus, Assumption 3 basically says that the above two terms stay close during training.
This is a common assumption in related work on compressed distributed learning, for example, a similar assumption is used in [4] analyzing sparsified SGD.
In [18], for unbiased compression without
EF, a similar condition is also assumed with an absolute bound.
In Appendix B, we provide more discussion and empirical justification to validate this analytical assumption in practice.
4. C ONVERGENCE OF F ED -EF: L INEAR S PEEDUP U NDER D ATA H ETEROGENEITY
Theorem 1 (Fed-EF-SGD) .
Let θ ∗ =
arg min f ( θ ) , and denote q = max { q C , q A } , C 1 :
= 2 + 4 q 2 (1 − q 2 ) 2 .
Under Assumptions 1 to 3, when η l ≤
[Equation]
1) } , the squared gradient norm of
Fed-EF-SGD iterates in Algorithm 1 can be bounded by
[Equation]
In Theorem 1, the LHS is the expected squared gradient norm at a uniformly chosen global model from t = 1 , ..., T , which is a standard measure of convergence in non-convex optimization (i.e., “norm convergence”).
The first term is dependent on the initialization, the second term σ 2 comes from the local stochastic variance, and the last term represents the influence of data heterogeneity.
In general, we see that larger q (i.e., higher compression) would slow down the convergence.
In our analysis of Fed-EF-AMS, we will make the following additional assumption of bounded stochastic gradients, which is common in the convergence analysis of adaptive methods, e.g., [46; 69; 11; 35].
Note that this assumption is only used for Fed-EF-AMS, but not for Fed-EF-SGD.
Assumption 4.
(Bounded gradients)
It holds that ∥ g ( k ) t,i ∥ ≤ G , ∀ t > 0 , ∀ i ∈ [ n ] , ∀ k ∈ [ K ] .
We provide the first convergence analysis of compressed adaptive FL method as below.
Theorem 2 (Fed-EF-AMS) .
With same notations as in Theorem 1, let C 1 :=
β 1 1 − β 1 + 2 q 1 − q 2 .
Under Assumptions 1 to 4, if the learning rates satisfy η l ≤ √ ϵ 8 KL min (cid:8) 1 √ ϵ , 2(1 − q 2 ) L (1+ q 2 ) 1 . 5 G ,
[Equation]
[Equation]
[Equation]
1 3 η
[Equation]
3 (cid:9) , the Fed-EF-AMS iterates in Algorithm 1 satisfy
[Equation]
With some properly chosen learning rates
[Equation]
we have the following simplified results.
Corollary 1 (Fed-EF, specific learning rates) .
Suppose the conditions in Theorem 1 and Theoremare satisfied respectively.
Choosing η l = Θ( 1 K √ T ) and η = Θ( √ Kn )
[Equation]
Fed-EF-SGD satisfy
[Equation]
and for Fed-EF-AMS
[Equation]
it holds that
[Equation]
Discussion.
From Corollary 1, we see that when T ≥ K , Fed-EF-AMS and Fed-EF-SGD have the same rate of convergence asymptotically.
Therefore, our following discussion applies to the general Fed-EF scheme with both variants.
In Corollary 1, when T ≥ Kn , the global variance term σ 2 g vanishes and the convergence rate becomes O (1 / √ TKn ) .
Thus, the proposed Fed-EF enjoys linear speedup w.r.t.
the number of clients n , i.e., it reaches a δ -stationary point (i.e.,
T (cid:80) Tt =1 E (cid:2) ∥∇ f
( θ t )
∥ 2 (cid:3) ≤ δ ) as long as TK = Θ(1 /nδ 2 ) , which matches the recent results of the full-precision counterparts [60; 45] ([45] only analyzed the special case β 1 = 0 , while our analysis is more general).
The condition T ≥ Kn to reach linear speedup considerably improves
O ( K 3 n 3 ) of the federated momentum SGD analysis in [63].
In terms of communication complexity, by setting K = Θ(1 /nδ ) , Fed-EF only requires T = Θ(1 /δ ) rounds of communication to converge.
This matches one of the state-of-the-art FL communication complexity results of SCAFFOLD [27].
Comparison with prior related results.
As a special case of Fed-EF-SGD ( η ≡ 1 ) and the most relevant previous work, the analysis of QSparse-local-SGD [6] did not consider data heterogeneity, and their convergence rate O (1 / √ TK ) did not achieve linear speedup either.
Our new analysis improves this result, showing that EF can also match the best rate of using full communication in federated learning.
For FL with unbiased compression (without EF), the convergence rate of
FedPaQ [47] is also O (1 / √ TK ) .
[18] refined the analysis and algorithm of FedPaQ, which matches our O (1 /δ ) communication complexity.
To sum up, both Fed-EF-SGD and Fed-EF-AMS are able to achieve the convergence rates of the corresponding full-precision FL counterparts, as well as the state-of-the-art rates of FL with unbiased compression.
4. A NALYSIS OF F ED -EF U NDER P ARTIAL C LIENT P ARTICIPATION
Whilst being a popular strategy in classical distributed training, error feedback has rarely been analyzed under partial participation (PP), which is an important feature of FL.
Next, we provide new analysis and results of EF under this setting, considering both local steps and data heterogeneity in federated learning.
In each round t , assume only m randomly chosen clients (without replacement) indexed by M t ⊆
[ n ] are active and participate in training (i.e., changing i ∈ [ n ] to i ∈ M t at line 4 of Algorithm 1).
For the remaining ( n − m ) inactive clients, we simply set e t,i =
e t − 1 ,i , ∀ i ∈
[ n ] \ M t .
The convergence rate is given as below.
Theorem 3 (Fed-EF, partial participation) .
In each round, suppose m randomly chosen clients in M t participate in the training.
Under Assumptions 1 to 3, suppose the learning rates satisfy η
[Equation]
min
[Equation]
Fed-EF-SGD admits
[Equation]
6 Kσ 2 g ) , where C 1 = q 2 (1 − q 2 ) 3 and C ′ =
n − m n − 1 .
Choosing η = Θ( √ Km ) , η l = Θ( √ m K √ Tn ) , we have
[Equation]
Remark 1.
We present Fed-EF-SGD for simplicity.
With more complicated analysis, similar result applies to Fed-EF-AMS yielding the same asymptotic convergence rate as Fed-EF-SGD.
Remark 2.
When m = n (full participation), Theorem 3 recovers the O (1 / √ TKn ) rate in Corollary 1.
When q = 0 , we recover the O ( (cid:112) K/Tm ) rate of full-precision Fed-SGD under PP [60].
Effect of delayed error compensation.
The convergence rate in Theorem 3 involves m in the denominator, instead of n as in Corollary 1, which is a result of larger gradient estimation variance due to client sampling.
Compared with the O ( (cid:112) K/Tm ) rate of [60] for full-precision local SGD under PP, Theorem 3 is slower by a factor of (cid:112) n/m , which is a consequence of the mechanism of error feedback.
Intuitively, with full participation where each client is active in every round, EF itself can, to a large extent, be regarded as subtly “delaying” the “untransmitted” gradient information ( C (∆ t ) − ∆ t ) to the next iteration.
However, under partial participation, in each round t , the error accumulator of a chosen client actually contains the latest information from round t − s , where s can be viewed as the “lag” which follows a geometric distribution with E [ s ] = n/m .
In some sense, this shares similar spirit to the problem of asynchronous distributed optimization with delayed gradients (e.g., [1; 36]).
The delayed error information in Fed-EF under PP is likely to pull the model away from heading towards a stationary point (i.e., slower down the norm convergence), especially for highly non-convex loss functions.
In Section 5, we will propose a simple strategy to justify (and mitigate) the negative impact of this error staleness on the norm convergence empirically.
N UMERICAL S TUDY
We provide numerical results to show the efficacy of Fed-EF in communication-efficient FL problems and justify our theoretical analysis.
Due to space limitation, we include representative results here and place more results and experimental details in Appendix A.
Datasets.
We present experiments on two popular FL datasets.
The MNIST dataset [32] contains 60000 training examples and 10000 test samples of 28 × 28 gray-scale hand-written digits from 0 to 9.
The FMNIST dataset [59] has the same input size and train/test split as MNIST, but the samples are fashion products (e.g., clothes and bags).
More results on CIFAR dataset are included in Appendix A.
Federated setting.
In our experiments, we test n = 200 clients.
The clients’ local data are set to be highly non-iid (heterogeneous), where we restrict the local data samples of each client to come from at most two classes.
We run T = 100 rounds, where one FL training round is finished after all the clients have performed one epoch of local training.
The local mini-batch size is 32 , which means that the clients conduct 10 local iterations per round.
Regarding partial participation, we uniformly randomly sample m clients in each round.
We present the results at multiple sampling proportion p = m/n (e.g., p = 0 .
1 means choosing 20 active clients per round).
To measure the communication cost, we report the accumulated number of bits transmitted from the client to server (averaged over all clients), assuming that full-precision gradients are 32 -bit encoded.
Methods and compressors.
For both Fed-EF variants, we implement Sign compressor, and TopK compressor with compression rate k ∈ { 0 . 001 , 0 . 01 , 0 . 05 } .
We also employ a more compressive strategy heavy-Sign where Sign is applied after TopK (i.e., a further 32 x compression over TopK under same sparsity).
We test hv-Sign with k ∈ { 0 . 01 , 0 .
We compare our method with the analogue FL approach using full-precision updates, and the analogue algorithms of Fed-EF using unbiased stochastic quantization “Stoc” without error feedback [3].
For this compressor, we test parameter b ∈ { 1 , 2 , 4 } .
For SGD, this algorithm is equivalent to FedCOM/FedPaQ [47; 18].
5. F ED -EF M ATCHES F ULL -P RECISION FL WITH S UBSTANTIALLY L ESS C OMMUNICATION
Firstly, we demonstrate the superior performance of Fed-EF in practical FL tasks.
For both datasets, we train a ReLU activated CNN with two convolutional layers followed by one max-pooling, one dropout and two fully-connected layers before the softmax output.
In Figure 2 and Figure 3, we compare our method with Stoc without EF with p = 0 .
5 and p = 0 . 1 , respectively.
We have tested each compressor with multiple compression ratios, see Appendix A for the complete results.
Here, we present curves (respective compression ratios) chosen by the following rule: for each method, we present the curve with highest compression level that achieves the best full-precision test accuracy; if the method does not match the full-precision performance, we present the curve with the highest test accuracy.
From Figure 2 and Figure 3, we see that:
• In general, higher compression ratio leads to worse performance, as expected from the theory.
The proposed Fed-EF (including both variants) is able to achieve the same performance as the full-precision methods with substantial communication reduction, e.g., hv-Sign and TopK reduce the communication by more than 100x without losing accuracy.
Sign also provides 30x compression with matching accuracy as full-precision training.
• On MNIST, the loss and accuracy of Stoc (stochastic quantization without EF) tend to be slightly worse than Fed-EF-SGD with hv-Sign , yet requiring more communication.
• With more aggressive p = 0 .
1 , with proper compressor, Fed-EF still matches the performance of full-precision algorithms.
While Sign performs well on MNIST for both Fed-EF
[Figure] [Figure] [Figure] variants, we notice that fixed sign-based compressors ( Sign and heavy-Sign ) are considerably outperformed by TopK for Fed-EF-AMS on FMNIST.
We conjecture that this is because with small participation rate, sign-based compressors tend to assign a same implicit learning rate across coordinates (controlled by the second moment ˆ v ), making adaptive method less effective.
In contrast,magnitude-preserving compressors (e [Figure] g., TopK and Stoc ) may better exploit the adaptivity of AMSGrad.
5. A NALYSIS OF N ORM C ONVERGENCE AND D ELAYED E RROR C OMPENSATION
We empirically evaluate the norm convergence to verify the theoretical speedup properties of Fed-EF and the effect of delayed error compensation in partial participation (PP).
Recall that from Theorem 1, in full participation case, reaching a δ -stationary point requires running Θ(1 /nδ 2 ) rounds of Fed-EF (i.e., linear speedup).
From Theorem 3, when n is fixed, our result implies that the speedup should be super-linear against m , the number of participating clients, due to the additional stale error effect.
In other words, altering m is expected to have more impact on the convergence under PP.
We train an MLP (which is also used for Figure 1) with one hidden layer of 200 neurons.
In Figure 4, we report the squared gradient norm and the training loss on MNIST under the same non-iid FL setting as above (the results on FMNIST are similar).
In the full participation case, we implement
Fed-EF-SGD with n = 20 , 40 , 60 , 100 clients; for the partial participation case, we fix n = 200 and
[Figure] [Figure]
alter m = 20 , 40 , 60 , 100 .
According to our theory, we set η = 0 .
1 √ n (or 0 . 1 √ m )
and η l = 0 .
We see that: 1) In general, the convergence of Fed-EF is faster with
increasing n or m , which confirms the speedup property; 2)
The gaps among curves in the PP setting (the 2nd and 4th plot) is larger than those in the full-participation case (the 1st and 3rd plot), which suggests that the acceleration brought by increasing m under PP is more significant than that of increasing n in full-participation by a same proportion, which is consistent with our theoretical implications
To further embody the intuitive impact of delayed error compensation under PP, we test a simple strategy called “error restarting” : for each client i in round t , if the error accumulator was last updated more than S (a threshold) rounds ago (i.e., before round t − S ), we simply restart the error accumulator by setting e t = 0 , which effectively eliminates the error information that is “too old”.
In
Figure 5, we first run Fed-EF for 50 rounds, and then apply error restarting with threshold S = 10 .
As we see, after prohibiting heavily delayed error information, the gradient norm is smaller than that of continuing running standard Fed-EF, i.e., the model finds a stationary point faster.
These results illustrate the influence of stale error compensation in Fed-EF, and that properly handling this staleness might be a promising direction for improvement in the future.
D ISCUSSION AND C ONCLUSION
We propose Fed-EF, a Federated Learning (FL) framework with compressed communication and
Error Feedback (EF).
Two variants, Fed-EF-SGD and Fed-EF-AMS, are designed based on the choice of the global optimizer.
Theoretically, we present convergence analysis in non-convex optimization showing that Fed-EF achieves the same convergence rate as the full-precision FL counterparts, which improves upon previous results.
The Fed-EF-AMS variant is the first compressed adaptive FL method in literature.
Moreover, we develop new analysis of error feedback in distributed training systems under the partial participation setting.
We prove an additional slow down factor related to the participation rate due to the delayed error compensation of the EF mechanism.
Experiments validate that compared with full-precision training, Fed-EF achieves significant communication reduction without performance drop.
We also present numerical results to justify the theory and provide intuition regarding the impact of the delayed error feedback on the norm convergence of Fed-EF.
Our work supports the effectiveness of error feedback in federated learning, and provide insight on its convergence under practical FL setting with partial participation.
Our paper expands several interesting future directions, e.g., to improve Fed-EF by other tricks, especially under partial participation, and to study more closely the property of different compressors.
More mechanisms in
FL (e.g., variance reduction, fairness) can also be incorporated into our Fed-EF scheme.
C ONTENTS A Experiment Details, Algorithms and More Results
A.1 Biased Compression Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2 Competing Methods: Stochastic Quantization Without Error Feedback . . . . . . .
A.3 Results on CIFAR-10 Trained by ResNet-18 . . . . . . . . . . . . . . . . . . . . .
A.4 More Results on MNIST and FMNIST . . . . . . . . . . . . . . . . . . . . . . . .
A.5 Data Split and Parameter Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . .
B Compression Discrepancy
B.1 Simulated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.2 Real-world Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C Proof of Convergence Results
C.1 Proof of Theorem 2: Fed-EF-AMS . . . . . . . . . . . . . . . . . . . . . . . . . .
C.2 Proof of Theorem 1: Fed-EF-SGD . . . . . . . . . . . . . . . . . . . . . . . . . .
C.3 Intermediate Lemmas . .
C.4 Proof of Theorem 3: Partial Participation . . . . . . . . . . . . . . . . . . . . . . .
D Two-Way Compression in Fed-EF
A E XPERIMENT D ETAILS , A LGORITHMS AND M ORE R ESULTS
In this section, we provide more theoretical justification of the compressors, and more implementation details of the empirical results.
A. B IASED C OMPRESSION O PERATORS
In our Fed-EF, the biased compressors are implemented as follows.
Sign is implemented exactly following Definition 1.
For TopK , we also apply it in a “layer-wise” manner.
Let k denote the proportion of coordinates selected.
For each layer with d i parameters, we pick max(1 , ⌊ kd i ⌋ ) gradient dimensions.
The maximum operator avoids the case where a layer is never updated.
The heavy-Sign is implemented by first applying TopK (per layer) and then applying Sign .
For completeness, we provide more theoretical details of the biased compression operators, TopK ,
Sign and heavy-Sign .
Recall in Definition 1 that ∥C ( x ) − x ∥ 2 ≤ q 2 C ∥ x ∥ 2 for some q C < 1 .
We first justify that TopK and Sign are both valid compressors.
In the sequel, ∥ · ∥ always denotes the lnorm and ∥ · ∥ 1 is the l 1 norm.
Proposition A.1 is well-known (e.g., [54; 68]), and we provide the proof for clarity.
Again, note that in TopK , k is the compression rate, which is the fraction, instead of the number, of selected coordinates.
Proposition A.1.
For the TopK compressor which selects top k -percent of coordinates, we have q 2 C = 1 − k .
For the (Group) Sign compressor, q 2 C = 1 − min i ∈
[ M ] 1 d i .
Proof.
For TopK , the proof is trivial: since C ( x ) − x only contain (1 − k ) d coordinates with lowest magnitudes, we know ∥ C ( x ) − x ∥ 2 / ∥ x 2 ∥ ≤ 1 − k .
For Sign , recall that I i is the index set of block (group) i .
By definition, for the i -th block (group) x I i ∈
R
d
i , we have
[Equation]
Since we have M blocks, concatenating the blocks leads to
[Equation]
where the last inequality is because l 1 norm is larger than l 2 norm.
We now show that heavy-Sign is also a valid compressor.
Proposition A.2.
The heavy-Sign compressor satisfies Definition 1 with q 2 C = 1 − min i ∈
[ M ] kd i .
Proof.
Let C k denote the TopK compressor and C s be the Sign operator.
Thus, the heavy-Sign operator can be expressed as C ( x ) =
C s (cid:0) C k ( x ) (cid:1) .
It holds that
[Equation]
because TopK zeros out the unpicked coordinates.
By Proposition A.1, we continue to obtain
[Equation]
where we use the fact that ∥C k ( x ) ∥ 2 + ∥C k ( x ) − x ∥ 2 = ∥ x ∥ 2 , and ∥C ( x ) ∥ ≥ k ∥ x ∥ 2 by Proposition A.1.
This completes the proof.
A. C OMPETING M ETHODS : S TOCHASTIC Q UANTIZATION W ITHOUT E RROR F EEDBACK
Compute
Local
= θ ( k ) t
− η l g (
Compute
− θ t 11: : end [Equation] Update the global model θ t +1 =
[Equation]
▷ Stoc with SGD 16:
[Equation]
▷ Stoc with AMSGrad 17:
[Equation]
Update the global model θ t +1 = θ
[Equation]
+ ϵ 19: end for
In Algorithm 2, for completeness, we give the details of the competing method, called Stoc , in our experiments.
Instead of using the error feedback scheme, this method directly compresses the transmitted vector from clients to server by unbiased stochastic quantization Q ( · ) proposed by [3].
For a vector x ∈ R d , the operator Q ( · ) is defined as
[Equation]
where b ≥ 1 is number of bits per non-zero entry of the compressed vector Q ( x ) .
Suppose 0 ≤ l < 2 b − 1 is the integer such that | x i | / ∥ x ∥ is contained in the interval [ l/ 2 b − 1 , ( l + 1) / 2 b − 1 ] .
The random variable ξ ( x, b ) is defined by
[Equation]
with probability 1 − g ( | x i | ∥ x ∥ , b ) , ( l + 1) /s, otherwise , with g ( a, b ) = a · 2 b − 1 − l for a ∈ [0 , 1] .
Simply, 0 is always quantized to 0.
The Stoc quantizer is unbiased, i.e., E [ Q ( x ) | x ] = x .
In addition, it also introduces sparsity to the compressed vector in a probabilistic way, with E [ ∥Q ( x ) ∥ 0 ] ≤ 2 b + 2 b − 1 √ d .
Stoc also has two corresponding variants, one using SGD and one using AMSGrad as the global optimizer.
For the SGD variant, Stoc is equivalent to the FedCOM method in [18], which is also the
FedPaQ algorithm [47] with tunable global learning rate.
For the full-precision algorithms, we simply set (cid:101) ∆ t,i =
∆ t,i in line 11 of Algorithm 2.
For SGD, it becomes the one studied in [60] which is the standard local SGD [42] with global learning rate.
For adaptive optimizer, it becomes FedAdam [45].
Note that [45] used Adam, while we use AMSGrad (with the max operation).
Empirically, the performance of these two options are fairly similar.
A. R ESULTS ON CIFAR-10 T RAINED BY R ES N ET -
We present more experiment results of Fed-EF on the task of CIFAR-10 [31] image classification.
This dataset contains 50000 natural images of size 32 × 32 each with 3 RGB channels.
There are 10 classes, e.g., airplanes, cars, cats, etc.
We follow a standard strategy for CIFAR-10 dataset to pre-process the training images by a random crop, a random horizontal flip and a normalization of the pixel values to have zero mean and unit variance.
For test images, we only apply the normalization step.
For this experiment, we train a ResNet-18 [20] network for 200 rounds.
The clients local data are distributed in the same way as described in Section 5, which is highly non-iid.
[Figure] In Figure [Figure] we plot the test accuracy of Fed-EF with different compressors, and Stoc without EF.
Again, we see that Fed-EF (both variants) is able to attain the same accuracy level as the corresponding full-precision federated learning algorithms.
For Fed-EF-SGD, the compression rate is around 32x for Sign , 100x for TopK and ∼ 300x for heavy-Sign .
For Fed-EF-AMS, the compression ratio can also be around hundreds.
Note that for Fed-EF-AMS, the training curve of TopK-0.001 is not stable.
Though it reaches a high accuracy, we still plot TopK-0.01 in the third column for comparison.
[Figure] In Figure 7 we report the results for aggressive partial participation with p = 0 .
Similarly, for SGD, all three compressors are able to match the full-precision accuracy, with significantly reduced number of communicated bits.
For Fed-EF-AMS, similar to the observations on FMNIST, we see that TopK outperforms Sign and heavy-Sign , and matches the performance of full-precision method with 100x compression ratio.
Sign also performs reasonably well.
[-Update the global model θ t +
-]
In conclusion, our results on CIFAR-10 and ResNet again confirm that compared with standard full-precision FL algorithms, the proposed Fed-EF scheme can provide significant communication reduction without performance drop, under data heterogeneity and partial participation.
A. M ORE R ESULTS ON MNIST AND FMNIST
We provide the complete set of experimental results on each method under various compression rates.
In Table 1 - Table 4, for completeness we report the average test accuracy at the end of training and the standard deviations (over 5 independent runs), corresponding to the curves (compression parameters) in Figure 2 and Figure 3.
Figure 8 to Figure 11 present the results for participation rate p = 0 . 5 , and Figure 12 to Figure 15 report the results for p = 0 . [Table] [Table]
[Table]
[Table]
A. D ATA S PLIT AND P ARAMETER T UNING
In our experiments, for n = 200 clients, we first split the training samples into 2 n = 400 shards, where each shard contains samples from only one class.
Then, each client is randomly assigned with two shards uniformly.
This way, in expectation, around 180 clients would have samples from two classes, and about 20 clients would have samples from only one class.
This corresponds to a strong data heterogeneity among the clients.
For the hyper-parameter of the compressors (i.e., the compression rate), we test k ∈ { 0 .
001 , 0 . 01 , 0 . 05 } for TopK , k ∈ { 0 . 01 , 0 . 05 , 0 . 1 } for heavy-Sign and b ∈ { 1 , 2 , 4 } for Stoc .
For the AMSGrad optimizer, we set β 1 = 0 .
9 , β 2 = 0 .
999 and ϵ = 10 − 8 as the recommended default [46].
For each method, we tune η over { 10 − 4 , 10 − 3 , 10 − 2 , 10 − 1 , 1 , 10 } and η l over { 10 − 4 , 10 − 3 , 10 − 2 , 10 − 1 , 1 } .
We found that the compressed methods usually have same optimal learning rates as the full-precision training.
The best learning rate combinations achieving highest test accuracy are given in Table 5.
[Table]
[Equation]
[Table] [Equation] [Table]
[Figure] [Figure]
[Figure] [Figure] [Figure]
[Figure] [Figure]
[Figure]
B C OMPRESSION D ISCREPANCY
In our theoretical analysis for Fed-EF, Assumption 3 is needed, which states that E [ ∥ 1 n (cid:80) ni =1 C (cid:0) ∆ t,i + e t,i (cid:1) − 1 n (cid:80) ni =1 (∆ t,i + e t,i ) ∥ 2 ] ≤ q 2 A E [ ∥ 1 n (cid:80) ni
=1 (∆ t,i + e t,i ) ∥ 2 ] for some q A < 1 during training.
In the following, we justify this assumption to demonstrate how it holds in practice.
To study sparsified
SGD, [4] also used a similar and stronger (uniform bound instead of in expectation) analytical assumption.
As a result, our analysis and theoretical results are also valid under their assumption.
Please see more related discussion therein.
B. S IMULATED D ATA
We first conduct a simulation to investigate how the two compressors, TopK and Sign , affect q A .
In our presented results, for conciseness we use n = 5 clients and model dimensionality d = 1100 .
Similar conclusions hold for much larger n and d .
We simulate two types of gradients following normal distribution and Laplace distribution (more heavy-tailed), respectively.
Examples of the simulated gradients are visualized in Figure 16 and Figure 17.
To mimic non-iid data, we assume that each client has some strong signals (large gradients) in some coordinates, and we scale those gradients by a scaling factor s = 2 , 10 , 100 .
Conceptually, larger s represents higher data heterogeneity.
[Figure]
02 G r ad i en t
[Figure]
G r ad i en t
[Figure] [Figure]
have heavier tail than normal distribution.
Larger s implies higher data heterogeneity.
[Figure]
where δ ( x ) = 1 n (cid:80) ni =1 C (∆ t,i + e t,i ) and x = 1 n (cid:80) ni =1 (∆ t,i + e t,i ) . The dashed curves are respectively the compression coefficients q 2 C from Definition 1, which is calculated by replacing δ ( x ) =
C ( 1 n (cid:80) ni =1 ∆ t,i + e t,i ) . We see that in all cases, q A < 1 .
We apply the TopK-0.1 and Sign compressor in Definition 1 to the simulated gradients, and compute the averaged q 2 A in Figure 18 over 10 5 independent runs.
The dashed curves are respectively the “ideal” compression coefficients q C such that E [ ∥C (cid:0) 1 n (cid:80) ni
=1 ∆ t,i + e t,i (cid:1) − 1 n (cid:80) ni
=1 (∆ t,i + e t,i )
∥ 2 ] ≤ q 2 C E [ ∥ 1 n (cid:80) ni
=1 (∆ t,i + e t,i ) ∥ 2 ] from Definition 1.
We see that in all cases, q A is indeed less than 1.
This still holds even when the data heterogeneity increases to as large as 100.
B. R EAL - WORLD D ATA
We report the empirical q A values when training CNN on MNIST and FMNIST datasets.
The experimental setup is the same as in Section 5.
We present the result in Figure 19 with η = 1 , η l = 0 .
under the same heterogeneous setting where client data are highly non-iid.
The plots for other learning rate combinations and iid data are similar.
In particular, we see for both compressors and both datasets, the empirical q A is well-bounded below 1 throughout the training process. [Figure] i [Figure]
i c
[Figure]
l q
[Figure]
MNISTFMNIST
C P ROOF OF C ONVERGENCE R ESULTS
In this section, we provide the proof of the convergence rates of Fed-EF.
For illustrative purpose, we first present the proof for the more complicated Fed-EF-AMS in Section C.1, and the proof of
Fed-EF-SGD would follow in Section C.2.
Section C.3 contains intermediary lemmas and Section C. provides the analysis of Fed-EF in partial participation.
C. P ROOF OF T HEOREM 2: F ED -EF-AMS
Proof.
We first clarify some notations.
At round t , let the full-precision local model update of the i -th worker be ∆ t,i , the error accumulator be e t,i , and denote (cid:101)
∆ t,i =
C ( g t,i + e t,i ) .
Define ¯∆ t = 1 n (cid:80) ni
=1 ∆ t,i , (cid:101) ∆ t = 1 n (cid:80) ni
=1 (cid:101) ∆ t,i and ¯ e t = 1 n (cid:80) ni
=1 e t,i .
The second moment computed by the compressed local model updates is denoted as v t = β 2 v t − 1 + (1 − β 2 ) (cid:101) ∆ 2 t , and ˆ v t = max { ˆ v t − 1 , v t } .
Also, the first order moving average sequence
[Equation]
and m
[Equation]
t = β
[Equation] m [Equation] − β 1 ) ¯∆ t , where m ′ t represents the first moment moving average sequence using the uncompressed local model updates.
By construction we have m ′ t
= (1 − β 1 ) (cid:80) tτ
= 1 β t − τ¯∆ τ .
Our proof will use the following auxiliary sequences: for round t
= 1 , ..., T ,
E t +1 :
= (1 − β 1 ) t +1 (cid:88) τ
= β t +1 − τ¯ e τ ,
[Equation]
Then, we can write the evolution of θ ′ t as
[Equation]
where (a) uses the fact of error feedback that for every i ∈ [ n ] , (cid:101) ∆ t,i + e t
+1 ,i =
∆ t,i + e t,
i
[Equation]
and e t, 1 = 0 at initialization.
Further define the virtual iterates:
[Equation]
which follows the recurrence:
[Equation]
The general idea is to study the convergence of the sequence x t
[Equation]
and show that the difference between x t and θ t (of interest) is small.
First, by the smoothness Assumption 1, we have
[Equation]
Taking expectation w.r
[Equation]
t. the randomness at round t and re-arranging terms
[Equation]
we obtain
E [ f ( x t +1 )] − f ( x t
[Equation]
Bounding term I.
We have
[Equation]
where we use Assumption 4 on the stochastic gradient magnitude.
The last inequality holds by simply bounding the aggregated local model update by
[Equation]
and the fact that for any vector in R d , the l 2 norm is upper bounded by the l 1 norm.
Regarding the first term in (4)
[Equation]
we have
[Equation]
where (a) uses Lemma C.6 and (b) is due to Assumption 2 that g ( k ) t,i is an unbiased estimator of ∇ f i ( θ ( k ) t,i ) .
To bound term V
[Equation]
we note the inequality that ⟨ a, b ⟩ ≤ α 2 a 2 + 12 α b 2 for any a, b ∈ R and α > 0 .
Therefore
[Equation]
we have
[Equation]
where the last inequality is a result of the L -smoothness assumption on the loss function
f i ( x ) .
Applying Lemma C.1 to the consensus error, we can further bound term V by
[Equation]
when we choose η l ≤ 1 8 KL .
Further, if we set η l ≤
[Equation]
, we have
[Equation]
Hence, we can establish from (4) that
[Equation]
Bounding term II.
By Lemma C.5, we know that ∥E t ∥ ≤ 2 η l qKG 1 − q 2 , and by Lemma C.3,
∥ m ′ t ∥ ≤ η l KG .
Thus, we have
[Equation]
where C 1 := β 1 1 − β 1 + 2 q 1 − q
[Equation]
and the second inequality is due to the smoothness of f ( θ ) .
Bounding term III.
This term can be bounded as follows:
[Equation]
where we apply Lemma C.2 and use similar argument as in bounding term II
[Equation]
Bounding term IV.
Lastly, for term IV
[Equation]
we have for some ρ > 0 ,
IV
[Equation] [Equation]
9) where (a) is a consequence of Young’s inequality ( ρ will be specified later) and the smoothness
Assumption 1, and (b) is based on Lemma C.2.
Now that we have bounded all four terms in (3), the next step is to gather the ingredients by taking the telescope summation over t = 1 , ..., T .
Before moving on, for the ease of presentation, we first do this for the third term in (9).
For this term, according to Lemma C.3 and Lemma C.5, summing over t = 1 , ..., T , we conclude
[Equation]
with C 2 :=
β
[Equation] [Equation]
+
[Equation] [Equation]
Putting together.
We are in the position to combine pieces together to get our final result by integrating (5), (6), (7), (9) and (10) into (3) and taking the telescoping sum over t = 1 , ..., T .
After re-arranging terms, when η l ≤ min (cid:8) 1 8 KL , (
[Equation]
q
[Equation]
(1+
[Equation] [Equation]
[Equation]
KG (cid:9) , we have
[Equation]
where
[Equation]
where to bound Υ 1 we use the fact that η l ≤ 1 8 KL .
We now look at the upper bound (12) of Υ 1 which contains 5 terms.
In the following, we choose ρ ≡ Lη in (9) and (10).
Suppose we choose ϵ < 1 .
Then, when the local learning rate satisfies
[Equation]
, each of the last four terms can be bounded by ηη l K 48 √ ϵ .
Thus, under this learning rate setting,
[Equation]
Taking the above into (11)
[Equation]
we arrive at ηη
[Equation]
where Lemma C.7 on the difference sequence D t is applied.
Consequently, we have
[Equation]
where we make simplification at the second inequality using the fact that C 1 ≤ C 21 since C 1 ≥ 1 .
Moreover, (cid:101) Υ 2 and (cid:101) Υ 3 is defined as (recall that we have chosen ρ ≡ Lη )
[Equation]
Finally, to connect the virtual iterates x t with the actual iterates θ t , note that x 1 = θ 1 , and f ( x T +1 ) ≥ f ( θ ∗ ) since θ ∗ = arg min θ f ( θ ) .
Replacing (cid:101) Υ 2 and (cid:101) Υ 3 with above upper bounds, this eventually leads to the bound
[Equation]
which gives the desired result.
Here we use the fact that C 2 ≤ C 21 .
This completes the proof.
C. P ROOF OF T HEOREM 1: F ED -EF-SGD
Proof.
Now, we prove the variant of Fed-EF with SGD as the central server update rule.
The proof follows the same routine as the one for Fed-EF-AMS, but is simpler since there are no moving average terms that need to be handled.
Note that for this algorithm, we do not need Assumptionthat the stochastic gradients are uniformly bounded.
For Fed-EF-SGD, consider the virtual sequence
[Equation]
where the second last equality follows from the update rule that ˜∆ t,
[Equation]
+ e t
+1 ,i =
∆ t,i + e t,i for all i ∈
[ n ] and t ∈ [ T ] .
By the smoothness Assumption 1, we have
[Equation]
Taking expectation w.r.t.
the randomness at round t gives
[Equation]
We can bound the first term in (14) using similar technique as bounding term I in the proof of
Fed-EF-AMS.
Specifically, we have
[Equation]
Note that the second term in the above can be bounded in the same way as bounding term V in
Fed-EF-AMS (without the √ ϵ factor).
Thus, with η l ≤ 1 8 KL we have − η E (cid:2)
[Equation]
The second term in (14) can be bounded using Lemma C
[Equation]
2 as
[Equation]
The last term in (14) can be bounded similarly as VI in Fed-EF-AMS by
[Equation]
where (a) uses Young’s inequality and (b) uses Lemma C.2 and Lemma C.4.
When taking telescoping sum of this term over t =
[Equation]
..., T , again using the geometric summation trick, we further obtain η
T (cid:88) t =
[Equation]
where C 1 = 1 + 4 q
[Equation]
1 − q 2 ) 2 .
Now, taking the summation over all terms in (14), we get
[Equation]
Since η l ≤ 1 8 KL
[Equation]
we know that 60 η 2 l K 2 L 2 + 1 < 2 .
Therefore, provided that the local learning rate is such that
[Equation]
we have ηη
[Equation] [Equation]
leading to
[Equation]
which concludes the proof
[Equation]
C. I NTERMEDIATE L EMMAS
In our analysis
[Equation]
we will make use of the following lemma on the consensus error.
Note that this is a general result holding for algorithms (both Fed-EF-SGD and Fed-EF-AMS) with local SGD steps.
Lemma C.1 ([45]) .
For η l ≤ 1 8 LK , for any round t , local step k ∈ [ K ] and client i ∈ [ n ] , under
Assumption 1 to Assumption 2, it holds that
[Equation]
We then state some results that bound several key ingredients in our analysis.
Lemma C.2.
Recall ¯∆ t = 1 n (cid:80) ni
=1 ∆ t,i .
Under Assumption 1 to Assumption 2, for ∀ t , the following bounds hold:
Bound by local gradients:
[Equation]
Bound by global gradient:
[Equation]
Proof.
By definition
[Equation]
we have
[Equation]
where the second line is due to the variance decomposition
[Equation]
and the last line is a result of Assumptionthat the stochastic gradients are independent and unbiased.
This proves the first part.
For the second part, note that
[Equation]
≤ 2 η
[Equation]
E
[Equation]
∥∇ f
[Equation]
θ t
[Equation]
2 η
[Equation]
n
[Equation]
∥ n (cid:88)
[Equation]
[Table]
[Equation]
[Table]
[Equation]
≤
[Equation]
η
[Equation]
E
[Equation] ∥∇ [Equation] θ
[Equation]
∥ [Equation] 2 η [Equation]
n
[Equation]
∥ n
[Table]
i
[Table]
[Equation]
[Table]
[Equation]
(cid:125)
[Equation]
The expectation A can be further bounded as
[Equation]
where (a) is implied by Assumption 2 that each local stochastic gradient g ( k ) t
[Equation]
i can be written as g ( k ) t,i = ∇ f i ( θ ( k ) t,i ) + ξ ( k ) t,i , where ξ k t,i is a zero-mean random noise with bounded variance σ
[Equation]
and all the noises for t ∈ [ T ] , i ∈ [ n ] , k ∈ [ K ] are independent.
The inequality (b) is due to the smoothness
Assumption
[Equation]
and (c) follows from Lemma C.1.
Therefore, we obtain
[Equation]
which completes the proof of the second claim.
Lemma C.3.
Under Assumption 1 to Assumption 2 we have:
[Equation]
Proof.
For the first part, by Assumption 4 we know that
[Equation]
For the second claim [Equation] by Lemma C.2 we know that
[Equation]
Let ¯∆ t,j denote the j -th coordinate of ¯∆ t .
By the updating rule of Fed-EF, we have
[Equation]
where (a) is due to Cauchy-Schwartz inequality.
Summing over t = 1 , ..., T , we obtain
T (cid:88) t =
[Equation]
n
[Equation]
which concludes the proof
[Equation]
Lemma C
[Equation]
Under Assumption
[Equation]
we have for ∀ t and each local worker ∀ i ∈ [ n ] ,
[Equation]
Proof.
To prove the second claim
[Equation]
we start by using Assumption 3 and Young’s inequality to get
[Equation]
where (16) is derived by choosing ρ = 1 − q 2 2 q 2 and the fact that q < 1 .
Now by recursion and the initialization e 1 ,i = 0 , ∀ i , we have
[Equation]
which proves the second argument, where we use Lemma C.1 to bound the local local model update.
In addition, we know that ∥ ∆ t ∥ ≤ η l KG by Assumption 4 for any t .
The absolute bound ∥ e t,i ∥ 2 ≤ 4 η 2 l q 2 C K 2 G 2 (1 − q 2 C )follows from (16) by a similar recursion argument used on local error e t,i , and the fact that q C ≤ max { q C , q A }
= q .
Lemma C.5.
For the moving average error sequence E t , it holds that
[Equation]
for
[Equation]
Proof.
The first argument can be simply deduced by the definition of E t that
[Equation]
Denote the quantity
[Equation]
By the same technique as in the proof of Lemma C.3, denoting ¯ e t,j as the j -th coordinate of ¯ e t , we can bound the accumulated error sequence by
[Equation]
where (a) is due to Cauchy-Schwartz inequality and (b) is a result of Lemma C.4.
Summing over t = 1 , ...
[Equation]
T and using the technique of geometric series summation leads to
T (cid:88) t =
[Equation]
The desired result is obtained.
Lemma C.6.
It holds that ∀ t ∈ [ T ] , ∀ i ∈
[ d ] , ˆ v t,i ≤ 4 η 2 l (1+ q 2 ) 3 K 2 (1 − q 2 )
G 2 .
Proof.
For any t , by Lemma C.4 and Assumption 4 we have
[Equation]
Consider the updating rule of ˆ v t = max { v t , ˆ v t − 1 } .
We know that there exists a j ∈ [ t ] such that ˆ v t = v j .
Thus, we have
[Equation]
which proves the claim.
Lemma C.7.
Let D t :=
[Equation]
ϵ be defined as above.
Then,
[Equation]
Proof.
By the updating rule of Fed-EF-AMS, ˆ v t − 1 ≤ ˆ v t for ∀ t .
Therefore, by the initialization ˆ v 0 = 0 , we have
[Equation]
For the sum of squared l 2 norm, note the fact that for a ≥ b > 0 , it holds that
[Equation]
Thus,
T
[Equation]
which gives the desired result.
C. P ROOF OF T HEOREM 3: P ARTIAL P ARTICIPATION
Proof.
We can use a similar proof structure as previous analysis for full participation Fed-EF-SGD as in Section C.2.
Like before
[Equation]
we first define the following virtual iterates:
[Equation]
Here, (17) follows from the partial participation setup where there is no error accumulation for inactive clients.
The smoothness of loss functions implies
[Equation]
Taking expectation w.r
[Equation]
t. the randomness at round t , we have
[Equation]
Note that the expectation is also with respect to the randomness in the client sampling procedure.
For the first term, since the client sampling is random, we have E [ ¯∆ t, M t ] =
E [ ¯∆ t ] .
Thus,
I
[Equation]
η l ≤
[Table]
KL , where (a) is a result of the fact that ⟨ z 1 , z 2 ⟩ = ∥
z 1 ∥ 2 + ∥ z 2 ∥ 2 − ∥
z 1 − z 2 ∥ 2 , (b) is because of Lemma C.1.
For term II, we have
II ≤ η 2 η 2 l KL
[Equation]
with C ′ = n − m n − 1 .
Furthermore, we have that
[Equation]
The second term is the same as term II.
We now bound the first term.
Denote ˜ e t,i =
e t,i +∆ t,i − (cid:101) ∆ t,i , we have
E
[Equation]
By the updating rule of e t,i , the inner expectation, conditional on e t = ( e t, 1 , ..., e t,n ) T , can be computed as
[Equation]
Therefore
[Equation]
by Definition 1 and Assumption 3 we obtain
[Equation]
We have by Lemma C.1 that
[Equation]
which implies
[Equation]
Recall q = max { q A , q C } .
Let γ = (1 − q 2 ) / 2 q 2 .
We have
[Equation]
By the recursion argument used before
[Equation]
applying Lemma C.2 (adjusted by a n 2 /m 2 factor) we obtain
E
[Equation]
Summing over t = 1 , ..., T gives
T (cid:88)
[Equation]
=
[Equation]
Now we turn back to (18).
By taking the telescoping sum, we have
E [ f ( x t +1 )] − f ( x 1 ) ≤ − ηη l K
T (cid:88) t =
E (cid:2) ∥∇ f ( θ t ) ∥ 2 (cid:3) + 5 Tηη 3 l K 2 L ( σ 2 + 6 Kσ 2 g ) − ηη l 2 Kn
T (cid:88) t =
E (cid:2)
∥ n (cid:88) i =
K (cid:88) k
= ∇ f i ( θ ( k ) t,i ) ∥ 2 (cid:3)
+ Tη 2 η 2 l KL m σ 2 + η 2 η 2 l L n ( n − 1)
T (cid:88) t =
E (cid:2)
∥ n (cid:88) i =
K (cid:88) k
= ∇ f i ( θ ( k ) t,i ) ∥ (cid:3)+ 3 η 2 η 2 l C
′ K 2 L (30 η 2 l K 2 L 2 + 1) m
T (cid:88) t =
E (cid:2) ∥∇ f ( θ t ) ∥ 2 (cid:3) + 15 Tη 2 η 4 l C
′ K 3 Lm ( σ 2 + 6 Kσ 2 g )
+ 3 Tη 2 η 2 l C
′ K 2 L m σ 2 g + 8 η 2 η 2 l q 2 L (1 − q 2 ) 2 m
T (cid:88) t =
E (cid:2)
∥ n (cid:88) i =
K (cid:88) k
= ∇ f i ( θ ( k ) t,i ) ∥ 2 (cid:3) + 8 Tη 2 η 2 l q 2 KLn (1 − q 2 ) 3 m 2 σ+ 560 Tη 2 η 2 l q 2 ( n − m ) KL (1 − q 2 ) 3 m( σ 2 + 6 Kσ 2 g ) + 3360 η 2 η 2 l q 2 ( n − m )
K 2 L (1 − q 2 ) 3 m
T (cid:88)
[Equation]
When the learning rate is chosen such that
[Equation]
we can get
[Equation]
where C 1 = q 2 / (1 − q 2 ) 3 .
Denote B = n/m .
When choosing η = Θ( √ Km ) , η l = Θ( 1 K √ TB )
[Equation]
the rate can be further bounded by
[Equation]
which can be further simplified by ignoring smaller terms as
[Equation]
This completes the proof
[Equation]
1: Input : learning rates η , η l , hyper-parameters β 1 , β 2 , ϵ 2: Initialize : central server parameter θ 1 ∈ R d ⊆ R d ; e 1 ,i =
the accumulator for each worker; m 0 = 0 , v 0 = 0 , ˆ v 0 = 0 ; ϕ 1 = ˜
H t = 0 ; θ (1)0 ,i
= θ 1 for all i ∈ [ n ] 3: for t = 1 , . . .
, T do 4: parallel for worker i ∈
[ n ] do : 5:
Receive ˜ H t from the server and set θ (1) t,i
=
θ (1) t − 1 ,i + ˜ H t ▷ Download compression 6: for k = 1 , . . .
, K do 7:
Compute stochastic gradient g ( k ) t,i at θ ( k ) t,i 8:
Local update θ ( k +1) t,i
= θ ( k ) t,i − η l g ( k ) t,i 9: end for 10:
Compute the local model update ∆ t,i =
θ ( K +1) t,i − θ t 11:
Send compressed adjusted local model update (cid:101)
∆ t,i = C (∆ t,i + e t,i ) to central server 12:
Update the error e t +1 ,i =
e t,i + ∆ t,i − (cid:101) ∆ t,i 13: end parallel 14:
Central server do: 15:
Global aggregation (cid:101) ∆ t [Equation] n (cid:80) ni
[Equation]
(cid:101) ∆ t,i 16:
Compress ˜
[Equation]
∆
[Equation]
▷ Fed-EF-SGD 17: m
[Equation]
▷ Fed-EF-AMS 18:
[Equation]
max( v t , ˆ v t − 1 ) 19:
Compress ˜ H t =
C ( m t √ ˆ v t + ϵ + ϕ t ) 20:
Update server error accumulator ϕ t +1 =
ϕ t + ( θ t +1 − θ t ) − ˜
H t 21:
Update global model θ t +
=
θ t − η ˜ H t and broadcast ˜
H t to clients 22: end for
D T WO -W AY C OMPRESSION IN F ED -EF
As discussed in the paper, our Fed-EF scheme can also be combined with two-way compression, for both uploading (clients-to-server) and downloading (server-to-clients) channel.
This can lead to even more communication reduction in practice.
The steps can be found in Algorithm 3.
Next, we briefly discuss its impact on the convergence analysis.
For simplicity, we will focus on two-way compressed Fed-EF-SGD here, while same arguments hold for Fed-EF-AMS.
The general approach is: 1) the clients transmit ˜∆ t,i to the server which are compressed; 2) the server again compresses the aggregated update (cid:101) ∆ t and broadcast the compressed ˜ H t to the clients, also using an error feedback at the central node.
Note that this approach requires the clients to additionally store the model at the beginning of each round.
To study the convergence of Algorithm 3, we consider a series of virtual iterates as
[Equation]
where we again use the fact of EF that ϕ t +
+ ˜ H t =
ϕ t + (cid:101) ∆ t .
Then we can construct a similar sequence x t as in (13) associated with ˜ θ t by
[Equation]
Then we can apply same analysis to derive the convergence bound as in Section C.2.
The only difference is in (15), where the second term becomes
[Equation]
The first term can be bounded in the same way as in (15).
Regarding the second term, we can use a similar trick as Lemma C.4 that
[Equation]
Then, by recursion and the geometric sum
[Equation]
∥ ϕ t +1 ∥ 2 can be bounded by the second term in above up to a constant.
We can write
[Equation]
As a result
[Equation]
it holds that E (cid:2)
∥
ϕ t ∥ 2 (cid:3) ≤ O
[Equation]
∥ ¯ e t ∥ (cid:3) 2 ) since E (cid:2) ∥
¯ e t ∥ 2 (cid:3) =
O ( E (cid:2) ∥
¯∆ t ∥ (cid:3) 2 ) by Lemma C. and Lemma C.4 under our assumptions.
Therefore, (19) has same order as (15).
Since other parts of the proof are the same, we know that two-way compression does not change the convergence rate asymptotically of Fed-EF.