Joseph Gonzalez
Yucheng Low Danny Bickson
Distributed Graph-Parallel Computation on Natural Graphs
Haijie Gu Joint work with: Carlos Guestrin
Joseph Gonzalez Joint work with: Yucheng Haijie Danny Carlos - - PowerPoint PPT Presentation
Distributed Graph-Parallel Computation on Natural Graphs Joseph Gonzalez Joint work with: Yucheng Haijie Danny Carlos Low Gu Bickson Guestrin Graphs are ubiquitous.. 2 Social Media Science Advertising Web Graphs encode
Joseph Gonzalez
Yucheng Low Danny Bickson
Distributed Graph-Parallel Computation on Natural Graphs
Haijie Gu Joint work with: Carlos Guestrin
2
Social Media
Advertising Science Web
3
4
5
6
Natural Graph with 40M Users, 1.4 Billion Links
Hadoop results from [Kang et al. '11] Twister (in-memory MapReduce) [Ekanayake et al. ‘10]
7
50 100 150 200 Hadoop GraphLab Twister Piccolo PowerGraph
Runtime Per Iteration
Order of magnitude by exploiting properties
8
100 102 104 106 108 100 102 104 106 108 1010 degree count
Top 1% of vertices are adjacent to 50% of the edges!
High-Degree Vertices
9
Number of Vertices
AltaVista WebGraph 1.4B Vertices, 6.6B Edges
Degree
More than 108 vertices have one neighbor.
10
President Obama Followers
cuts [Leskovec et al. 08, Lang 04]
poorly on Power-Law Graphs. [Abou-Rjeili et al. 06]
11
CPU 1 CPU 2
12
Machine 1 Machine 2
13
Program For This Run on This
14
– Using messages (e.g. Pregel [PODC’09, SIGMOD’10]) – Through shared state (e.g., GraphLab [UAI’10, VLDB’12])
15
What’s the popularity
Popular?
Depends on popularity
Depends on the popularity their followers
16
Rank of user i Weighted sum of neighbors’ ranks
17
R[i] = 0.15 + X
j∈Nbrs(i)
wjiR[j]
Vertex-Programs interact by sending messages.
i
Pregel_PageRank(i, messages) : // Receive all the messages total = 0 foreach( msg in messages) : total = total + msg // Update the rank of this vertex R[i] = 0.15 + total // Send new messages to neighbors foreach(j in out_neighbors[i]) : Send msg(R[i] * wij) to vertex j
18
Malewicz et al. [PODC’09, SIGMOD’10]
Vertex-Programs directly read the neighbors state
i
GraphLab_PageRank(i) // Compute sum over neighbors total = 0 foreach( j in in_neighbors(i)): total = total + R[j] * wji // Update the PageRank R[i] = 0.15 + total // Trigger neighbors to run again if R[i] not converged then foreach( j in out_neighbors(i)): signal vertex-program on j
19
Low et al. [UAI’10, VLDB’12]
Asynchronous Execution requires heavy locking (GraphLab)
Touches a large fraction of graph (GraphLab) Sequentially process edges Sends many messages (Pregel) Edge meta-data too large for single machine Synchronous Execution prone to stragglers (Pregel)
20
Fan-In vs. Fan-Out
21
Machine 1 Machine 2 +
B A C D
Sum
message operation:
22
Machine 1 Machine 2
B A C D
message to the same machine!
23
– Piccolo was used to simulate Pregel with combiners
2 4 6 8 10 1.8 1.9 2 2.1 2.2
Total Comm. (GB)
Power-Law Constant α
More high-degree vertices
24
Machine 1
A B C
Machine 2
D
D A B C
Ghost
25
creates substantial network traffic Machine 1
A B C
Machine 2
D
D A B C
Ghost
26
2 4 6 8 10 1.8 1.9 2 2.1 2.2
Total Comm. (GB)
Power-Law Constant alpha
More high-degree vertices
27
– Minimize communication – Balance computation and storage
Y
Machine 1 Machine 2
28
Data transmitted across network O(# cut edges)
Machine 1 Machine 2
(hashed) partitioning on natural graphs
10 Machines à 90% of edges cut 100 Machines à 99% of edges cut!
29
30
– Move computation to data – Parallelize high-degree vertices
– Effectively distribute large power-law graphs
31
Gather Information About Neighborhood Update Vertex Signal Neighbors & Modify Edge Data
GraphLab_PageRank(i) // Compute sum over neighbors total = 0 foreach( j in in_neighbors(i)): total = total + R[j] * wji // Update the PageRank R[i] = 0.1 + total // Trigger neighbors to run again if R[i] not converged then foreach( j in out_neighbors(i)) signal vertex-program on j
32
Y
+ … + à
Y
Parallel Sum
User Defined:
Gather( ) à Σ
Y
Σ1 + Σ2 à Σ3
Y
Gather (Reduce)
Apply the accumulated value to center vertex
Apply
Update adjacent edges and vertices.
Scatter
Σ
Accumulate information about neighborhood
Y
+ User Defined:
Apply( , Σ) à Y
’ Y Y
Σ
Y ’
Update Edge Data & Activate Neighbors
User Defined:
Scatter( ) à
Y’
Y’
33
PowerGraph_PageRank(i) Gather( j à i ) : return wji * R[j] sum(a, b) : return a + b; Apply(i, Σ) : R[i] = 0.15 + Σ Scatter( i à j ) : if R[i] changed then trigger j to be recomputed
34
R[i] = 0.15 + X
j∈Nbrs(i)
wjiR[j]
Machine 2 Machine 1 Machine 4 Machine 3
Σ1 Σ2 Σ3 Σ4
+ + + Y Y Y Y Y’
Σ
Y’ Y’ Y’
35
Master Mirror Mirror Mirror
Minimizing Communication in PowerGraph
Y Y Y
A vertex-cut minimizes machines each vertex spans
Percolation theory suggests that power law graphs have good vertex cuts. [Albert et al. 2000] Communication is linear in the number of machines each vertex spans
36
CPU 1 CPU 2
Y Y Must synchronize many edges
CPU 1 CPU 2
Y Y Must synchronize a single vertex
New Theorem: For any edge-cut we can directly construct a vertex-cut which requires strictly less communication and storage.
37
– Minimize machines spanned by each vertex
– Touch each edge only once
– Random Edge Placement – Coordinated Greedy Edge Placement – Oblivious Greedy Edge Placement
38
Machine 2 Machine 1 Machine 3
Y Y Y Y Z Y Y Y Y Z Y Z
Y
Spans 3 Machines
Z
Spans 2 Machines
Balanced Vertex-Cut Not cut!
39
vertex:
2 4 6 8 10 12 14 16 18 20 8 28 48
Number of Machines Predicted Random
Twitter Follower Graph
41 Million Vertices 1.4 Billion Edges Accurately Estimate Memory and Comm. Overhead
40
1 10 100 50 100 150 Reduction in
Number of Machines
41
Order of Magnitude Improvement
the vertices in that edge.
Machine1 Machine 2
B A C B D A E B
42
expected number of machines spanned
– Requires coordination to place each edge – Slower: higher quality cuts
– Approx. greedy objective without coordination – Faster: lower quality cuts
43
Twitter Graph: 41M vertices, 1.4B edges
Oblivious balances cost and partitioning time.
2 4 6 8 10 12 14 16 18 8 16 24 32 40 48 56 64 Avg # of Machines Spanned Number of Machines 200 400 600 800 1000 8 16 24 32 40 48 56 64 Partitioning Time (Seconds) Number of Machines
44
Cost Construction Time
Better
Greedy Vertex-Cuts Improve Performance
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PageRank Collaborative Filtering Shortest Path
Runtime Relative to Random
Random Oblivious Coordinated
Greedy partitioning improves computation performance.
45
– Synchronous: Bulk-Synchronous GAS Phases – Asynchronous: Interleave GAS Phases – Asynchronous + Serializable: Neighboring vertices do not run simultaneously
– Accelerate gather phase by caching partial sums for each vertex
46
47
– Snapshot time < 5 seconds for twitter network
48
EC2 HPC Nodes
MPI/TCP-IP PThreads HDFS
PowerGraph (GraphLab2) System
– Alternating Least Squares – Stochastic Gradient Descent – SVD – Non-negative MF
– Loopy Belief Propagation – Max-Product Linear Programs – Gibbs Sampling
– PageRank – Triangle Counting – Shortest Path – Graph Coloring – K-core Decomposition
– Image stitching
– LDA
49
Runtime Communication
2 4 6 8 10 1.8
Total Network (GB)
Power-Law Constant α
5 10 15 20 25 30 1.8
Seconds
Power-Law Constant α
Pregel (Piccolo) GraphLab Pregel (Piccolo) GraphLab
50
High-degree vertices High-degree vertices PowerGraph is robust to high-degree vertices.
10 20 30 40 50 60 70 GraphLab Pregel (Piccolo) PowerGraph
51
5 10 15 20 25 30 35 40 GraphLab Pregel (Piccolo) PowerGraph Total Network (GB) Seconds
Communication Runtime
Natural Graph with 40M Users, 1.4 Billion Links Reduces Communication Runs Faster
32 Nodes x 8 Cores (EC2 HPC cc1.4x)
Yahoo Altavista Web Graph (2002):
One of the largest publicly available web graphs
1.4 Billion Webpages, 6.6 Billion Links
1024 Cores (2048 HT) 64 HPC Nodes
52
– 2.6M Documents, 8.3M Words, 500M Tokens
– Computationally intensive algorithm
53
20 40 60 80 100 120 140 160 Smola et al. PowerGraph
Million Tokens Per Second
100 Yahoo! Machines
Specifically engineered for this task
64 cc2.8xlarge EC2 Nodes 200 lines of code & 4 human hours
Counted: 34.8 Billion Triangles
54
Identify individuals with strong communities.
1536 Machines 423 Minutes
Hadoop
[WWW’11]
282 x Faster
Why? Wrong Abstraction à
Broadcast O(degree2) messages per Vertex
challenging
– High-degree vertices – Low-quality edge-cuts
– GAS Decomposition: split vertex programs – Vertex-partitioning: distribute natural graphs
55
PowerGraph (GraphLab2) System
Graph Analytics Graphical Models Computer Vision Clustering Topic Modeling Collaborative Filtering
– Support structural changes during computation
– Support graphs that don’t fit in memory
– Leverage vertex replication to reduce snapshots – Asynchronous recovery
57
Documentation… Code… Tutorials… (more on the way)