From Graphs to Tables: The Design of Scalable Systems for Graph Analytics Joseph E. Gonzalez Post-doc, UC Berkeley AMPLab Co-founder,

Slides:



Advertisements
Similar presentations
Graphs (Part II) Shannon Quinn (with thanks to William Cohen and Aapo Kyrola of CMU, and J. Leskovec, A. Rajaraman, and J. Ullman of Stanford University)
Advertisements

epiC: an Extensible and Scalable System for Processing Big Data
Make Sense of Big Data Researched by JIANG Wen-rui Led by Pro. ZOU
Oracle Labs Graph Analytics Research Hassan Chafi Sr. Research Manager Oracle Labs Graph-TA 2/21/2014.
UC Berkeley a Spark in the cloud iterative and interactive cluster computing Matei Zaharia, Mosharaf Chowdhury, Michael Franklin, Scott Shenker, Ion Stoica.
Differentiated Graph Computation and Partitioning on Skewed Graphs
Distributed Graph Analytics Imranul Hoque CS525 Spring 2013.
UC Berkeley Spark Cluster Computing with Working Sets Matei Zaharia, Mosharaf Chowdhury, Michael Franklin, Scott Shenker, Ion Stoica.
Spark: Cluster Computing with Working Sets
Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave, Justin Ma, Murphy McCauley, Michael Franklin, Scott Shenker, Ion Stoica Spark Fast, Interactive,
PreprocessingComputePost Proc. XML Raw Data ETL SliceCompute Repeat Subgraph PageRank Initial Graph Analyz e Top Users.
GraphChi: Big Data – small machine
Spark Fast, Interactive, Language-Integrated Cluster Computing.
Matei Zaharia Large-Scale Matrix Operations Using a Data Flow Engine.
Shark Cliff Engle, Antonio Lupher, Reynold Xin, Matei Zaharia, Michael Franklin, Ion Stoica, Scott Shenker Hive on Spark.
Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave, Justin Ma, Murphy McCauley, Michael Franklin, Scott Shenker, Ion Stoica Spark Fast, Interactive,
Yucheng Low Aapo Kyrola Danny Bickson A Framework for Machine Learning and Data Mining in the Cloud Joseph Gonzalez Carlos Guestrin Joe Hellerstein.
Carnegie Mellon Joseph Gonzalez Joint work with Yucheng Low Aapo Kyrola Danny Bickson Carlos Guestrin Guy Blelloch Joe Hellerstein David O’Hallaron A New.
GraphX: Graph Processing in a Distributed Dataflow Framework
Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave, Justin Ma, Murphy McCauley, Michael Franklin, Scott Shenker, Ion Stoica Spark Fast, Interactive,
GraphLab A New Parallel Framework for Machine Learning Carnegie Mellon Based on Slides by Joseph Gonzalez Mosharaf Chowdhury.
Design Patterns for Efficient Graph Algorithms in MapReduce Jimmy Lin and Michael Schatz University of Maryland Tuesday, June 29, 2010 This work is licensed.
Joseph Gonzalez Postdoc, UC Berkeley AMPLab A System for Distributed Graph-Parallel Machine Learning Yucheng Low Aapo Kyrola.
Joseph Gonzalez Yucheng Low Aapo Kyrola Danny Bickson Joe Hellerstein Alex Smola Distributed Graph-Parallel Computation on Natural Graphs Haijie Gu The.
BiGraph BiGraph: Bipartite-oriented Distributed Graph Partitioning for Big Learning Jiaxin Shi Rong Chen, Jiaxin Shi, Binyu Zang, Haibing Guan Institute.
GraphLab A New Framework for Parallel Machine Learning
Pregel: A System for Large-Scale Graph Processing
Graph-Based Parallel Computing William Cohen 1. Announcements Thursday 4/23: student presentations on projects – come with a tablet/laptop/etc Fri 4/24:
Software tools for Complex Networks Analysis Giovanni Neglia, Small changes to a set of slides from Fabrice Huet, University of Nice Sophia- Antipolis.
11 If you were plowing a field, which would you rather use? Two oxen, or 1024 chickens? (Attributed to S. Cray) Abdullah Gharaibeh, Lauro Costa, Elizeu.
Carnegie Mellon University GraphLab Tutorial Yucheng Low.
Pregel: A System for Large-Scale Graph Processing Presented by Dylan Davis Authors: Grzegorz Malewicz, Matthew H. Austern, Aart J.C. Bik, James C. Dehnert,
X-Stream: Edge-Centric Graph Processing using Streaming Partitions
GRAPH PROCESSING Hi, I am Mayank and the second presenter for today is Shadi. We will be talking about Graph Processing.
Efficient Graph Processing with Distributed Immutable View Rong Chen Rong Chen +, Xin Ding +, Peng Wang +, Haibo Chen +, Binyu Zang + and Haibing Guan.
Chapter 3 Parallel Algorithm Design. Outline Task/channel model Task/channel model Algorithm design methodology Algorithm design methodology Case studies.
CSE 486/586 CSE 486/586 Distributed Systems Graph Processing Steve Ko Computer Sciences and Engineering University at Buffalo.
Carnegie Mellon Yucheng Low Aapo Kyrola Danny Bickson A Framework for Machine Learning and Data Mining in the Cloud Joseph Gonzalez Carlos Guestrin Joe.
Pregel: A System for Large-Scale Graph Processing Grzegorz Malewicz, Matthew H. Austern, Aart J. C. Bik, James C. Dehnert, Ilan Horn, Naty Leiser, and.
GraphX: Unifying Table and Graph Analytics
GraphX: Unifying Data-Parallel and Graph-Parallel Analytics
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
Joseph Gonzalez Yucheng Low Danny Bickson Distributed Graph-Parallel Computation on Natural Graphs Haijie Gu Joint work with: Carlos Guestrin.
Carnegie Mellon Yucheng Low Aapo Kyrola Danny Bickson A Framework for Machine Learning and Data Mining in the Cloud Joseph Gonzalez Carlos Guestrin Joe.
Resilient Distributed Datasets: A Fault- Tolerant Abstraction for In-Memory Cluster Computing Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave,
GraphX: Graph Analytics on Spark
Data Structures and Algorithms in Parallel Computing
Graph-Based Parallel Computing
Factorbird: a Parameter Server Approach to Distributed Matrix Factorization Sebastian Schelter, Venu Satuluri, Reza Zadeh Distributed Machine Learning.
PowerGraph: Distributed Graph- Parallel Computation on Natural Graphs Joseph E. Gonzalez, Yucheng Low, Haijie Gu, and Danny Bickson, Carnegie Mellon University;
Department of Computer Science, Johns Hopkins University Pregel: BSP and Message Passing for Graph Computations EN Randal Burns 14 November 2013.
Resilient Distributed Datasets A Fault-Tolerant Abstraction for In-Memory Cluster Computing Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave,
Parallel and Distributed Systems for Probabilistic Reasoning
Pagerank and Betweenness centrality on Big Taxi Trajectory Graph
CSCI5570 Large Scale Data Processing Systems
Graph-Based Parallel Computing
Big Learning with Graphs
Spark Presentation.
Distributed Graph-Parallel Computation on Natural Graphs
Introduction to Spark.
Graph-Based Parallel Computing
COS 518: Advanced Computer Systems Lecture 12 Mike Freedman
CMPT 733, SPRING 2016 Jiannan Wang
CS110: Discussion about Spark
Replication-based Fault-tolerance for Large-scale Graph Processing
Apache Spark Lecture by: Faria Kalim (lead TA) CS425, UIUC
Pregelix: Think Like a Vertex, Scale Like Spandex
Overview of big data tools
Apache Spark Lecture by: Faria Kalim (lead TA) CS425 Fall 2018 UIUC
Fast, Interactive, Language-Integrated Cluster Computing
Presentation transcript:

From Graphs to Tables: The Design of Scalable Systems for Graph Analytics Joseph E. Gonzalez Post-doc, UC Berkeley AMPLab Co-founder, GraphLab Inc. WWW’14 Workshop on Big Graph Mining *These slides are best viewed in PowerPoint with animation.

Graphs are Central to Analytics Raw Wikipedia XML HyperlinksPageRankTop 20 Pages TitlePR Text Table TitleBody Topic Model (LDA) Word Topics WordTopic Editor Graph Community Detection User Community UserCom. Term-Doc Graph Discussion Table UserDisc. Community Topic Com.

Update ranks in parallel Iterate until convergence Rank of user i Sum of neighbors 3 PageRank: Identifying Leaders

Ratings Item s Recommending Products Users

Low-Rank Matrix Factorization: 5 r 13 r 14 r 24 r 25 f(1) f(2) f(3) f(4) f(5) User Factors (U) Movie Factors (M) User s Movie s Netflix User s ≈ x Movie s f(i) f(j) Iterate: Recommending Products

Liberal Conservative Post Predicting User Behavior Post ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 6 Conditional Random Field Belief Propagation

Post Mean Field Algorithm Y2Y2 Y1Y1 Y3Y3 X2X2 X3X3 X1X1 Sum over Neighbors

Count triangles passing through each vertex: Measures “cohesiveness” of local community Finding Communities

The Graph-Parallel Pattern 9 Model / Alg. State Model / Alg. State Computation depends only on the neighbors

Many Graph-Parallel Algorithms Collaborative Filtering –Alternating Least Squares –Stochastic Gradient Descent –Tensor Factorization Structured Prediction –Loopy Belief Propagation –Max-Product Linear Programs –Gibbs Sampling Semi-supervised M L –Graph SSL –CoEM Community Detection –Triangle-Counting –K-core Decomposition –K-Truss Graph Analytics –PageRank –Personalized PageRank –Shortest Path –Graph Coloring Classification –Neural Networks 10

Graph-Parallel Systems 11 Expose specialized APIs to simplify graph programming.

The Pregel (Push) Abstraction Vertex-Programs interact by sending messages. i 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] = total // Send new messages to neighbors foreach(j in out_neighbors[i]) : Send msg(R[i]) to vertex j 12 Malewicz et al. [PODC’09, SIGMOD’10]

The GraphLab (Pull) Abstraction Vertex Programs directly access adjacent vertices and edges GraphLab_PageRank(i) // Compute sum over neighbors total = 0 foreach( j in neighbors(i)): total = total + R[j] * w ji // Update the PageRank R[i] = total 13 R[4] * w 41 R[3] * w 31 R[2] * w Data movement is managed by the system and not the user.

Barrier Iterative Bulk Synchronous Execution ComputeCommunicate

Graph-Parallel Systems 15 Exploit graph structure to achieve orders-of-magnitude performance gains over more general data-parallel systems.

Real-World Graphs 16 Top 1% of vertices are adjacent to 50% of the edges! More than 10 8 vertices have one neighbor. Number of Vertices AltaVista WebGraph1.4B Vertices, 6.6B Edges Degree -Slope = α ≈ 2 Power-Law Degree Distribution Edges >> Vertices

Challenges of High-Degree Vertices Touches a large fraction of graph Sequentially process edges 17 CPU 1 CPU 2 Provably Difficult to Partition

Machine 1 Machine 2 Split High-Degree vertices New Abstraction  Equivalence on Split Vertices 18 Program This Run on This

Machine 2 Machine 1 Machine 4 Machine 3 GAS Decomposition Σ1Σ1 Σ1Σ1 Σ2Σ2 Σ2Σ2 Σ3Σ3 Σ3Σ3 Σ4Σ4 Σ4Σ Y Y YY Y’ Σ Σ Gather Apply Scatter 19 Master Mirror

Minimizing Communication in PowerGraph Y YY 20 Vertex Cut Communication is linear in the number of machines each vertex spans. Total communication upper bound:

Shrinking Working Sets 51% of vertices run only once! PageRank on Web Graph

The GraphLab (Pull) Abstraction Vertex Programs directly access adjacent vertices and edges GraphLab_PageRank(i) // Compute sum over neighbors total = 0 foreach( j in neighbors(i)): total = total + R[j] * w ji // Update the PageRank R[i] = total 22 R[4] * w 41 R[3] * w 31 R[2] * w GraphLab_PageRank(i) // Compute sum over neighbors total = 0 foreach( j in neighbors(i)): total = total + R[j] * w ji // Update the PageRank R[i] = total // Trigger neighbors to run again if R[i] not converged then signal nbrsOf(i) to be recomputed Trigger computation only when necessary.

PageRank on the Live-Journal Graph GraphLab is 60x faster than Hadoop GraphLab is 16x faster than Spark

Counted: 34.8 Billion Triangles 24 Triangle Counting on Twitter 64 Machines 15 Seconds 1536 Machines 423 Minutes Hadoop [WWW’11] S. Suri and S. Vassilvitskii, “Counting triangles and the curse of the last reducer,” WWW’ x Faster 40M Users, 1.4 Billion Links

Graph Analytics Pipeline Raw Wikipedia XML HyperlinksPageRankTop 20 Pages TitlePR Text Table TitleBody Topic Model (LDA) Word Topics WordTopic Editor Graph Community Detection User Community UserCom. Term-Doc Graph Discussion Table UserDisc. Community Topic Com.

Tables Raw Wikipedia XML HyperlinksPageRankTop 20 Pages TitlePR Text Table TitleBody Topic Model (LDA) Word Topics WordTopic Editor Graph Community Detection User Community UserCom. Term-Doc Graph Discussion Table UserDisc. Community Topic Com.

Graphs Raw Wikipedia XML HyperlinksPageRankTop 20 Pages TitlePR Text Table TitleBody Topic Model (LDA) Word Topics WordTopic Editor Graph Community Detection User Community UserCom. Term-Doc Graph Discussion Table UserDisc. Community Topic Com.

Separate Systems to Support Each View Table ViewGraph View Dependency Graph Table Resul t Row

Separate systems for each view can be difficult to use and inefficient 29

Difficult to Program and Use Users must Learn, Deploy, and Manage multiple systems Leads to brittle and often complex interfaces 30

Inefficient 31 Extensive data movement and duplication across the network and file system XML HDFS Limited reuse internal data-structures across stages

Solution: The GraphX Unified Approach Enabling users to easily and efficiently express the entire graph analytics pipeline New API Blurs the distinction between Tables and Graphs New System Combines Data-Parallel Graph-Parallel Systems

Tables and Graphs are composable views of the same physical data GraphX Unified Representation GraphX Unified Representation Graph ViewTable View Each view has its own operators that exploit the semantics of the view to achieve efficient execution

View a Graph as a Table Id Rxin Jegonzal Franklin Istoica SrcIdDstId rxinjegonzal franklinrxin istoicafranklin jegonzal Property (E) Friend Advisor Coworker PI Property (V) (Stu., Berk.) (PstDoc, Berk.) (Prof., Berk) R J F I Property Graph Vertex Property Table Edge Property Table

Table Operators Table (RDD) operators are inherited from Spark: 35 map filter groupBy sort union join leftOuterJoin rightOuterJoin reduce count fold reduceByKey groupByKey cogroup cross zip sample take first partitionBy mapWith pipe save...

class Graph [ V, E ] { def Graph(vertices: Table[ (Id, V) ], edges: Table[ (Id, Id, E) ]) // Table Views def vertices: Table[ (Id, V) ] def edges: Table[ (Id, Id, E) ] def triplets: Table [ ((Id, V), (Id, V), E) ] // Transformations def reverse: Graph[V, E] def subgraph(pV: (Id, V) => Boolean, pE: Edge[V,E] => Boolean): Graph[V,E] def mapV(m: (Id, V) => T ): Graph[T,E] def mapE(m: Edge[V,E] => T ): Graph[V,T] // Joins def joinV(tbl: Table [(Id, T)]): Graph[(V, T), E ] def joinE(tbl: Table [(Id, Id, T)]): Graph[V, (E, T)] // Computation def mrTriplets(mapF: (Edge[V,E]) => List[(Id, T)], reduceF: (T, T) => T): Graph[T, E] } Graph Operators 36

Triplets Join Vertices and Edges The triplets operator joins vertices and edges: The mrTriplets operator sums adjacent triplets. SELECT t.dstId, reduce( map(t) ) AS sum FROM triplets AS t GROUPBY t.dstId TripletsVertices B A C D Edges AB AC BC CD AB AB AC BC CD SELECT s.Id, d.Id, s.P, e.P, d.P FROM edges AS e JOIN vertices AS s, vertices AS d ON e.srcId = s.Id AND e.dstId = d.Id

We express enhanced Pregel and GraphLab abstractions using the GraphX operators in less than 50 lines of code! 38

Enhanced to Pregel in GraphX 39 Malewicz et al. [PODC’09, SIGMOD’10] pregelPR(i, messageList ): // Receive all the messages total = 0 foreach( msg in messageList) : total = total + msg // Update the rank of this vertex R[i] = total // Send new messages to neighbors foreach(j in out_neighbors[i]) : Send msg(R[i]/E[i,j]) to vertex Require Message Combiners messageSum Remove Message Computation from the Vertex Program Remove Message Computation from the Vertex Program sendMsg(i  j, R[i], R[j], E[i,j]): // Compute single message return msg(R[i]/E[i,j]) combineMsg(a, b): // Compute sum of two messages return a + b

Implementing PageRank in GraphX 40 // Load and initialize the graph val graph = GraphBuilder.text(“hdfs://web.txt”) val prGraph = graph.joinVertices(graph.outDegrees) // Implement and Run PageRank val pageRank = prGraph.pregel(initialMessage = 0.0, iter = 10)( (oldV, msgSum) => * msgSum, triplet => triplet.src.pr / triplet.src.deg, (msgA, msgB) => msgA + msgB)

We express the Pregel and GraphLab like abstractions using the GraphX operators in less than 50 lines of code! 41 By composing these operators we can construct entire graph-analytics pipelines.

Example Analytics Pipeline // Load raw data tables val verts = sc.textFile(“hdfs://users.txt”).map(parserV) val edges = sc.textFile(“hdfs://follow.txt”).map(parserE) // Build the graph from tables and restrict to recent links val graph = new Graph(verts, edges) val recent = graph.subgraph(edge => edge.date > LAST_MONTH) // Run PageRank Algorithm val pr = graph.PageRank(tol = 1.0e-5) // Extract and print the top 25 users val topUsers = verts.join(pr).top(25).collect topUsers.foreach(u => println(u.name + ‘\t’ + u.pr))

GraphX System Design

Part. 2 Part. 1 Vertex Table (RDD) B B C C A A D D F F E E A A D D Distributed Graphs as Tables (RDDs) D D Property Graph B B C C D D E E A A A A F F Edge Table (RDD) A A B B A A C C C C D D B B C C A A E E A A F F E E F F E E D D B B C C D D E E A A F F Routing Table (RDD) B B C C D D E E A A F F D Vertex Cut Heuristic

Vertex Table (RDD) Caching for Iterative mrTriplets Edge Table (RDD) A A B B A A C C C C D D B B C C A A E E A A F F E E F F E E D D Mirror Cache B B C C D D A A Mirror Cache D D E E F F A A B B C C D D E E A A F F B B C C D D E E A A F F A A D D

Vertex Table (RDD) Edge Table (RDD) A A B B A A C C C C D D B B C C A A E E A A F F E E F F E E D D Mirror Cache B B C C D D A A Mirror Cache D D E E F F A A Incremental Updates for Iterative mrTriplets B B C C D D E E A A F F Change A A A A E E Scan

Vertex Table (RDD) Edge Table (RDD) A A B B A A C C C C D D B B C C A A E E A A F F E E F F E E D D Mirror Cache B B C C D D A A Mirror Cache D D E E F F A A Aggregation for Iterative mrTriplets B B C C D D E E A A F F Change Scan Change Local Aggregate Local Aggregate B B C C D D F F

Reduction in Communication Due to Cached Updates Most vertices are within 8 hops of all vertices in their comp.

Benefit of Indexing Active Edges Scan All Edges Index of “Active” Edges

Join Elimination Identify and bypass joins for unused triplet fields 50 Factor of 2 reduction in communication sendMsg(i  j, R[i], R[j], E[i,j]): // Compute single message return msg(R[i]/E[i,j])

Additional Query Optimizations Indexing and Bitmaps:  To accelerate joins across graphs  To efficiently construct sub-graphs Substantial Index and Data Reuse:  Reuse routing tables across graphs and sub- graphs  Reuse edge adjacency information and indices 51

Performance Comparisons GraphX is roughly 3x slower than GraphLab Live-Journal: 69 Million Edges

GraphX scales to larger graphs GraphX is roughly 2x slower than GraphLab  Scala + Java overhead: Lambdas, GC time, …  No shared memory parallelism: 2x increase in comm. Twitter Graph: 1.5 Billion Edges

PageRank is just one stage…. What about a pipeline?

HDFS Compute Spark Preprocess Spark Post. A Small Pipeline in GraphX Timed end-to-end GraphX is faster than GraphLab Raw Wikipedia XML HyperlinksPageRankTop 20 Pages

Conclusion and Observations Domain specific views: Tables and Graphs  tables and graphs are first-class composable objects  specialized operators which exploit view semantics Single system that efficiently spans the pipeline  minimize data movement and duplication  eliminates need to learn and manage multiple systems Graphs through the lens of database systems  Graph-Parallel Pattern  Triplet joins in relational alg.  Graph Systems  Distributed join optimizations 56

Open Source Project Alpha release as part of Spark 0.9

Active Research Static Data  Dynamic Data  Apply GraphX unified approach to time evolving data  Materialized view maintenance for graphs Serving Graph Structured Data  Allow external systems to interact with GraphX  Unify distributed graph databases with relational database technology 58

Collaborators Yucheng Low Aapo Kyrola Danny Bickson Alex Smola Haijie Gu GraphLab : Carlos Guestrin Guy Blelloch GraphX: Reynold Xin Ankur Dave Daniel Crankshaw Michael Franklin Ion Stoica

Thanks!