Pregel A System for Large-Scale Graph Processing Grzegorz Malewicz, - - PowerPoint PPT Presentation

pregel
SMART_READER_LITE
LIVE PREVIEW

Pregel A System for Large-Scale Graph Processing Grzegorz Malewicz, - - PowerPoint PPT Presentation

Pregel A System for Large-Scale Graph Processing Grzegorz Malewicz, Matthew H. Austern, et. al. Google, Inc. 2010 ACM SIGMOD Conference Presented By: Ezequiel Aguilar Gonzalez Computer Science and Engineering The University of Texas at


slide-1
SLIDE 1

Pregel

A System for Large-Scale Graph Processing

Grzegorz Malewicz, Matthew H. Austern, et. al. Google, Inc. 2010 ACM SIGMOD Conference

Presented By: Ezequiel Aguilar Gonzalez Computer Science and Engineering The University of Texas at Arlington 2018

slide-2
SLIDE 2

Ezequiel Aguilar Gonzalez

Graph Processing

  • Nodes represent entities (people, businesses,

accounts…)

  • Properties are pertinent information that relate

to nodes

  • Edges interconnect nodes to nodes or nodes to

properties and they represent the relationship between the two

slide-3
SLIDE 3

Ezequiel Aguilar Gonzalez

Big Graphs

Google: > 1 trillion indexed pages Web Graph Social Network

Facebook: > 800 million active users

31 billion RDF triples in 2011 Information Network Biological Network

De Bruijn: 4k nodes (k = 20, … , 40)

Graphs in Machine Learning

100M Ratings, 480K Users, 17K Movies

31 billion RDF triples in 2011

[1] Arijit Khan. Systems Group. ETH Zurich

slide-4
SLIDE 4

Ezequiel Aguilar Gonzalez

Big Graphs

[2] Y. Wu. Washington State University 4

Social Scale 100B (1011) Web Scale 1T (1012) Brain Scale, 100T (1014) 100M(108) US Road Human Connectome, The Human Connectome Project, NIH Knowledge Graph BTC Semantic Web Web graph (Google) Internet

slide-5
SLIDE 5

Ezequiel Aguilar Gonzalez

Graph Computing

  • Diffusion:

propagate information from a vertex to neighbors

slide-6
SLIDE 6

Ezequiel Aguilar Gonzalez

Graph Computing

  • Diffusion:

propagate information from a vertex to neighbors

  • Fusion: aggregate

information from neighbors to a set

  • f entities
slide-7
SLIDE 7

Ezequiel Aguilar Gonzalez

The Problem

  • Graph computations involve local

data, and the connectivity between vertices is sparse. The data may not all fit into one node.

Large Graph Data Graph Algorithms Web Page Rank Transportation Routes Shortest Path Citation Relationships Connected Components Social Networks Clustering Techniques

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-8
SLIDE 8

Ezequiel Aguilar Gonzalez

The Problem

  • Many problems can be modeled by

graphs and solved with appropriate graph algorithms

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

Large Graph Data Graph Algorithms Web Page Rank Transportation Routes Shortest Path Citation Relationships Connected Components Social Networks Clustering Techniques

slide-9
SLIDE 9

Ezequiel Aguilar Gonzalez

The Problem

  • Many problems can be modeled by

graphs and solved with appropriate graph algorithms

  • Efficient processing of large graphs is

challenging

  • Very little work per vertex
  • Changing degree of parallelism
  • Poor locality of memory access
  • Running over many machines makes the problem

worse

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-10
SLIDE 10

Ezequiel Aguilar Gonzalez

The Options

  • Infrastructure for graph processing – expensive

to design

  • Single computer and library approach – not

scalable

  • Use existing shared memory parallel graph

algorithm – no fault-tolerance

slide-11
SLIDE 11

Ezequiel Aguilar Gonzalez

The Options – MapReduce for Graph Analytics

  • MapReduce does not directly support iterative algorithms
  • Invariant graph-topology-data re-loaded and re-processed at each

iteration à wasting I/O, network bandwidth, and CPU

  • Materializations of intermediate results at every MapReduce iteration

harm performance

  • Extra MapReduce job on each iteration for detecting if a fixpoint has

been reached

Each Page Rank Iteration: Input: (id1, [PRt(1), out11, out12, … ]), (id2, [PRt(2), out21, out22, … ]), … Output: (id1, [PRt+1(1), out11, out12, … ]), (id2, [PRt+1(2), out21, out22, … ]), …

slide-12
SLIDE 12

Ezequiel Aguilar Gonzalez

Pregel

  • Developed at Google
  • Provides scalability
  • Fault-tolerance
  • Flexibility to express arbitrary algorithms
  • The high level organization of Pregel

program is inspired by Valiant’s Bulk Synchronous Parallel Model (‘90).

slide-13
SLIDE 13

Ezequiel Aguilar Gonzalez

Bulk Synchronous Parallelism (BSP)

P1 P2 P3 P4 P5

  • Processors
  • Have local memory
  • Can perform some computation

P1 P2 P3 P4 P5

  • Processors can communicate

pairwise

  • Communication can overlap with

another node’s computation

[3] Gupta, Amarnath. UC San Diego

Barrier Synchronization

slide-14
SLIDE 14

Ezequiel Aguilar Gonzalez

Vertex-Oriented

  • Based on BSP model
  • Provides directed graph to Pregel
  • Runs your computation at each vertex (processor)
  • Repeats until every computation at each vertex votes to halt
  • Pregel returns directed graph as a result
slide-15
SLIDE 15

Ezequiel Aguilar Gonzalez

Pregel Organized via C++ API

  • Supersteps S
  • Application code subclasses Vertex, writes a Compute method
  • Can get/set Vertex value
  • Can get/set outgoing edges values
  • Can send/receive messages
  • Reads messages sent to V in superstep S-1. Sends messages to other

vertices that will be received at superstep S+1; modifies state of V and its

  • utgoing edges
slide-16
SLIDE 16

Ezequiel Aguilar Gonzalez

C++ API

  • Message passing
  • No guaranteed message delivery order
  • Messages delivered exactly once
  • Can send a message to any node
  • If destination doesn’t exist, user’s function is called
slide-17
SLIDE 17

Ezequiel Aguilar Gonzalez

Question 01

What is superstep in the Pregel graph processing model? In the single source shortest path problem what computation is involved in a superstep?

slide-18
SLIDE 18

Ezequiel Aguilar Gonzalez

Pregel Supersteps

Input Output

Computation Communication Superstep Synchronization

PREGEL Computation Model

  • Series of iterations
  • Each vertex V invokes a functional in

parallel

  • Can read messages sent in previous

superstep (S-1)

  • Can send messages, to be read at

the next superstep (S+1)

  • Can modify state of outgoing edges
slide-19
SLIDE 19

Ezequiel Aguilar Gonzalez

Pregel Supersteps

Superstep 1 Get required data Compute – Yes or No? Exchange messages – Yes or No? Superstep 2 Get required data Compute – Yes or No? Exchange messages – Yes or No?

Synchronize Synchronize

slide-20
SLIDE 20

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

¥ ¥ ¥ ¥ 10 5 2 3 2 1 9 7 4 6 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-21
SLIDE 21

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

¥ ¥ ¥ ¥ 10 5 2 3 2 1 9 7 4 6 10 5 ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-22
SLIDE 22

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

10 5 ¥ ¥ 10 5 2 3 2 1 9 7 4 6 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-23
SLIDE 23

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

10 5 ¥ ¥ 10 5 2 3 2 1 9 7 4 6 11 7 12 8 14 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-24
SLIDE 24

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

8 5 11 7 10 5 2 3 2 1 9 7 4 6 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-25
SLIDE 25

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

8 5 11 7 10 5 2 3 2 1 9 7 4 6 9 14 13 15 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-26
SLIDE 26

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

8 5 9 7 10 5 2 3 2 1 9 7 4 6 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-27
SLIDE 27

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

8 5 9 7 10 5 2 3 2 1 9 7 4 6 13 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-28
SLIDE 28

Ezequiel Aguilar Gonzalez

SSSP – Parallel BFS in Pregel

8 5 9 7 10 5 2 3 2 1 9 7 4 6 Active vertex Inactive vertex

http://ranger.uta.edu/~sjiang/CSE6350-spring-18/index.htm

slide-29
SLIDE 29

Ezequiel Aguilar Gonzalez

Question 02

What does synchronicity in the Pregel’s execution refer to? What benefits can it bring?

slide-30
SLIDE 30

Ezequiel Aguilar Gonzalez

Pregel Synchornization

Output

  • Barrier synchronization
  • All messages are exchanged reliably
  • All peers wait for others to enter the barrier
  • After coming out of the barrier, each peer

can work independently on messages sent to it from other peers, and the cycle repeats

  • Disadvantage: Fast processors can be delayed

by slow ones

  • Benefits:
  • Ensures that Pregel programs are inherently

free of deadlocks and data races

slide-31
SLIDE 31

Ezequiel Aguilar Gonzalez

Question 03

How is a Pregel program terminated (completing its execution)?

slide-32
SLIDE 32

Ezequiel Aguilar Gonzalez

Pregel Program Termination

Active Inactive Message Received Votes to Halt

  • Algorithm termination is based on every

vertex voting to halt

  • In superstep 0, every vertex is in the

active state

  • A vertex deactivates itself by voting to

halt

  • It can be reactivated by receiving an

(external) message

slide-33
SLIDE 33

Ezequiel Aguilar Gonzalez

Question 04

Use Figure 2 to illustrate a Pregel program’s execution

slide-34
SLIDE 34

Ezequiel Aguilar Gonzalez

Finding the largest value in a graph

3 6 2 1 Superstep 0

slide-35
SLIDE 35

Ezequiel Aguilar Gonzalez

Finding the largest value in a graph

Superstep 1 3 6 2 1 6 6 2 6 Superstep 0

slide-36
SLIDE 36

Ezequiel Aguilar Gonzalez

Finding the largest value in a graph

Superstep 1 3 6 2 1 6 6 2 6 Superstep 0 6 6 6 6 Superstep 2

slide-37
SLIDE 37

Ezequiel Aguilar Gonzalez

Finding the largest value in a graph

Superstep 1 3 6 2 1 6 6 2 6 Superstep 0 6 6 6 6 Superstep 2 6 6 6 6 Superstep 3

slide-38
SLIDE 38

Ezequiel Aguilar Gonzalez

Execution of a Pregel Program

  • 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 and 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

slide-39
SLIDE 39

Ezequiel Aguilar Gonzalez

System Architecture

  • Pregel system 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, HDFS, or BigTable)

  • Temporary data is stored on local disk
slide-40
SLIDE 40

Ezequiel Aguilar Gonzalez

System Architecture

slide-41
SLIDE 41

Ezequiel Aguilar Gonzalez

Fault Tolerance

  • 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

slide-42
SLIDE 42

Ezequiel Aguilar Gonzalez

Graph Algorithms implemented with Pregel

  • Page Rank
  • Triangle Counting
  • Connected Components
  • Shortest Distance
  • Random Walk
  • Graph Coarsening
  • Graph Coloring
  • Minimum Spanning Forest
  • Community Detection
  • Collaborative Filtering
  • Belief Propagation
  • Named Entity Recognition
slide-43
SLIDE 43

Ezequiel Aguilar Gonzalez

Pregel Summary

  • Bulk Synchronous Parallel model
  • Vetex-centrix
  • Superstep: sequence of iterations
  • Master-worker model
  • Communication: message passing
slide-44
SLIDE 44

Ezequiel Aguilar Gonzalez

Questions