Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 Grzegorz Czajkwoski Google, Inc. SIGMOD 10 7 July 2010 Taewhi Lee

2 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 2

3 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 3

4 Introduction (1/2) 4 Source: SIGMETRICS 09 Tutorial – MapReduce: The Programming Model and Practice, by Jerry Zhao

5 Introduction (2/2) 5 Many practical computing problems concern large graphs MapReduce is ill-suited for graph processing –Many iterations are needed for parallel graph processing –Materializations of intermediate results at every MapReduce iteration harm performance Large graph data Web graph Transportation routes Citation relationships Social networks Graph algorithms PageRank Shortest path Connected components Clustering techniques

6 Single Source Shortest Path (SSSP) 6 Problem –Find shortest path from a source node to all target nodes Solution –Single processor machine: Dijkstras algorithm

7 Example: SSSP – Dijkstras Algorithm

8 Example: SSSP – Dijkstras Algorithm

9 Example: SSSP – Dijkstras Algorithm

10 Example: SSSP – Dijkstras Algorithm

11 Example: SSSP – Dijkstras Algorithm

12 Example: SSSP – Dijkstras Algorithm

13 Single Source Shortest Path (SSSP) 13 Problem –Find shortest path from a source node to all target nodes Solution –Single processor machine: Dijkstras algorithm –MapReduce/Pregel: parallel breadth-first search (BFS)

14 MapReduce Execution Overview 14

15 Example: SSSP – Parallel BFS in MapReduce 15 Adjacency matrix Adjacency List A: (B, 10), (D, 5) B: (C, 1), (D, 2) C: (E, 4) D: (B, 3), (C, 9), (E, 2) E: (A, 7), (C, 6) A BC DE ABCDE A 5 B12 C4 D392 E76

16 Example: SSSP – Parallel BFS in MapReduce A BC DE Map input: > >> Map output: >> Flushed to local disk!!

17 Example: SSSP – Parallel BFS in MapReduce 17 Reduce input: >> >> >> >> >> A BC DE

18 Example: SSSP – Parallel BFS in MapReduce 18 Reduce input: >> >> >> >> >> A BC DE

19 Example: SSSP – Parallel BFS in MapReduce 19 Reduce output: > = Map input for next iteration >> Map output: A BC DE >> Flushed to DFS!! Flushed to local disk!!

20 Example: SSSP – Parallel BFS in MapReduce 20 Reduce input: >> >> >> >> >> A BC DE

21 Example: SSSP – Parallel BFS in MapReduce 21 Reduce input: >> >> >> >> >> A BC DE

22 Example: SSSP – Parallel BFS in MapReduce 22 Reduce output: > = Map input for next iteration >> … the rest omitted … A BC DE Flushed to DFS!!

23 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 23

24 Computation Model (1/3) 24 Input Output Supersteps (a sequence of iterations)

25 Computation Model (2/3) 25 Think like a vertex Inspired by Valiants Bulk Synchronous Parallel model (1990) Source:

26 Computation Model (3/3) 26 Superstep: the vertices compute in parallel –Each vertex Receives messages sent in the previous superstep Executes the same user-defined function Modifies its value or that of its outgoing edges Sends messages to other vertices (to be received in the next superstep) Mutates the topology of the graph Votes to halt if it has no further work to do –Termination condition All vertices are simultaneously inactive There are no messages in transit

27 Example: SSSP – Parallel BFS in Pregel

28 Example: SSSP – Parallel BFS in Pregel

29 Example: SSSP – Parallel BFS in Pregel

30 Example: SSSP – Parallel BFS in Pregel

31 Example: SSSP – Parallel BFS in Pregel

32 Example: SSSP – Parallel BFS in Pregel

33 Example: SSSP – Parallel BFS in Pregel

34 Example: SSSP – Parallel BFS in Pregel

35 Example: SSSP – Parallel BFS in Pregel

36 Differences from MapReduce 36 Graph algorithms can be written as a series of chained MapReduce invocation Pregel –Keeps vertices & edges on the machine that performs computation –Uses network transfers only for messages MapReduce –Passes the entire state of the graph from one stage to the next –Needs to coordinate the steps of a chained MapReduce

37 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 37

38 C++ API 38 Writing a Pregel program –Subclassing the predefined Vertex class Override this! in msgs out msg

39 Example: Vertex Class for SSSP 39

40 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 40

41 System Architecture 41 Pregel system also uses the master/worker model –Master Maintains worker Recovers faults of workers Provides Web-UI monitoring tool of job progress –Worker Processes its task Communicates with the other workers Persistent data is stored as files on a distributed storage system (such as GFS or BigTable) Temporary data is stored on local disk

42 Execution of a Pregel Program 42 1.Many copies of the program begin executing on a cluster of machines 2.The master assigns a partition of the input to each worker –Each worker loads the vertices and marks them as active 3.The master instructs each worker to perform a superstep –Each worker loops through its active vertices & computes for each vertex –Messages are sent asynchronously, but are delivered before the end of the superstep –This step is repeated as long as any vertices are active, or any messages are in transit 4.After the computation halts, the master may instruct each worker to save its portion of the graph

43 Fault Tolerance 43 Checkpointing –The master periodically instructs the workers to save the state of their partitions to persistent storage e.g., Vertex values, edge values, incoming messages Failure detection –Using regular ping messages Recovery –The master reassigns graph partitions to the currently available workers –The workers all reload their partition state from most recent available checkpoint

44 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 44

45 Experiments 45 Environment –H/W: A cluster of 300 multicore commodity PCs –Data: binary trees, log-normal random graphs (general graphs) Naïve SSSP implementation –The weight of all edges = 1 –No checkpointing

46 Experiments 46 SSSP – 1 billion vertex binary tree: varying # of worker tasks

47 Experiments 47 SSSP – binary trees: varying graph sizes on 800 worker tasks

48 Experiments 48 SSSP – Random graphs: varying graph sizes on 800 worker tasks

49 Outline Introduction Computation Model Writing a Pregel Program System Implementation Experiments Conclusion & Future Work 49

50 Conclusion & Future Work 50 Pregel is a scalable and fault-tolerant platform with an API that is sufficiently flexible to express arbitrary graph algorithms Future work –Relaxing the synchronicity of the model Not to wait for slower workers at inter-superstep barriers –Assigning vertices to machines to minimize inter-machine communication –Caring dense graphs in which most vertices send messages to most other vertices

51 Thank You! Any questions or comments?


Download ppt "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."

Similar presentations


Ads by Google