Share
Embed
Beyond Exponential Graph: Communication Efficient Topology for Decentralized Learning via Finite-timeย Convergence
Beyond Exponential Graph: Communication Efficient Topologies for Decentralized Learning via Finite-time Convergence (NeurIPS 2023)
https://arxiv.org/abs/2305.11420
Yuki Takezawa
November 08, 2023
Transcript
57 slides
-
1 KYOTO UNIVERSITY KYOTO UNIVERSITY Beyond Exponential Graph: Communication Efficient
Topology for Decentralized Learning via Finite-time Convergence (NeurIPS 2023) Yuki Takezawa1,2, Ryoma Sato1,2, Han Bao1,2, Kenta Niwa3, Makoto Yamada2 1Kyoto Univ., 2OIST, 3NTT CS Lab. -
2 KYOTO UNIVERSITY Background Decentralized Learning Training NN in parallel
on multiple nodes (e.g., server, GPUs). โผ Large-scale machine learning. โผ Privacy : server, which has its own (private) training datasets. Decentralized Learning -
3 KYOTO UNIVERSITY Background Decentralized Learning : node (server), which
has training dataset. : nodes can transmit parameters. ๐๐ ๐๐ : loss function of node ๐. (๐๐ is NNโs parameter of node ๐.) Goal of Decentralized Learning: inf ๐ 1 ๐ เท ๐=1 ๐ ๐๐ ๐ ๐1 = ๐2 = โฏ ๐5 ๐2 ๐1 ๐4 ๐3 โป ๐ is the number of nodes. -
4 KYOTO UNIVERSITY Update rule of DSGD: Node ๐ update
its NNโs parameter ๐๐ as follows: โผ ๐ ๐ (๐+1 2 ) = ๐ ๐ (๐) โ ๐โ๐๐ ๐ ๐ ๐ โผ Exchange parameters ๐ ๐ (๐+1 2 ) with neighbors. โผ ๐ ๐ (๐+1) = ฯ ๐=1 ๐ ๐๐๐ ๐ ๐ (๐+1 2 ) Background Decentralized SGD (DSGD) Let ๐ be the number of nodes and let ๐พ be an adjacency matrix. ๐๐๐ is an edge weight and positive iff there exists edge ๐, ๐ or ๐ = ๐. -
5 KYOTO UNIVERSITY Background What is the โgoodโ network structure?
โผ Communication efficiency (i.e., training speed) โผ Accuracy Ring Complete Grid -
6 KYOTO UNIVERSITY Background Communication Efficiency Communication is the main
bottleneck of distributed learning. โผ Communication costs is determined by max degree. Ring (2) Complete (n-1) Grid (4) -
7 KYOTO UNIVERSITY Background What is the โgoodโ network structure?
โผ Communication Efficiency (i.e., training speed) โผ Accuracy Ring Complete Grid -
8 KYOTO UNIVERSITY Background Consensus Rate โผ How โwell-connectedโ the
topology is important. โผ How fast the information spread-out is important. Ring Complete Grid -
9 KYOTO UNIVERSITY Background Consensus Rate Problem: โผ There exists
๐ nodes, and node ๐ has parameters ๐๐ . โผ Let ๐๐๐ is the edge weight. (๐๐๐ > 0 iff there exists edge or ๐ = ๐) โผ Node ๐ updates ๐๐ as ๐๐ โ ฯ ๐=1 ๐ ๐๐๐ ๐๐ . Question: โผ How fast ๐๐ reach เดฅ ๐ โ 1 ๐ ฯ ๐=1 ๐ ๐๐ ? -
10 KYOTO UNIVERSITY Background Consensus Rate with ๐ Nodes. Topology
Consensus Rate ๐ฝ โ [0,1) โ Ring 1 โ ๐ 1 ๐2 Torus 1 โ ๐ 1 ๐ Exp. Graph 1 โ ๐ 1 log2 ๐ Complete 0 1 ๐ เท ๐=1 ๐ ๐ ๐ ๐ โ เดฅ ๐ 2 โป The number in the bracket is the maximum degree. -
11 KYOTO UNIVERSITY Background Consensus Rate with ๐ Nodes. Fast
consensus rate (i.e., small ๐ฝ โ [0,1)) enables Decentralized SGD to achieve high accuracy and fast convergence rate. Theorem: Convergence Rate The parameter ๐๐ generated by Decentralized SGD satisfies 1 ๐ + 1 เท ๐=0 ๐ โ๐ป๐ เดฅ ๐(๐) โ2 โค ๐ after ๐ = ๐ 1 ๐๐2 + 1 1 โ ๐ฝ ๐3/2 iterations where เดฅ ๐ โ 1 ๐ ฯ๐ ๐๐ . -
12 KYOTO UNIVERSITY Background Consensus Rate โผ High communication efficiency:
small maximum degree โผ High accuracy/fast convergence rate : fast consensus rate Ring Complete Grid High accuracy/ Fast convergence rate High communication efficiency -
13 KYOTO UNIVERSITY Background Contribution We propose the Base-(k+1) Graph,
which enables Decenctalized SGD to achieve reasonable balance between communication efficiency and accuracy/convergence rate. โป The number in the bracket is the maximum degree. -
15 KYOTO UNIVERSITY Proposed Method Core Idea: Finite-Time Convergence The
existing topologies asymptotically converge. The proposed topologies, Base-(k+1) Graph, is finite-time convergence. 1 ๐ เท ๐=1 ๐ ๐ ๐ ๐ โ เดฅ ๐ 2 โป The number in the bracket is the maximum degree. -
16 KYOTO UNIVERSITY Proposed Method Existing Finite-time Convergent Topologies Topology
Max Degree #Nodes ๐ 1-peer Hypercube 1 A power of 2 1-peer Exp. Graph 1 A power of 2 Base-(k+1) Graph ๐ Arbitrary number of nodes โผ 1-peer Hypercube is not constructed when ๐ is not power of 2. โผ 1-peer Exp. is not finite-time convergence when ๐ is not power of 2. -
17 KYOTO UNIVERSITY Existing Finite-Time Convergent Topologies 1-peer Hypercube ๐
= 2 โผ All edge weight is 0.5. 1 2 Node 1 Node 2 Initial parameter ๐ฅ1 ๐ฅ2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 -
18 KYOTO UNIVERSITY Existing Finite-Time Convergent Topologies 1-peer Hypercube 1
2 3 4 2 4 1 3 ๐ = 4 โผ All edge weight is 0.5. Node 1 Node 2 Node 3 Node 4 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ4 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 -
19 KYOTO UNIVERSITY Existing Finite-Time Convergent Topologies 1-peer Hypercube 1
2 3 4 2 4 1 3 ๐ = 4 โผ All edge weight is 0.5. Node 1 Node 2 Node 3 Node 4 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ4 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 -
20 KYOTO UNIVERSITY Existing Finite-Time Convergent Topologies 1-peer Hypercube 1
2 3 4 2 4 1 3 ๐ = 4 โผ All edge weight is 0.5. Node 1 Node 2 Node 3 Node 4 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ4 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 + ๐ฅ4 2 -
21 KYOTO UNIVERSITY Existing Finite-Time Convergent Topologies 1-peer Hypercube ๐
= 8 โผ All edge weight is 0.5. 1-peer Hypercube is finite-time convergence when ๐ is a power of 2, while it cannot be constructed when ๐ is not a power of 2. -
22 KYOTO UNIVERSITY Proposed Method Base-2 Graph Next, we propose
the Base-2 Graph: โผ It is finite-time convergence for any ๐. โผ Its maximum degree is 1. Topology Max Degree #Nodes ๐ 1-peer Hypercube 1 A power of 2 1-peer Exp. Graph 1 A power of 2 Base-(k+1) Graph ๐ Arbitrary number of nodes -
23 KYOTO UNIVERSITY Proposed Method Core Idea of Simple Base-2
Graph ๐ = 3 = 2 + 1 ๐ = 5 = 22 + 1 2 3 1 2 4 1 3 5 Core idea is splitting the set of nodes into disjoint subsets to which 1-peer Hypercube is applicable. ๐ = 7 = 22 + 2 + 1 3 4 6 5 1 7 2 -
24 KYOTO UNIVERSITY Proposed Method Core Idea of Simple Base-2
Graph ๐ = 3 = 2 + 1 ๐ = 5 = 22 + 1 2 3 1 2 4 1 3 5 Core idea is splitting the set of nodes into disjoint subsets to which 1-peer Hypercube is applicable. ๐ = 7 = 22 + 2 + 1 3 4 6 5 1 7 2 -
25 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 2 3 1 2 3 1 2 3 1 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 2 3 1 3 1 3 โป edge weight 0.5 is omitted. -
26 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 2 3 1 2 3 1 2 3 1 2 3 1 3 1 3 โป edge weight 0.5 is omitted. -
27 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 2 3 1 2 3 1 2 3 1 2 3 1 3 1 3 โป edge weight 0.5 is omitted. -
28 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 1 3 2 3 1 2 3 1 2 3 1 2 3 1 3 โป edge weight 0.5 is omitted. -
29 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 Average is ๐ฅ1+๐ฅ2+๐ฅ3 3 2 3 1 2 3 1 2 3 1 2 3 1 3 -
30 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 3 Node 1 Node 2 Node 3 Init. value ๐ฅ1 ๐ฅ2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 2 ๐ฅ3 ๐ฅ1 + ๐ฅ2 2 ๐ฅ1 + ๐ฅ2 + 4๐ฅ3 6 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 ๐ฅ1 + ๐ฅ2 + ๐ฅ3 3 2 3 1 2 3 1 2 3 1 2 3 1 3 Average is ๐ฅ1+๐ฅ2+๐ฅ3 3 -
31 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 4 5 1 5 1 5 โป edge weight 0.5 is omitted. -
32 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 5 = 22 + 1 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 4 5 1 5 1 5 โป edge weight 0.5 is omitted. -
33 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 5 = 22 + 1 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 4 5 1 5 1 5 Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 -
34 KYOTO UNIVERSITY Proposed Method Simple Base-2 Graph with ๐
= 5 = 22 + 1 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 4 5 1 5 1 5 Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 -
35 KYOTO UNIVERSITY Proposed Method Brief Summary We propose the
Simple Base-2 Graph: โผ Its maximum degree is only 1. โผ It is finite-time convergence for any ๐. Next, we propose the Simple Base-(k+1) Graph: โผ Its maximum degree is ๐. โผ It is finite-time convergence for any ๐. -
36 KYOTO UNIVERSITY Proposed Method Review: Core Idea of Simple
Base-2 Graph ๐ = 3 = 2 + 1 ๐ = 5 = 22 + 1 2 3 1 2 4 1 3 5 Core idea is splitting the set of nodes into disjoint subsets to which 1-peer Hypercube is applicable. ๐ = 7 = 22 + 2 + 1 3 4 6 5 1 7 2 We need extend 1-peer Hypercube to k-peer setting. -
37 KYOTO UNIVERSITY Proposed Method k-peer Hyper-hypercube 1-peer Hypercube can
be constructed when ๐ is a power of 2. โผ ๐ is a power of 2 โ The primal factors of ๐ is not larger than 2. 1 2 3 4 2 4 1 3 We propose the k-peer Hyper-hypercube, which can be constructed when the primal factors of ๐ is not larger than ๐ + 1. -
38 KYOTO UNIVERSITY Proposed Method k-peer Hyper-hypercube โผ Case with
๐ = 2 and ๐ = 6 = 2 ร 3 โผ Case with ๐ = 2 and ๐ = 9 = 3 ร 3 . (self-loops are omitted.) Edge weight is 1 2 . Edge weight is 1 3 . Edge weight is 1 3 . -
39 KYOTO UNIVERSITY Proposed Method Review: Core Idea of Simple
Base-2 Graph ๐ = 3 = 2 + 1 ๐ = 5 = 22 + 1 2 3 1 2 4 1 3 5 Core idea is splitting the set of nodes into disjoint subsets to which 1-peer Hypercube is applicable. ๐ = 7 = 22 + 2 + 1 3 4 6 5 1 7 2 Binary representation (base-2 number) -
40 KYOTO UNIVERSITY Proposed Method Core Idea of Simple Base-3
Graph ๐ = 3 ๐ = 5 = 3 + 2 2 3 1 2 4 1 3 5 Core idea is splitting the set of nodes into disjoint subsets to which 2-peer Hyper-hypercube is applicable. ๐ = 7 = 2 ร 3 + 1 3 4 6 5 1 7 2 base-3 number -
41 KYOTO UNIVERSITY Proposed Method Simple Base-3 Graph with ๐
= 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 โป self-loops are omitted. -
42 KYOTO UNIVERSITY Proposed Method Simple Base-3 Graph with ๐
= 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 โป self-loops are omitted. -
43 KYOTO UNIVERSITY Proposed Method Simple Base-3 Graph with ๐
= 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 โป self-loops are omitted. Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 -
44 KYOTO UNIVERSITY Proposed Method Simple Base-3 Graph with ๐
= 5 2 4 1 3 5 2 4 1 3 5 2 4 1 3 5 โป self-loops are omitted. Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 Average is ๐ฅ1+๐ฅ2+๐ฅ3+๐ฅ4+๐ฅ5 5 -
45 KYOTO UNIVERSITY Proposed Method Simple Base-(k+1) Graph vs Base-(k+1)
Graph โผ Using additional technique, we can reduce the length of the Simple Base-(k+1) Graph. โป The number in the bracket is the maximum degree. -
46 KYOTO UNIVERSITY Proposed Method Experiments 1 ๐ เท ๐=1
๐ ๐ ๐ ๐ โ เดฅ ๐ 2 โป The number in the bracket is the maximum degree. -
48 KYOTO UNIVERSITY Proposed Method Decentralized SGD on Base-(k+1) Graph
Let ๐พ(1), โฏ , ๐พ(๐) be adjacency matrices of Base-(k+1) Graph. Node ๐ updates its parameter ๐๐ as follows: ๐ ๐ (๐+1) = เท ๐=1 ๐ ๐ ๐๐ (1+๐๐๐ ๐,๐ ) ๐ ๐ (๐) โ ๐โ๐๐ ๐ ๐ (๐) 2 3 1 2 3 1 2 3 1 -
49 KYOTO UNIVERSITY Proposed Method Decentralized SGD on Base-(k+1) Graph
Max Degree โ Order of ๐น โ Ring 2 ๐ 1 ๐๐2 + ๐2 ๐3/2 Torus 4 ๐ 1 ๐๐2 + ๐ ๐3/2 Exp. Graph log2 ๐ ๐ 1 ๐๐2 + log2 ๐ ๐3/2 Base-(k+1) Graph (ours) ๐ ๐ 1 ๐๐2 + log๐+1 ๐ ๐3/2 DSGD satisfies 1 ๐ +1 ฯ๐=0 ๐ โ๐ เดฅ ๐ ๐ 2 โค ๐ after ๐ iterations. -
50 KYOTO UNIVERSITY Proposed Method Decentralized SGD on Base-(k+1) Graph
Topology Consensus Rate โ Max Degree โ Convergence Rate โ Exponential Graph 1 โ ๐ 1 log2 ๐ log2 ๐ ๐ 1 ๐๐2 + log2 ๐ ๐3/2 Base-(๐ + ๐) Graph (ours) N/A ๐ ๐ 1 ๐๐2 + log๐+1 ๐ ๐3/2 Exp. Graph vs Base-2 Graph โผ Same convergence rate and better communication efficiency Exp. Graph vs Base-(๐ + 1) Graph with 2 โค ๐ < log2 ๐ โผ Faster convergence rate and better communication efficiency -
52 KYOTO UNIVERSITY Experiments Model: VGG Datasets: Fashion MNIST, CIFAR-10,
CIFAR-100 #Nodes: 25 We conduct experiments both i.i.d. and non-i.i.d. settings. โผ Non-i.i.d setting โผ i.i.d setting -
53 KYOTO UNIVERSITY Experiments Results on non-i.i.d. setting โผ ๐
= 25 โผ The number in the bracket is the maximum degree. -
54 KYOTO UNIVERSITY Experiments Results on i.i.d. setting โผ ๐
= 25 โผ The number in the bracket is the maximum degree. -
55 KYOTO UNIVERSITY Experiments Results of CIFAR-10 with non-i.i.d. Setting
โผ Base-2 Graph outperforms 1-peer Exp. โผ Base-{3,4,5} Graph outperforms 1-peer Exp. and Exp. -
56 KYOTO UNIVERSITY Experiments Results with Other Decentralized Learning Methods
โผ Base-2 Graph is comparable to 1-peer exponential graph. โผ Base-5 Graph outperforms the exponential graph. -
57 KYOTO UNIVERSITY Conclusion We propose Base-(k+1) Graph: โผ Finite-time
convergence for any ๐ and ๐. โผ Theoretically: Faster convergence rate and fewer communication costs than the exp. graph. โผ Experimentally: Reasonable balance between accuracy and communication efficiency.