1 / 28

Optimizing Graph Algorithms on Pregel-like Systems *

Optimizing Graph Algorithms on Pregel-like Systems *. Semih Salihoglu Jennifer Widom. outline. Introduction Algorithms Optimization Techniques. Pregel Overview 基于BSP模型 Computation is broken down into iterations called supersteps, and all workers synchronize at the end of each superstep.

gypsy
Télécharger la présentation

Optimizing Graph Algorithms on Pregel-like Systems *

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Optimizing Graph Algorithms on Pregel-like Systems* Semih SalihogluJennifer Widom

  2. outline • Introduction • Algorithms • Optimization Techniques

  3. Pregel Overview • 基于BSP模型 • Computation is broken down into iterations called supersteps, and all workers synchronize at the end of each superstep. • 在vertex.compute() 中实现算法逻辑,每一个superstep执行一次vertex.compute() 。 • GPS和Giraph可选择实现master.compute() 。

  4. Costs of Computation • communication • number of supersteps • memory • computation

  5. The API of Pregel • Vertex class: Programmers subclass the Vertex class and code the vertex-centric logic of the computation by implementing the vertex.compute() function • VertexValue class:Encapsulates the user-defined state associated with each vertex • Message class:Encapsulates the messages sent between vertices • Aggregators (Global Objects): Objects visible to all verticesand used for coordination, data sharing, and statistics aggregation • Master class:Programmers can optionally subclass the Master class, and implement the master.compute() function, which getscalled at the beginning of each superstep

  6. outline • Introduction • Algorithms • Optimization Techniques

  7. Strongly Connected Components • The originalalgorithm: • Transpose Graph Formation: • 构造图的转置举证GT • Trimming: • 去除只含有出度和入度或者两者都没有的顶点 • Forward-Traversal: • 遍历各个顶点,并标号(每个顶点能到达的顶点最大ID) • Backward-Traversal: • 遍历GT,并从图中移除侦测到的SCC。 • 重复执行Trimming、Forward-Traversal、Backward-Traversal,知道图中没有顶点。

  8. The distributed implementation :every vertices contain two fields (colorID,transposeNeighbors) • Transpose Graph Formation: • 第一个superstep,每个顶点发送它的ID到它所有的outgoing neighbors。 • 第二个superstep,顶点将接收到的ID存到transposeNeighbors中。 • Trimming: • 一个superstep,将每个只有入度、出度或者都没有的顶点,设置colorID为自身的ID,并变为inactive。 • Forward-Traversal: • Start phase:Each vertex sets its colorID to its own ID and propagates its ID to its outgoing neighbors. • Rest phase:每个顶点根据得到的最大ID更新colorID ,并传播出去知道收敛。 • Backward-Traversal: • Start phase:ID等于colorID的顶点传播它的ID到transposeNeighbors. • Rest phase: 收到colorID等于自身colorID, propagates its colorID in the transpose graph; (2) sets itself inactive; (3) sets the “convergedvertex-exists” global object to true.

  9. Minimum Spanning Forest • The original algorithm • Min-Edge-Picking • Supervertex-Finding • Edge-Cleaning-and-Relabeling • Supervertex-Formation

  10. The distributed implementation:each vertex stores a type and a pointer field.Each vertex v also has a pickedEdgeSrcID and a pickedEdgeDstID field • Min-Edge-Picking: Each vertex picks its minimum-weight edge and writes its pickedEdgeSrcID and pickedEdgeDestID fields • Supervertex-Finding:Question and Answer • Edge-Cleaning-and-Relabeling: • The First superstep, each vertex v sends its ID and supervertex ID to all of its neighbors • The second superstep, vertex v for each of its edges e = (v; u)either deletes e if u has the same supervertex ID, or relabels e to point to u’s new ID. • Supervertex-Formation: • The First superstep, every subvertex sends its edges to its supervertex and becomes inactive. • The second superstep,each supervertex merges and stores these edges,keeping the minimum-weight for duplicates

  11. Graph Coloring (GC) • The algorithm maintains three sets of vertices:S、NotInS、Unknown • MIS-Degree-Initialization • Selection • Conflict-Resolution • NotInS-Discovery-and-Degree-Adjusting-1 • Degree-Adjusting-2 • Color-Assignment

  12. Approximate Maximum Weight Matching(MWM) • The algorithm computes a 1/2-approximation to the maximummatching in the graph • Max-Weight-Edge-Picking • Match-Discovery • Removing-Matched-Neighbors

  13. Weakly Connected Components (WCC) • Similar to Forward-Traversal phase of the SCC algorithm • Startphase: vertices initialize their wccIDs to their own IDs and propagate their IDs to their neighbors • Rest phase: vertices update their own wccIDs with the maximum wccID they have seen, and propagate their wccIDs (if updated).The Rest phase continues until wccIDs converge.

  14. outline • Introduction • Algorithms • Optimization Techniques

  15. FINISHING COMPUTATIONS SERIALLY (FCS) • High-level Description: • Performs serial version of the algorithm,or a phase of the algorithm, inside master.compute() • FCS can be applied to algorithms in which the size of the activesubgraph shrinks throughout the computation.

  16. Implementation • Three global objects • the number of edges in the active-subgraph. • the active-subgraph when serial computation is triggered. • the results of the serial execution which are used by the potentially-active vertices to update their values in a superstep following serial execution. • The serial computation is performed inside master.compute(). • One superstep execution for vertices to read the results.

  17. Cost Analysis • Reduce the number ofsuperstep executions and communication • It incurs the overhead: • monitoring the size of the active-subgraph • serial computation at the master • communication cost of sending theactivesubgraph to the master and the results of the computation back tothe workers • one superstep execution for vertices to read the results

  18. Experiments

  19. STORING EDGES AT SUBVERTICES(SEAS) IN MSF • High-level Description • Stores the edges of supervertices in a distributed fashion among its subvertices

  20. Implementation • Min-Edge-Picking • the first superstep:subvertices send their local minimum-weight edges to the supervertex • the secondsuperstep: a supervertex s picks the minimum of its local edge and the edges it receives • The Supervertex-Finding and Edge-Cleaning-and-Relabeling phases are performed as usual • New-SupervertexNotification(代替Supervertex-Formation) • Suppose we are in iteration i. Every subvertex from iteration i -1 sends a message to its latest supervertex containing its ID. • Every supervertex s from iteration i -1 sends a message back to its supervertices containing the ID of its new supervertex (possibly s itself). • Subvertices from iteration i -1 update their supervertices with the ID they receive.

  21. Cost Analysis • we avoid the communication and computation performed in the Supervertex-Formationphase, which is proportional to the number of edges in the graph • at the expense ofincreasing the cost of Min-Edge-Picking and incurring the costs of New- Supervertex-Formation, which are proportional to the number of vertices in the graph

  22. EDGE CLEANING ON DEMAND(ECOD) • High-level Description: • The natural implementation of edge cleaning on Pregel-like systems:vertices send messages to their neighbors in one superstep, and remove neighbors in another, possibly based on the contents of the messages. • ECOD:Vertices “pretend” every edge is valid,edges are cleaned only when they are usedas part of the computation

  23. Implementation for MWM: • v只向匹配的顶点u发送信息,并在Removing-Matched-Neighbors 移除,其他相邻节点保持不变 • v保持活跃,使其它邻节点能发现和v之间的点可移除的 • Cost Analysis for MWM: • ECOD can avoid the communication and computation of deleting some edges unnecessarily • ECOD may slow down the convergence of the algorithm, decreasing the number of vertices that match (or that discover not to match any other vertex) in each iteration, which increases the number of iterations

  24. Implementation for MSF • Edge-Cleaning-and-Relabeling :当接收到邻点发来的 supervertex ID和自身的 supervertex ID相同,不执行移除邻点操作 • Stale-Edge-Discovery (代替Min-Edge-Picking) • The first superstep:each vertex v tentatively picks its minimum weight edge u and sends a “question” message to u containing v’s ID and v’s supervertex ID,i • The secondsuperstep: if u belongs to a different supervertex j , it sends an answer message back to v containing the value j • The thirdsuperstep:if v receives an answer message, it successfully picks u as its minimum-weight edge and relabels it to j ; otherwise v removes u • All-Stale-EdgesDiscovery :执行一定次数Stale-Edge-Discovery 后,没有成功取得minimum-weight边的顶点发送一个消息,消除所有失效边 • Cost Analysis for MSF • ECOD avoids the communication and computation of the EdgeCleaning-and-Relabeling phase • ECOD incurs the extra communication and computation cost of question andanswer messages in the new Stale-Edge-Discovery and All-StaleEdges-Discovery phases.

  25. Experiments

  26. SINGLE PIVOT OPTIMIZATION (SP) • High-level Description:Detects giant component efficiently by starting the computation from a single vertex • Implementation:Added a new initial phase,Random-Pivot-Picking, every vertex updates a custom global object that picks one of the vertices as pivot uniformly at random. Then, only the pivot starts propagating its ID in the WCC algorithm and the Forward-Traversal phase of the SCC algorithm • Cost Analysis: • If SP picks a pivot vertex from the giant component, it avoids all of the unnecessary propagation messages and computation costs of detecting the giant component • On the other hand, for each iteration,failing to pick a pivot r from the giant component, SP decreases the parallelism of the algorithms: instead of detecting multiple components in an iteration, SP detects only r’s component.

More Related