a case study of complex graph analysis in distributed ...slotag/pres/pres_dist-ipdps16.pdf · a...

32
A Case Study of Complex Graph Analysis in Distributed Memory: Implementation and Optimization George M. Slota 1,2 , Siva Rajamanickam 1 , Kamesh Madduri 2 1 Sandia National Laboratories a 2 The Pennsylvania State University www.gmslota.com [email protected] 24 May 2016 a Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. 1 / 30

Upload: vudan

Post on 20-Apr-2018

218 views

Category:

Documents


5 download

TRANSCRIPT

A Case Study of Complex Graph Analysis

in Distributed Memory:

Implementation and Optimization

George M. Slota1,2, Siva Rajamanickam1,Kamesh Madduri2

1Sandia National Laboratoriesa

2The Pennsylvania State Universitywww.gmslota.com [email protected]

24 May 2016

aSandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a

wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National NuclearSecurity Administration under contract DE-AC04-94AL85000.

1 / 30

Presentation Overview

I Motivating massive-scale distributed-memory analytics

I Parallel implementations of six analytics for processingmassive (hyperlink) graphs

I PageRank, Harmonic centrality, finding largest SCC,WCC decomposition, approximate K-core computation,community structure detection

I Common optimizations

I Performance results on the Blue Waters supercomputer

2 / 30

Graphs are ...

I EverywhereI Internet, Social networks, Biology, Scientific computing

I MassiveI Internet: e.g., Google crawls trillions of pages, index size

is over 100 PBI Social networks: e.g., Facebook has 1.6 B active usersI Neuroscience: e.g., human brain has 86 B neurons

I ComplexI Real-world graph characteristics impose computational

challenges: skewed degree distributions (power law,irregular) and small-world nature

I Many interesting graph problems are NP-complete

3 / 30

Parallel platforms are ...

I EverywhereI mobile phones to supercomputers

I PowerfulI Energy-efficient multicore and manycore processorsI Aggregate memory capacities and bandwidths growing

at an exponential rate

I Challenging to programI Using compute resources efficientlyI Load balancing, memory localityI Reducing inter-node communication

4 / 30

Questions Motivating our Work

I Q: How efficiently can we analyze large publicly-available graph instances on multi-node platforms?

I e.g., 2012 Web Data Commons (WDC12) hyperlinkgraph: 3.6 billion vertices (URLs) and 129 billion edges(directed links)

I Q: What optimizations strategies and abstractionsare common to multiple graph analytics?

I Best practices for distributed-memory graph analyticsI Guide and simplify new implementations

I Q: Can we write simple, yet high-performance code?I 1000s of lines of code; within small factor of Graph500

BFS performance

5 / 30

Graphs+HPC, The State-of-the-art

I Many publicly-available frameworks exist for graph analysis

I Shared-memory libraries (Galois, Ligra, etc.) cannot process100 B+ edge graphs (yet)

I External memory frameworks (e.g., FlashGraph) might requirespecialized hardware (SSD arrays) and big shared-memorynodes (512 GB+)

I MapReduce-like frameworks (e.g., Giraph) are limited by diskI/O and untuned inter-node communication

I Several distributed-memory graph frameworks (e.g., GraphLaband its derivatives, GraphX) fail to the process WDC12 graph

6 / 30

Challenges and Research Goals

I Skewed vertex degree distributions of graphs makedistributed-memory parallelization difficult

I Use hybrid programming models to fully exploit sharedmemory on a node

I Investigate several distributed-memory graph layoutalternatives

I Optimizations may be specialized for graph analytic (e.g.,BFS, SSSP) and not portable across platforms

I Investigate algorithms for multiple analyticsI Optimize end-to-end running time (including parallel

I/O)

7 / 30

Talk Outline

I Motivating massive-scale distributed-memory analytics

I Parallel implementations of six analytics for processingmassive (hyperlink) graphs

I Performance results

I 2012 Web Data Commons graph analysis

8 / 30

Massive Distributed-memory Graph Analytics

I Optimized implementations of six analytics

I End-to-end tuning with almost no serial routines

I Hybrid parallelism with MPI and OpenMP

I Parallel I/O

I Compact and efficient: ∼2,000 total lines of code

9 / 30

Graph Analytics Considered

I Centrality: PageRank iterations, Harmonic centrality

I Connectivity: finding the largest strongly connectedcomponent (SCC), weakly connected componentdecomposition (WCC)

I Approximate K-core decomposition, or computingcoreness upper bound for every vertex

I Global community structure detection using labelpropagation

I We apply all these analytics to the 2012 Web DataCommons graph (3.6 billion vertices, 129 billion edges)

I Though optimized for large scale, also efficient at smallscale

10 / 30

Design Tradeoffs and ConsiderationsTradeoffs (ease of implementation vs. scalability):

I 1D (vertex-based) vs. 2D (edge-based) partitioning andgraph layout

I Bulk-synchronous vs. asynchronous communicationI Programming language and parallel programming model

I High-level language (e.g., Scala) vs. C/C++I High-level model (e.g., Spark) vs. MPI-only vs.

MPI+OpenMP

Other considerations:I In-memory graph representation

I Vanilla CRS-like vs. compressed (e.g., with RLE)adjacencies

I Partitioning strategy (with 1D layout)I Vertex-balanced, Edge-balanced, Random vs.

Explicit partitioning11 / 30

Graph Representation

Data Size Description

n global 1 Global vertex countm global 1 Global edge countn loc 1 Task-local vertex countn gst 1 Ghost vertex countm out 1 Task-local out-edges countm in 1 Task-local in-edges count

out edges m out Array of out-edgesout indexes n loc Start indices for local out-edgesin edges m in Array of in-edgesin indexes n loc Start indices for local in-edges

map n loc+n gst Global to local id hash tableunmap n loc+n gst Array for local to global id conv.tasks n gst Array storing owner of ghost vertices

12 / 30

Optimizing Inter-process Communication

Observation: many iterative graph algorithms have similarcommunication patterns

I (Vanilla) BFS-like: frontier expansion, information pushedfrom vertices to adjacencies, volume of data exchanged isvariable or fixed across iterations

I (Vanilla) PageRank-like: information pulled fromincoming arcs, either fixed or variable communicationpattern in every iteration

We use optimized skeleton code for these two (or four)patterns, fill in analytic-specific details

13 / 30

Analytic-specific Details

BFS-like:

I SCC: 1st stage of Multistep-SCC (FW-BW algorithm)

I WCC: 1st stage of Multistep-WCC

I (Approx.) K-Core: Iterative searches to find upperbound power-of-2 coreness

I Harmonic Centrality: Routine for calculating centralityvalue of any given vertex

PageRank-like:

I PageRank: Standard iterative algorithm

I Label Propagation: Community detection algorithm

I WCC: 2nd stage of Multistep-WCC

14 / 30

BFS-like Algorithmic Pattern

1: procedure BFS-like(G (V ,E )) . Task Parallel2: for all v ∈ V do . Thread Parallel3: D(v)← init()4: if addToQ(v) then5: Qnext ← 〈v ,D(v)〉6: while any Qnext 6= ∅ do7: 〈Q,D〉 ← AllToAllExchange(Qnext) . Thread Parallel8: Qnext ← ∅9: for all v ∈ Q do . Thread Parallel

10: for all 〈v , u〉 ∈ E do11: D(u)← update()12: if addToQ(u) then13: Qnext ← 〈u,D(u)〉14: return D

15 / 30

BFS-like Algorithmic Pattern

1: procedure BFS-like(G (V ,E )) . Task Parallel2: for all v ∈ V do . Thread Parallel3: D(v)← init()4: if addToQ(v) then5: Qnext ← 〈v ,D(v)〉6: while any Qnext 6= ∅ do7: 〈Q,D〉 ← AllToAllExchange(Qnext) . Thread Parallel8: Qnext ← ∅9: for all v ∈ Q do . Thread Parallel

10: for all 〈v , u〉 ∈ E do11: D(u)← update()12: if addToQ(u) then13: Qnext ← 〈u,D(u)〉14: return D

16 / 30

PageRank-like Algorithmic Pattern

1: procedure PageRank-like(G (V ,E )) . Task Parallel2: for all v ∈ V do . Thread Parallel3: D(v)← init()4: if addToQ(v) then5: Qnext ← 〈v ,D(v)〉6: while any Qnext 6= ∅ do7: 〈Q,D〉 ← AllToAllExchange(Qnext) . Thread Parallel8: Qnext ← ∅9: for all v ∈ Q do . Thread Parallel

10: for all 〈v , u〉 ∈ E do11: D(v)← update()

12: if addToQ(v) then13: Qnext ← 〈v ,D(v)〉14: return D

17 / 30

Talk Outline

I Motivating massive-scale distributed-memory analytics

I Parallel implementations of six analytics for processingmassive (hyperlink) graphs

I Performance results

I 2012 Web Data Commons graph analysis

18 / 30

Experimental SetupTest systems, Graphs

I Blue Waters: dual-socket AMD Interlagos 6276, 16 cores, 64 GBmemory

I Compton cluster: dual-socket Intel Xeon E5-2670, 16 cores, 64 GBmemory

Graph n m Davg Source

Web Crawl (WC) 3.6 B 129 B 36 [Meusel et al., 2015]R-MAT 3.6 B 129 B 36 [Chakrabarti et al., 2004]Rand-ER 3.6 B 129 B 36 Erdos-Renyi

R-MAT 225-232 229-236 16 [Chakrabarti et al., 2004]Rand-ER 225-232 229-236 16 Erdos-Renyi

Pay 39 M 623 M 16 [Meusel et al., 2015]LiveJournal 4.8 M 69 M 14 [Leskovec et al., 2009]Google 875 K 5.1M 5.8 [Leskovec et al., 2009]

19 / 30

End-to-end Analysis256 nodes of Blue Waters

I Executed all six analytics on WC (with three partitioning strategies)and synthetic (R-MAT, Rand-ER) graphs of the same size

I With vertex block ( np ) and edge block (m

p ) partitioning strategies,

cumulative time on WC is about 20 minutes (+ 3 minutes for I/Oand preprocessing)

I We use vertex block ( np ) partitioning for R-MAT and Rand-ER

Execution time in secondsWC R-MAT Rand-ER

Analytic Partitioning np

mp

Rand np

np

PageRank (20 iter) 87 111 227 125 121Label Propagation (10 iter) 400 435 367 993 992

WCC 88 63 112 68 77Harmonic Centrality (1 iter) 54 46 101 252 84

K-core (≈ 27 BFS’es) 445 363 583 579 481Largest SCC (≈ 2 BFS’es) 184 108 184 89 83

20 / 30

WC performance rates256 nodes of Blue Waters, best partitioning strategy chosen

I Perf. units are similar to GTEPS (Giga Traversed EdgesPer Second): m∗niter

t×109

Analytic Time (s) Perf. Our evaluation

PageRank 87 29.6Label Propagation 367 3.5WCC 63 2.0Harmonic Centrality 46 2.8K-core 363 9.6Largest SCC 108 2.4

Overall 1034 7.6

Graph500 (estimate) 119.2

21 / 30

Weak Scaling on Synthetic GraphsBlue Waters: 8 to 1024 nodes

I With vertex block (np

) partitioning

I 222 vertices per node and 226 edges per compute node

HarmonicCentrality PageRank

0

50

100

150

200

250

8 16 32 64 128 256 512 1024 8 16 32 64 128 256 512 1024Nodes

Exe

cutio

n tim

e (s

)

R−MAT Rand−ER

22 / 30

Label Propagation: Strong Scaling ResultsBlue Waters: 256 to 4096 nodes

I PageRank-like in general strong scales nicely; BFS-like ismore dependent on graph structure (high number ofsynchronizations and low computation per iteration)

4

8

12

16

256 512 1024 2048 4096Nodes

Spe

edup

WC−np WC−mp WC−rand R−MAT Rand−ER

23 / 30

Comparison to Distributed Graph FrameworksOur approach vs. GraphX, PowerGraph, PowerLyra

I Compared GraphX (GX), PowerGraph (PG), and PowerLyra (PL) on 16 nodesof Compton to our code (SRM)

I About 38× faster on average for PageRank (top), 201× faster for WCC(bottom) against distributed memory frameworks

44x 78x 26x

Google LiveJournal Pay

1

10

100S

RM

PG PL

GX

SR

M

PG PL

GX

SR

M

PG PL

GX

Pag

eRan

k S

peed

up v

s. G

raph

X

1573x 668x 249x

Google LiveJournal Pay

1

10

100

1000

SR

M

PG PL

GX

SR

M

PG PL

GX

SR

M

PG PL

GXW

CC

Spe

edup

vs.

Gra

phX

24 / 30

Talk Outline

I Motivating massive-scale distributed-memory analytics

I Parallel implementations of six analytics for processingmassive (hyperlink) graphs

I Performance results

I 2012 Web Data Commons graph analysis

25 / 30

Community Structure of WC

I Used label propagation to identify disjoint communities

I Community size distribution appears to follow aheavy-tailed power law

Largest Communities (numbers in millions)

Size mcomm mcut Rep. Page

112 2126 32 YouTube18 548 277 Tumblr

9 516 84 Creative Commons8 186 85 WordPress7 57 83 Amazon6 41 21 Flickr

26 / 30

Centrality Measurements of Web Crawl

I Determined the top 10 web pages according to differentcentrality indices

I Similar to results found in prior work using smallerhost-level graph [Meusel et al., 2014]

I Note that out degree is meaningless as a centrality index

Out-degree In-degree PageRank Harmonic Centrality

photoshare.ru/.. youtube.com youtube.com wordpress.orgdvderotik.com/.. wordpress.org youtube.com/t/.. twitter.comzoover.be/.. youtube.com/t/.. youtube.com/testtube twitter.com/privacycran.r-project.org/.. youtube.com/.. youtube.com/t/.. twitter.com/aboutcran.rakanu.com/.. youtube.com/t/.. youtube.com/t/.. twitter.com/toslinkagogo.com/.. youtube.com/.. tumblr.com twitter.com/account/..cran.r-project.org/.. youtube.com/t/.. google.com/intl/en/.. twitter.com/account/..fussballdaten.de/.. gmpg.org/xfn/11 wordpress.org twitter.com/about/resourcesfussballdaten.de/.. google.com google.com/intl/.. twitter.com/loginfussballdaten.de/.. google.com/intl/.. google.com twitter.com/about/contact

27 / 30

Approximate K-core Decomposition of WC

I We estimate coreness upper bound of every vertex

I At least 75% of the vertices have coreness value less than32, only 0.5% have a coreness greater than 1024

0.25

0.50

0.75

1.00

1 2 8 2^5 2^10 2^15 2^20 2^25Approximate K−core

Cum

ulat

ive

Ver

tex

Fra

ctio

n

28 / 30

Possible Future ExtensionsBeat us if you can!

I Processing quadrillion-edge (petascale) graphs?

I 10× performance improvement (20 min to 2 min) by nextIPDPS? Direction optimization, asynchronouscommunication, graph compression, other partitioningstrategies

I Identify and implement additional analytics that fitpush/pull/fixed/variable communication patterns

I Open-source codeI Contact [email protected] for current code

29 / 30

Acknowledgments

I Sandia and FASTMATHI This research is supported by NSF grants CCF-1439057 and the

DOE Office of Science through the FASTMath SciDAC Institute.Sandia National Laboratories is a multi-program laboratorymanaged and operated by Sandia Corporation, a wholly ownedsubsidiary of Lockheed Martin Corporation, for the U.S.Department of Energys National Nuclear Security Administrationunder contract DE-AC04-94AL85000.

I Blue Waters FellowshipI This research is part of the Blue Waters sustained petascale

computing project, which is supported by the National ScienceFoundation (awards OCI-0725070, ACI-1238993, andACI-1444747) and the state of Illinois. Blue Waters is a joint effortof the University of Illinois at Urbana Champaign and its NationalCenter for Supercomputing Applications.

I Kamesh Madduri’s CAREER AwardI This research was also supported by NSF grant ACI-1253881.

30 / 30

Conclusions and Thanks!

I Graphs are ubiquitous, massive, and complex: scalabilityand efficiency are important considerations for analytics

I We identified two distinct communication patterns thatfit a large class of graph algorithms

I Implemented several algorithms fitting these patterns anddemonstrated scalability up to 65k cores of Blue Waters

I Analyzed the 2012 Web Data Commons hyperlink graph

I Demonstrated 26-1573× speedup vs. GraphX on 256cores of Compton with graphs less than 0.5% the size ofthe Web Crawl

Thank you! Questions? [email protected], www.gmslota.com

31 / 30

Bibliography I

M. Cha, H. Haddadi, F. Benevenuto, and K. P. Gummadi. Measuring user influence in Twitter: The millionfollower fallacy. In Proc. Int’l. Conf. on Weblogs and Social Media (ICWSM), 2010.

Deepayan Chakrabarti, Yiping Zhan, and Christos Faloutsos. R-MAT: A recursive model for graph mining. In Proc.Int’l. Conf. on Data Mining (SDM), 2004.

J. Leskovec, K. Lang, A. Dasgupta, and M. Mahoney. Community structure in large networks: Natural cluster sizesand the absence of large well-defined clusters. Internet Mathematics, 6(1):29–123, 2009.

Robert Meusel, Sebastiano Vigna, Oliver Lehmberg, and Christian Bizer. Graph structure in the web - revisited: Atrick of the heavy tail. In Proc. WWW, 2014.

Robert Meusel, Sebastiano Vigna, Oliver Lehmberg, and Christian Bizer. The graph structure in the web - analyzedon different aggregation levels. J. Web Sci., 1(1):33–47, 2015.

32 / 30