ArrayFire Graph : Dynamic Graph Library for GPUs Kumar Aatish
ArrayFire ● Accelerating computation ● HPC consulting for 10 years ● Maintain open source ArrayFire Library Domains Industries Computer Vision ● ● Defense ● Machine Learning Oil and Gas ● Image Processing ● Finance ● Computer Graphics ● ● Media
Outline ● Static Graphs ● Dynamic Graphs ● AF Graph ○ Insertion Deletion ○ SSSP ○ ○ BFS ○ Out Of Core
What is a (Static) Graph? G = (V,E). Set of Vertices and Edges ● ● Edges = relationship between vertices ● Metadata Snapshot of relationships between entities 0 1 2 3
What is a (Static) Graph? CSR Data Structure 0 1 2 3 0 1 Offsets 0 2 6 8 2 3 Adjacency Lists 1 2 0 3 0 3 1 2
What is a Dynamic Graph? G = (V,E). Set of Vertices and Edges ● ● Edges = relationship between vertices ● Metadata Interactions/Relationships can change 4 0 1 ● Vertices ● Edge 5 2 3 Edge Weights ● etc. ● 6
What is a Dynamic Graph? CSR Data Structure Cannot handle insertions/removal 0 1 2 3 0 1 Offsets 0 2 6 8 2 3 Adjacency Lists 1 2 0 3 0 3 1 2
ArrayFire Graph GPU Optimized Dynamic Data Structure ● ○ Fast Insertions, Updates, Deletions ○ Tracks weights and temporal metadata Optimized for GPU cache locality ○ Minimize CPU Intervention ● ● Handles out of core graph operations ● Performant Graph Analytic Algorithms BFS ○ SSSP ○ ○ PageRank ○ and more soon
ArrayFire Graph Conceptually similar to CSR ● ● Algorithms therefore easily portable u v u v adjacency U adjacency U adjacency V adjacency V
ArrayFire Graph ● Memory manager to improve performance ● Requires user defined upper limit on vertex degree
ArrayFire Graph ● Vertices with greater degree than limit? ○ Create zero weight edge from V B to empty vertex V E Add edges to V E ○ User responsible for resolution ○ ○ Will be done automatically in future
Insertion ● Consolidate Edge Inputs ○ Remove duplicates Resolve weight/temporal metadata ○ SRC DST W T First T Last U V w 1 TF 1 TL 1 U V w 2 TF 2 TL 2 U V op(w 1 , w 2 ) min(TF 1 , TF 2 ) max(TL 1 , TL 2 )
Insertion ● Update ○ Metadata Adjacency Lists ○
Update—Adjacency List Add edges to active vertices ● Identify active vertices ● Expand adjacency list size ● Copy new edges
Benchmark—Update Adjacency List Graph Vertices (M) Edges(M) ldoor 0.952 45.5 soc-LiveJournal1 4.8 69 cage15 5.2 94 kron_g500-logn21 2 201 uk-2002 18.5 523 Benchmark graphs takes from [1] and [2]
Deletion
SSSP Benchmarked against nvGraph[3] ● GPU Static Library NVIDIA Tesla P100 16 GB ●
Benchmark—SSSP Graph Vertices(M) Edges(M) eu-2005 0.860 32 coPapersDBLP 0.540 30.5 in-2004 1.4 27.2 ldoor 0.950 45.5 road_central 14.0 33.8 road_usa 23.9 57.7
Benchmark—SSSP Graph Vertices(M) Edges(M) eu-2005 0.860 32 coPapersDBLP 0.540 30.5 in-2004 1.4 27.2 ldoor 0.950 45.5 road_central 14.0 33.8 road_usa 23.9 57.7
BFS Graph Vertices(M) Edges(M) ldoor 0.950 45.5 soc-LiveJournal1 4.8 69 cage15 5.2 94 kron_g500-logn21 2 201 uk-2002 18.5 523
Out of Core ● Insertion ● Graph Analytics Functions ● Maximum edge count on device ● Maintain adjacency list on host memory
Out of Core ● Identify active remote vertices ● Exchange Inactive local vertices ○ ○ Active remote vertices ● Work on current batch of local active vertices ● Repeat
Benchmark—Out of Core Benchmarked on road_central [1] (V : 14M, E : 33.8 M) ● ● Insertion and BFS ● Nvidia Tesla K40 12 GB, Host Memory : DDR3 1333 Mhz 8GB
Summary Great dynamic graph creation performance ● ● Highly performant graph algorithms ● Can benefit from advances in static graph algorithms Out of Core support ● Future Plans Multi-GPU implementation near completion ● Add support for multiple edge types ● ● Add user queries for filtering graph by time stamps, edge types, etc. ● Avoid temporal or static metadata when user does not require them
Contact Us ● We are exploring use cases for ArrayFire.com real-world applications Speaker : Interested in AFGraph for your ● Kumar Aatish application? (kumar@ArrayFire.com) Contact us to tailor it to your ● Sales : needs Scott Blakeslee (sales@ArrayFire.com)
References [1] D. A. Bader, H. Meyerhenke, P. Sanders, and D. Wagner, Eds., Graph Partitioning and Graph Clustering. 10th DIMACS Implementation Challenge Workshop , ser. Contemporary Mathematics, no. 588, 2013. [2] Stanford Network Analysis Package, 2012 (accessed April 2012). [Online]. Available: snap.stanford.edu/data/ [3] NVIDIA, “nvGraph,” 2016. developer.nvidia.com/nvgraph
Recommend
More recommend