From “Think Like a Vertex” to “Think Like a Graph” Yuanyuan Tian, Andrey Balmin, Severin Andreas Corsten, Shirish Tatikonda, John McPherson Large Scale Graph Processing Graph data is everywhere and growing rapidly! 126 million blogs 50 billion Web pages 90 trillion emails Analyzing graph data is increasingly important. Retail: customer segmentation and recommendation Consumer Insights: key influencer analysis Telco: churn prediction Biology & Health Care: disease propagation analysis Government: Terrorists detection What is the right programming model for large-scale graph processing? Existing Graph Processing Systems Divide input graphs into partitions Employ vertex-centric programming model Programmers “think like a vertex” Operate on a vertex and its edges Communication to other vertices Message passing (e.g Pregel/Giraph) Scheduling of updates (e.g GraphLab) “Think like a vertex” “Think like a graph” “Think like a vertex” “Think like a graph” Partition: A collection of vertices A proper subgraph Computation: A vertex and its edges A subgraph Multiple-hops at a time Communication: 1-hop at a time e.g ABD e.g. AD Graph-Centric Programming Model Expose subgraphs to programmers Internal vertices vs boundary vertices Information exchange between internal vertices of a partition is immediate Messages are only sent from boundary vertices of a partition to internal vertices of a different partition internal vertex (primary copy) external vertex (local copy) message Advantages of graph-centric model Any algorithm expressed in the vertex-centric model can be expressed in the graph-centric model Allow lower-level access for algorithm-specific optimizations Use of existing off-the-shell graph algorithms on subgraphs Local asynchronous computation Natural translation of existing graph-centric parallel algorithms Provide sufficiently high-level abstraction for easy of use Example: Weakly Connected Component (WCC) Partition P1 If 0th superstep Sequential WCC on subgraph Send labels of boundary vertices to their corresponding internal vertices Else Use the received messages to update the labels of vertices in the subgraph Merge connected components For boundary vertices with label change, send labels to their corresponding internal vertices graph-centric model compute() on each subgraph vertex-centric model A B Partition P2 C D E F Superstep 0: A 1: A A B B B C C C D D D E E E F F A A A B B B C C C D D D E E A A A B B B C C C D D A A A B B B C C A A A B B A A 2: A A 3: A A A 4: A A A A 5: A A A A A 6: A A A A A A Hybrid Execution Model Can we keep the simple vertex-centric programming model but still improve performance? Key: Differentiate internal messages and external messages What messages can be used in local computation? Vertex-centric model Hybrid model Only messages (external and internal) from previous superstep External messages from previous superstep Internal messages from previous + current superstep (local asynchronous computation) Only apply to a limited set of graph algorithms Giraph++: A New Graph Processing System Built on top of Apache Giraph Support vertex-centric model (VM), graph-centric model (GM) & hybrid model (HM) in the same Giraph++ system Contributed to Apache Giraph Project Planed in future Giraph release A Peek of Performance Results Per node: 32GB RAM, 8 cores, 7 workers Network: 1Gbit WCC Algorithm Time (sec) 10-node cluster Dataset: 4 web graphs # nodes: 19million ~ 428million # edges: 298million ~ 1.0billion Significant improvement in execution time and network messages, especially with better graph partitioning strategy Up to 62X speedup in execution time! Up to 200X reduction in network messages! Network msgs VM: vertex-centric model GM: graph-centric model HM: hybrid model HP: hash partitioning GP: graph partitioning Data Set Conclusion “Think like a vertex” “Think like a graph” Take advantage of local graph structure in a partition Enable complex and flexible graph algorithms Can be exploited to various graph applications Bring significant performance improvement, especially with better graph partitioning strategy A valuable complement to existing vertex-centric model