SlideShare a Scribd company logo
1 of 48
Download to read offline
GraphBLAS: A linear algebraic approach
for high-performance graph algorithms
Gรกbor Szรกrnyas
szarnyas@mit.bme.hu
WHAT MAKES GRAPH PROCESSING DIFFICULT?
the โ€œcurse of connectednessโ€
contemporary computer architectures are good at
processing linear and hierarchical data structures,
such as Lists, Stacks, or Trees
a massive amount of random data access is required,
CPU has frequent cache misses, and implementing
parallelism is difficult
B. Shao, Y. Li, H. Wang, H. Xia (Microsoft Research),
Trinity Graph Engine and its Applications,
IEEE Data Engineering Bulleting 2017
connectedness
computer
architectures
caching and
parallelization
Graph processing in linear algebra
ADJACENCY MATRIX
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 1 0 1 0 0 0
๏‚‚ 0 0 0 0 1 0 1
๏‚ƒ 0 0 0 0 0 1 0
๏‚„ 1 0 1 0 0 0 0
๏‚… 0 0 0 0 0 1 0
๏‚† 0 0 1 0 0 0 0
๏‚‡ 0 0 1 1 1 0 0
๐€ ๐‘–๐‘— = เต
1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ
0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ
๏‚„
๏‚†
๏‚…๏‚‡
๏‚ ๏‚‚
๏‚ƒ
ADJACENCY MATRIX
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡
๏‚ 0 1 0 1 0 0 0
๏‚‚ 0 0 0 0 1 0 1
๏‚ƒ 0 0 0 0 0 1 0
๏‚„ 1 0 1 0 0 0 0
๏‚… 0 0 0 0 0 1 0
๏‚† 0 0 1 0 0 0 0
๏‚’ 0 0 1 1 1 0 0
๐€ ๐‘–๐‘— = เต
1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ
0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ
๏‚†
๏‚…
๏‚ ๏‚‚
๏‚ƒ
๏‚ ๏‚’
source
target
Most cells are zero:
sparse matrix
ADJACENCY MATRIX
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1
๏‚ƒ 1
๏‚„ 1 1
๏‚… 1
๏‚† 1
๏‚’ 1 1 1
๐€ ๐‘–๐‘— = เต
1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ
0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ
๏‚†
๏‚…
๏‚ ๏‚‚
๏‚ƒ
๏‚ ๏‚’
source
target
Most cells are zero:
sparse matrix
GRAPH TRAVERSAL WITH MATRIX MULTIPLICATION
๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚’
๐ฏ 1
๐€
๏‚ 1 1
๏‚‚ 1 1
๏‚ƒ 1
๏‚„ 1 1
๏‚… 1
๏‚† 1
๏‚’ 1 1 1
one-hop: ๐ฏ๐€
1 1 1
๏‚ ๏‚‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚‡
๏‚ ๏‚๏‚’
๏‚‚
๏‚Ž
Use vector/matrix operations to express graph algorithms:
๐ฏ๐€ ๐‘˜
means ๐‘˜ hops in the graph
๏‚†
๏‚
GRAPH TRAVERSAL WITH MATRIX MULTIPLICATION
๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚’
๐ฏ 1
๐€
๏‚ 1 1
๏‚‚ 1 1
๏‚ƒ 1
๏‚„ 1 1
๏‚… 1
๏‚† 1
๏‚’ 1 1 1
one-hop: ๐ฏ๐€
1 1 1
๏‚ ๏‚‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚‡
๐€
๏‚ 1 1
๏‚‚ 1 1
๏‚Ž 1
๏‚ 1 1
๏‚ 1
๏‚† 1
๏‚‡ 1 1 1
1 1 2
๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚‘ ๏‚‡
two-hop: ๐ฏ๐€ ๐Ÿ
๏‚ ๏‚๏‚’
๏‚Œ ๏‚‚
๏‚Ž
Use vector/matrix operations to express graph algorithms:
๐ฏ๐€ ๐‘˜
means ๐‘˜ hops in the graph
BOOKS ON LINEAR ALGEBRA FOR GRAPH PROCESSING
๏‚ง 1974: Aho-Hopcroft-Ullman book
o The Design and Analysis of Computer Algorithms
๏‚ง 1990: Cormen-Leiserson-Rivest book
o Introduction to Algorithms
๏‚ง 2011: GALLA book (ed. Kepner and Gilbert)
o Graph Algorithms in the Language of Linear Algebra
A lot of literature but few practical implementations
and particularly few easy-to-use libraries.
THE GRAPHBLAS STANDARD
BLAS GraphBLAS
Hardware architecture Hardware architecture
Numerical applications Graph analytical apps
LAGraphLINPACK/LAPACK
Separation of concernsSeparation of concerns
Goal: separate the concerns of the hardware/library/application designers.
๏‚ง 1979: BLAS Basic Linear Algebra Subprograms (dense)
๏‚ง 2001: Sparse BLAS an extension to BLAS (insufficient for graphs, little uptake)
๏‚ง 2013: GraphBLAS standard building blocks for graph algorithms in LA
Semiring-based graph computations
MATRIX MULTIPLICATION
Definition:
๐‚ = ๐€๐
๐‚ ๐‘–, ๐‘— = ฮฃ
๐‘˜
๐€ ๐‘–, ๐‘˜ โ‹… ๐ ๐‘˜, ๐‘—
Example:
๐‚ 2,3 = ๐€ 2,1 โ‹… ๐ 1,3 +
๐€ 2,2 โ‹… ๐ 2,3
= 2 โ‹… 5 + 3 โ‹… 4 = 22
22
๐€
2 3
๐
5
4
๐‚ = ๐€ โ‹… ๐
10 + 12 = 22
3 ยท 4 = 12
2 ยท 5 = 10
MATRIX MULTIPLICATION ON SEMIRINGS
๏‚ง Using the conventional semiring
๐‚ = ๐€๐
๐‚ ๐‘–, ๐‘— = ฮฃ
๐‘˜
๐€ ๐‘–, ๐‘˜ โ‹… ๐ ๐‘˜, ๐‘—
๏‚ง Use arbitrary semirings that override the โจ addition and
โจ‚ multiplication operators. Generalized formula (simplified)
๐‚ = ๐€ โจ.โจ‚ ๐
๐‚ ๐‘–, ๐‘— = โŠ•
๐‘˜
๐€ ๐‘–, ๐‘˜ โจ‚๐ ๐‘˜, ๐‘—
GRAPHBLAS SEMIRINGS
The ๐ท,โŠ•,โŠ—, 0 algebraic structure is a GraphBLAS semiring if
๏‚ง ๐ท,โŠ•, 0 is a commutative monoid over domain ๐ท with an
addition operator โŠ• and identity 0, where โˆ€๐‘Ž, ๐‘, ๐‘ โˆˆ ๐ท:
o Commutative ๐‘Ž โŠ• ๐‘ = ๐‘ โŠ• ๐‘Ž
o Associative ๐‘Ž โŠ• ๐‘ โŠ• ๐‘ = ๐‘Ž โŠ• ๐‘ โŠ• ๐‘
o Identity ๐‘Ž โŠ• 0 = ๐‘Ž
๏‚ง The multiplication operator is a closed binary operator
โŠ—: ๐ท ร— ๐ท โ†’ ๐ท.
This is less strict than the standard mathematical definition which
requires that โŠ— is a monoid and distributes over โŠ•.
COMMON SEMIRINGS
semiring domain โจ โจ‚ 0
integer arithmetic ๐‘Ž โˆˆ โ„• + โ‹… 0
real arithmetic ๐‘Ž โˆˆ โ„ + โ‹… 0
lor-land ๐‘Ž โˆˆ F, T โ‹ โ‹€ F
Galois field ๐‘Ž โˆˆ 0,1 xor โ‹€ 0
power set ๐‘Ž โŠ‚ โ„ค โˆช โˆฉ โˆ…
Notation: ๐€ โŠ•.โŠ— ๐ is a matrix multiplication using addition โŠ• and
multiplication โŠ—, e.g. ๐€ โˆจ.โˆง ๐. The default is ๐€ + . โ‹… ๐
MATRIX MULTIPLICATION SEMANTICS
Semantics: number of paths
๏‚
๏‚‘
๏‚…๏‚‡
๏‚Œ ๏‚‚
๏‚Ž
semiring domain โจ โจ‚ 0
integer arithmetic ๐‘Ž โˆˆ โ„• + โ‹… 0
๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡
๐ฏ 0 0 0 1 0 1 0
๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1
๏‚ƒ 1
๏‚ 1 1
๏‚… 1
๏‚‘ 1
๏‚‡ 1 1 1
1 2
1ยท1=1
1+1=2
1ยท1=1
๐ฏ โŠ•.โŠ— ๐€
MATRIX MULTIPLICATION SEMANTICS
semiring domain โจ โจ‚ 0
lor-land ๐‘Ž โˆˆ F, T โˆจ โˆง F
๏‚
๏‚‘
๏‚…๏‚‡
๏‚Œ ๏‚‚
๏‚Ž
Semantics: reachability
๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡
๐ฏ F F F T F T F
๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ T T
๏‚‚ T T
๏‚ƒ T
๏‚ T T
๏‚… T
๏‚‘ T
๏‚‡ T T T
T T
TโˆงT=T
TโˆงT=T
TโˆจT=T ๐ฏ โˆจ.โˆง ๐€Identity element: F
MATRIX MULTIPLICATION SEMANTICS
semiring domain โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
Semantics: shortest path
.2
.4
.5
.6
๏‚
๏‚‘
๏‚…๏‚‡
๏‚Œ ๏‚‚
๏‚Ž .5
๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡
๐ฏ โˆž โˆž โˆž .5 โˆž .6 โˆž
๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1
๏‚ƒ 1
๏‚ .2 .4
๏‚… 1
๏‚‘ .5
๏‚‡ 1 1 1
.7 .9
min(0.9,1.1)=0.9 ๐ฏ min . + ๐€
0.5+0.4=0.9
0.6+0.5=1.1
Graph algorithms in GraphBLAS
Single-source shortest path
SSSP โ€“ SINGLE-SOURCE SHORTEST PATHS
๏‚ง Problem:
o From a given start node ๐‘ , find the shortest paths to every other
(reachable) node in the graph
๏‚ง Bellman-Ford algorithm:
o Relaxes all edges in each step
o Guaranteed to find the shortest paths using at most ๐‘› โˆ’ 1 steps
๏‚ง Observation:
o The relaxation step can be captured using a VM multiplication
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚„
๏‚†
๏‚…๏‚‡
๏‚Œ ๏‚‚
๏‚ƒ .5
๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 โˆž .8 โˆž โˆž โˆž
๏‚‚ โˆž 0 โˆž โˆž .1 โˆž .7
๏‚ƒ โˆž โˆž 0 โˆž โˆž .5 โˆž
๏‚„ .2 โˆž .4 0 โˆž โˆž โˆž
๏‚… โˆž โˆž โˆž โˆž 0 .1 โˆž
๏‚† โˆž โˆž .5 โˆž โˆž 0 โˆž
๏‚‡ โˆž โˆž .1 .5 .9 โˆž 0
.3
.8
.8
.7 .1
.5
.1
.1
.5
๐ min.+ ๐€
๐€ ๐‘–๐‘— = เตž
0 if ๐‘– = ๐‘—
๐‘ค ๐‘’๐‘–๐‘— if ๐‘’๐‘–๐‘— โˆˆ ๐ธ
โˆž if ๐‘’๐‘–๐‘— โˆ‰ ๐ธ
๐ = โˆž โˆž โ€ฆ โˆž
๐ ๐‘  = 0
We use the min-plus semiring with identity โˆž.
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚„
๏‚†
๏‚…๏‚‡
๏‚Œ ๏‚‚
๏‚ƒ .5
๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž
.3
.8
.8
.7 .1
.5
.1
.1
.5
๐ min.+ ๐€
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚
๏‚†
๏‚…๏‚‡
๏‚Œ ๏‚
๏‚ƒ .5
๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
0 .3 .8
.3
.8
.8
.7 .1
.5
.1
.1
.5
๐ min.+ ๐€
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚
๏‚†
๏‚๏‚’
๏‚Œ ๏‚
๏‚Ž .5
๏‚Œ ๏‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡
๐ 0 .3 โˆž .8 โˆž โˆž โˆž
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
0 .3 1.2 .8 .4 1
.3
.8
.8
.7 .1
.5
.1
.1
.5
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
๐ min.+ ๐€
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚
๏‚‘
๏‚๏‚’
๏‚Œ ๏‚
๏‚Ž .5
๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚’
๐ 0 .3 1.2 .8 .4 โˆž 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
0 .3 1.1.8 .4 .5 1
.3
.8
.8
.7 .1
.5
.1
.1
.5
๐ min.+ ๐€
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚
๏‚‘
๏‚๏‚’
๏‚Œ ๏‚
๏‚Ž
๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚‘ ๏‚’
๐ 0 .3 1.1.8 .4 .5 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
0 .3 1 .8 .4 .5 1
.5
.5
.3
.8
.8
.7 .1
.5
.1
.1
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
๐ min.+ ๐€
SSSP โ€“ ALGEBRAIC BELLMAN-FORD
.2
.4
๏‚
๏‚‘
๏‚๏‚’
๏‚Œ ๏‚
๏‚Ž
๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚‘ ๏‚’
๐ 0 .3 1 .8 .4 .5 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 0 .3 .8
๏‚‚ 0 .1 .7
๏‚ƒ 0 .5
๏‚„ .2 .4 0
๏‚… 0 .1
๏‚† .5 0
๏‚‡ .1 .5 .9 0
.5
.5
.3
.8
.8
.7 .1
.5
.1
.1
semiring set โจ โจ‚ 0
min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
0 .3 1 .8 .4 .5 1
๐ min.+ ๐€
SSSP โ€“ ALGEBRAIC BELLMAN-FORD ALGO.
Input: adjacency matrix ๐€, source node ๐‘ , #nodes ๐‘›
๐€ ๐‘–๐‘— = เตž
0 if ๐‘– = ๐‘—
๐‘ค ๐‘’๐‘–๐‘— if ๐‘’๐‘–๐‘— โˆˆ ๐ธ
โˆž if ๐‘’๐‘–๐‘— โˆ‰ ๐ธ
Output: distance vector ๐ โˆˆ โ„ โˆช โˆž ๐‘›
1. ๐ = โˆž โˆž โ€ฆ โˆž
2. ๐ ๐‘  = 0
3. for ๐‘˜ = 1 to ๐‘› โˆ’ 1 *terminate earlier if we reach a fixed point
4. ๐ = ๐ min.+ ๐€
Optimization: switch between ๐ min.+ ๐€ and ๐€โŠค min.+ ๐ (push/pull).
Graph algorithms in GraphBLAS
Node-wise triangle count
NODE-WISE TRIANGLE COUNT
Triangle โ€“ Def 1: a set of three mutually adjacent nodes.
Def 2: a three-length closed path.
Usages:
๏‚ง Global clustering coefficient
๏‚ง Local clustering coefficient
๏‚ง Finding communities
๐‘ฃ
๏‚„
๏‚†
๏‚…๏‚‡
๏‚ ๏‚‚
๏‚ƒ
2
8
4
6
6
2
2
GraphChallenge.org: Raising the Bar on Graph Analytic Performance, HPEC 2018
TC: NAรVE APPROACH
๏‚„
๏‚†
๏‚…๏‚‡
๏‚ ๏‚‚
๏‚ƒ
2
8
4
6
6
2
2
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
1 1
1 1 1 1
1 1 1
1 1 1 1 1
1 1 1
1 1 1
1 1 1 1
2 1 1 1 1 1 2
1 4 2 2 1 2 2
1 2 3 2 2 1 1
1 2 2 5 3 1 2
1 1 2 3 3 1
1 2 1 1 3 3
2 2 1 2 1 3 4
2 6 4 7 4 3 4
6 6 6 11 8 5 9
4 6 4 8 4 7 9
7 11 8 8 5 10 12
4 8 4 5 2 8 9
3 5 7 10 8 2 4
4 9 9 12 9 4 6
๐ญ๐ซ๐ข = diagโˆ’1 ๐€ โŠ•.โŠ— ๐€ โŠ•.โŠ— ๐€
2
6
4
8
2
2
6
๐ญ๐ซ๐ข
TC: OPTIMIZATION
Observation: Matrix ๐€ โŠ•.โŠ— ๐€ โŠ•.โŠ— ๐€ is no longer sparse.
Optimization: Use element-wise multiplication โŠ— to close
wedges into triangles:
๐“๐‘๐ˆ = ๐€ โŠ•.โŠ— ๐€ โŠ— ๐€
Then, perform a row-wise summation to get the number of
triangles in each row:
๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘—
TC: ELEMENT-WISE MULTIPLICATION
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
2 1 1 1 1 1 2
1 4 2 2 1 2 2
1 2 3 2 2 1 1
1 2 2 5 3 1 2
1 1 2 3 3 1
1 2 1 1 3 3
2 2 1 2 1 3 4
1 1
1 2 1 2
2 1 1
1 2 2 1 2
1 1
1 1
2 1 2 1
๐“๐‘๐ˆ = ๐€ โŠ•.โŠ— ๐€ โŠ— ๐€
๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘—
๐€ โŠ•.โŠ— ๐€ is still very dense.
2
6
4
8
2
2
6
๏‚„
๏‚†
๏‚…๏‚‡
๏‚ ๏‚‚
๏‚ƒ
2
8
4
6
6
2
2
๐ญ๐ซ๐ข
โŠ• ๐‘— โ‹ฏ
๐“๐‘๐ˆ
โŠ— ๐€
TC: ELEMENT-WISE MULTIPLICATION
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡
๏‚ 1 1
๏‚‚ 1 1 1 1
๏‚ƒ 1 1 1
๏‚„ 1 1 1 1 1
๏‚… 1 1 1
๏‚† 1 1 1
๏‚‡ 1 1 1 1
๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐€
๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘—
2
6
4
8
2
2
6
๏‚„
๏‚†
๏‚…๏‚‡
๏‚ ๏‚‚
๏‚ƒ
2
8
4
6
6
2
2
๐ญ๐ซ๐ข
โŠ• ๐‘— โ‹ฏ
1 1
1 2 1 2
2 1 1
1 2 2 1 2
1 1
1 1
2 1 2 1
Masking limits where the
operation is computed.
Here, we use ๐€ as a mask
for ๐€ โŠ•.โŠ— ๐€.
TC: ALGORITHM
Input: adjacency matrix ๐€
Output: vector ๐ญ๐ซ๐ข
Workspace: matrix ๐“๐‘๐ˆ
1. ๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐€ compute the triangle count matrix
2. ๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘— compute the triangle count vector
Optimization: use ๐‹, the lower triangular part of ๐€ to avoid duplicates.
๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐‹
Worst-case optimal joins: There are deep theoretical connections between masked matrix multiplication and
relational joins. It has been proven in 2013 that for the triangle query, binary joins always provide suboptimal
runtime, which gave rise to new research on the family of worst-case optimal multi-way joins algorithms.
Graph algorithms in GraphBLAS
Other algorithms
GRAPH ALGORITHMS IN GRAPHBLAS
problem category algorithm
canonical
complexity ฮ˜
LA-based
complexity ฮ˜
breadth-first search ๐‘š ๐‘š
single-source shortest paths
Dijkstra ๐‘š + ๐‘› log ๐‘› ๐‘›2
Bellman-Ford ๐‘š๐‘› ๐‘š๐‘›
all-pairs shortest paths Floyd-Warshall ๐‘›3 ๐‘›3
minimum spanning tree
Prim ๐‘š + ๐‘› log ๐‘› ๐‘›2
Borลฏvka ๐‘š log ๐‘› ๐‘š log ๐‘›
maximum flow Edmonds-Karp ๐‘š2 ๐‘› ๐‘š2 ๐‘›
maximal independent set
greedy ๐‘š + ๐‘› log ๐‘› ๐‘š๐‘› + ๐‘›2
Luby ๐‘š + ๐‘› log ๐‘› ๐‘š log ๐‘›
Based on the table in J. Kepner:
Analytic Theory of Power Law Graphs,
SIAM Workshop for HPC on Large Graphs, 2008
Notation: ๐‘› = ๐‘‰ , ๐‘š = |๐ธ|. The complexity cells contain asymptotic bounds.
Takeaway: The majority of common graph algorithms can be expressed efficiently in LA.
See also L. Dhulipala, G.E. Blelloch, J. Shun:
Theoretically Efficient Parallel Graph Algorithms
Can Be Fast and Scalable, SPAA 2018
API and implementations
GRAPHBLAS C API
๏‚ง โ€œA crucial piece of the GraphBLAS effort is to translate the
mathematical specification to an API that
o is faithful to the mathematics as much as possible, and
o enables efficient implementations on modern hardware.โ€
mxm(Matrix *C, Matrix M, BinaryOp accum, Semiring op, Matrix A, Matrix B, Descriptor desc)
๐‚ ยฌ๐Œ โŠ™= โŠ•.โŠ— ๐€โŠค
, ๐โŠค
A. Buluรง et al.: Design of the GraphBLAS C API, GABB@IPDPS 2017
SUITESPARSE:GRAPHBLAS
๏‚ง Authored by Prof. Tim Davis at Texas A&M University,
based on his SuiteSparse library (used in MATLAB).
๏‚ง Additional extension operations for efficiency.
๏‚ง Sophisticated load balancer for multi-threaded execution.
๏‚ง CPU-based, single machine implementation.
๏‚ง Powers the RedisGraph graph database.
T.A. Davis: Algorithm 1000: SuiteSparse:GraphBLAS:
graph algorithms in the language of sparse linear
algebra, ACM TOMS, 2019
T.A. Davis: SuiteSparse:GraphBLAS: graph
algorithms via sparse matrix operations
on semirings, Sparse Days 2017
R. Lipman, T.A. Davis: Graph Algebra โ€“ Graph operations
in the language of linear algebra, RedisConf 2018
R. Lipman: RedisGraph
internals, RedisConf 2019
PYTHON WRAPPERS
Two libraries, both offer:
๏‚ง Concise GraphBLAS operations
๏‚ง Wrapping SuiteSparse:GrB
๏‚ง Jupyter support
Difference: pygraphblas is more
Pythonic, grblas strives to stay
close to the C API.
michelp/pygraphblas
jim22k/grblas
Benchmark results
SUITESPARSE:GRAPHBLAS / LDBC GRAPHALYTICS
Twitter
50M nodes,
2B edges
Results from late 2019,
new version is even faster
graph500-26
33M nodes,
1.1B edges
d-8.8-zf
168M nodes,
413M edges
d-8.6-fb
6M nodes,
422M edges
Ubuntu Server, 512 GB RAM,
64 CPU cores, 128 threads
THE GAP BENCHMARK SUITE
S. Beamer, K. Asanovic, D. Patterson:
The GAP Benchmark Suite, arXiv, 2017
๏‚ง Part of the Berkeley Graph Algorithm Platform project
๏‚ง Algorithms:
o BFS, SSSP, PageRank, connected components
o betweenness centrality, triangle count
๏‚ง Very efficient baseline implementation in C++
๏‚ง Comparing executions of implementations that were
carefully optimized and fine-tuned by research groups
๏‚ง Ongoing benchmark effort, paper to be submitted in Q2
gap.cs.berkeley.edu/benchmark.html
Further reading and summary
RESOURCES
List of GraphBLAS-related books, papers, presentations, posters, and software
szarnyasg/graphblas-pointers
Library of GraphBLAS algorithms
GraphBLAS/LAGraph
Extended version of this talk: 200+ slides
๏‚ง Theoretical foundations
๏‚ง BFS variants, PageRank
๏‚ง clustering coefficient, ๐‘˜-truss and triangle count variants
๏‚ง Community detection using label propagation
๏‚ง Lubyโ€™s maximal independent set algorithm
๏‚ง computing connected components on an overlay graph
๏‚ง connections to relational algebra
SUMMARY
๏‚ง Linear algebra is a powerful abstraction
o Good expressive power
o Concise formulation of most graph algorithms
o Very good performance
o Still lots of ongoing research
๏‚ง Trade-offs:
o Learning curve (theory and GraphBLAS API)
o Some algorithms are difficult to formulate in linear algebra
o Only a few GraphBLAS implementations (yet)
๏‚ง Overall: a very promising programming model for graph
algorithms suited to the age of heterogeneous hardware
ACKNOWLEDGEMENTS
๏‚ง Tim Davis and Tim Mattson for helpful discussions,
members of GraphBLAS mailing list for their detailed
feedback.
๏‚ง The LDBC Graphalytics task force for creating the
benchmark and assisting in the measurements.
๏‚ง Masterโ€™s students at BME for developing GraphBLAS-based
algorithms: Bรกlint Hegyi, Mรกrton Elekes, Petra Vรกrhegyi,
Lehel Boรฉr

More Related Content

What's hot

Numerical differentiation integration
Numerical differentiation integrationNumerical differentiation integration
Numerical differentiation integrationTarun Gehlot
ย 
Question 5 Math 1
Question 5 Math 1Question 5 Math 1
Question 5 Math 1M.T.H Group
ย 
Question 4 Math 1
Question 4 Math 1Question 4 Math 1
Question 4 Math 1M.T.H Group
ย 
Hermite integrators and Riordan arrays
Hermite integrators and Riordan arraysHermite integrators and Riordan arrays
Hermite integrators and Riordan arraysKeigo Nitadori
ย 
Convergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-rootConvergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-rootKeigo Nitadori
ย 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal AlgorithmBhavik Vashi
ย 
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-ssusere0a682
ย 
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ่ฒดไน‹ ๅ…ซๆœจ
ย 
Common derivatives integrals
Common derivatives integralsCommon derivatives integrals
Common derivatives integralsolziich
ย 
Alegebra Powers Substitution
Alegebra Powers SubstitutionAlegebra Powers Substitution
Alegebra Powers SubstitutionPassy World
ย 
A block-step version of KS regularization
A block-step version of KS regularizationA block-step version of KS regularization
A block-step version of KS regularizationKeigo Nitadori
ย 
Exponentials integrals
Exponentials integralsExponentials integrals
Exponentials integralsTarun Gehlot
ย 
Ch 5 integration
Ch 5 integration  Ch 5 integration
Ch 5 integration samirlakhanistb
ย 
Newton's Backward Interpolation Formula with Example
Newton's Backward Interpolation Formula with ExampleNewton's Backward Interpolation Formula with Example
Newton's Backward Interpolation Formula with ExampleMuhammadUsmanIkram2
ย 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximationTarun Gehlot
ย 
Poisson distribution jen
Poisson distribution jenPoisson distribution jen
Poisson distribution jenjennilynbalbalosa
ย 
properties of exponents
properties of exponentsproperties of exponents
properties of exponentsOrlando Calderon
ย 

What's hot (20)

Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
ย 
Numerical differentiation integration
Numerical differentiation integrationNumerical differentiation integration
Numerical differentiation integration
ย 
Question 5 Math 1
Question 5 Math 1Question 5 Math 1
Question 5 Math 1
ย 
Question 4 Math 1
Question 4 Math 1Question 4 Math 1
Question 4 Math 1
ย 
Hermite integrators and Riordan arrays
Hermite integrators and Riordan arraysHermite integrators and Riordan arrays
Hermite integrators and Riordan arrays
ย 
Convergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-rootConvergence methods for approximated reciprocal and reciprocal-square-root
Convergence methods for approximated reciprocal and reciprocal-square-root
ย 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
ย 
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-
ใ‚ฒใƒผใƒ ็†่ซ–NEXT ๆœŸๅพ…ๅŠน็”จ็†่ซ–็ฌฌ6ๅ›ž -3ใคใฎๅ…ฌ็†ใจๆœŸๅพ…ๅŠน็”จๅฎš็†-
ย 
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ
็ทšๅฝขๅ›žๅธฐใƒขใƒ‡ใƒซ
ย 
Common derivatives integrals
Common derivatives integralsCommon derivatives integrals
Common derivatives integrals
ย 
่จˆ็ฎ—ๆๆ–™ๅญฆ
่จˆ็ฎ—ๆๆ–™ๅญฆ่จˆ็ฎ—ๆๆ–™ๅญฆ
่จˆ็ฎ—ๆๆ–™ๅญฆ
ย 
Alegebra Powers Substitution
Alegebra Powers SubstitutionAlegebra Powers Substitution
Alegebra Powers Substitution
ย 
A block-step version of KS regularization
A block-step version of KS regularizationA block-step version of KS regularization
A block-step version of KS regularization
ย 
Exponentials integrals
Exponentials integralsExponentials integrals
Exponentials integrals
ย 
Ch 5 integration
Ch 5 integration  Ch 5 integration
Ch 5 integration
ย 
Newton's Backward Interpolation Formula with Example
Newton's Backward Interpolation Formula with ExampleNewton's Backward Interpolation Formula with Example
Newton's Backward Interpolation Formula with Example
ย 
Solution 2 i ph o 38
Solution 2 i ph o 38Solution 2 i ph o 38
Solution 2 i ph o 38
ย 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
ย 
Poisson distribution jen
Poisson distribution jenPoisson distribution jen
Poisson distribution jen
ย 
properties of exponents
properties of exponentsproperties of exponents
properties of exponents
ย 

Similar to GraphBLAS: A linear algebraic approach for high-performance graph queries

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorchJun Young Park
ย 
"Incremental Lossless Graph Summarization", KDD 2020
"Incremental Lossless Graph Summarization", KDD 2020"Incremental Lossless Graph Summarization", KDD 2020
"Incremental Lossless Graph Summarization", KDD 2020์ง€ํ›ˆ ๊ณ 
ย 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network PropertiesMarcus Mรคrtens
ย 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programmingDamian T. Gordon
ย 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxAlokSingh205089
ย 
A Signal Processing Approach To Fair Surface Design
A Signal Processing Approach To Fair Surface DesignA Signal Processing Approach To Fair Surface Design
A Signal Processing Approach To Fair Surface DesignBasel Abu-sinni
ย 
Signal flow graph
Signal flow graphSignal flow graph
Signal flow graphjani parth
ย 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxssuser01e301
ย 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyJorgeVillamarin5
ย 
Matlab lecture 7 โ€“ regula falsi or false position method@taj
Matlab lecture 7 โ€“ regula falsi or false position method@tajMatlab lecture 7 โ€“ regula falsi or false position method@taj
Matlab lecture 7 โ€“ regula falsi or false position method@tajTajim Md. Niamat Ullah Akhund
ย 
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹sumisumith
ย 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Dimas Ruliandi
ย 
5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functions5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functionssmiller5
ย 
Generalized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationGeneralized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationIJERA Editor
ย 
Matlab1
Matlab1Matlab1
Matlab1guest8ba004
ย 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notesUmeshJagga1
ย 
Deep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationDeep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationYan Xu
ย 
Mathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingMathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingNikhil Chandra Sarkar
ย 

Similar to GraphBLAS: A linear algebraic approach for high-performance graph queries (20)

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
ย 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
ย 
"Incremental Lossless Graph Summarization", KDD 2020
"Incremental Lossless Graph Summarization", KDD 2020"Incremental Lossless Graph Summarization", KDD 2020
"Incremental Lossless Graph Summarization", KDD 2020
ย 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network Properties
ย 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
ย 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptx
ย 
A Signal Processing Approach To Fair Surface Design
A Signal Processing Approach To Fair Surface DesignA Signal Processing Approach To Fair Surface Design
A Signal Processing Approach To Fair Surface Design
ย 
Signal flow graph
Signal flow graphSignal flow graph
Signal flow graph
ย 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
ย 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
ย 
Matlab lecture 7 โ€“ regula falsi or false position method@taj
Matlab lecture 7 โ€“ regula falsi or false position method@tajMatlab lecture 7 โ€“ regula falsi or false position method@taj
Matlab lecture 7 โ€“ regula falsi or false position method@taj
ย 
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹
CVPR2016 Fitting Surface Models to Data ๆŠœ็ฒ‹
ย 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...
ย 
Romberg
RombergRomberg
Romberg
ย 
5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functions5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functions
ย 
Generalized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationGeneralized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral Transformation
ย 
Matlab1
Matlab1Matlab1
Matlab1
ย 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
ย 
Deep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationDeep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and Regularization
ย 
Mathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow ModellingMathematical Understanding in Traffic Flow Modelling
Mathematical Understanding in Traffic Flow Modelling
ย 

More from Gรกbor Szรกrnyas

What Makes Graph Queries Difficult?
What Makes Graph Queries Difficult?What Makes Graph Queries Difficult?
What Makes Graph Queries Difficult?Gรกbor Szรกrnyas
ย 
Mapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQLMapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQLGรกbor Szรกrnyas
ย 
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...Gรกbor Szรกrnyas
ย 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesGรกbor Szรกrnyas
ย 
Writing a Cypher Engine in Clojure
Writing a Cypher Engine in ClojureWriting a Cypher Engine in Clojure
Writing a Cypher Engine in ClojureGรกbor Szรกrnyas
ย 
Learning Timed Automata with Cypher
Learning Timed Automata with CypherLearning Timed Automata with Cypher
Learning Timed Automata with CypherGรกbor Szรกrnyas
ย 
Idล‘zรญtett automatatanulรกs Cypherrel
Idล‘zรญtett automatatanulรกs CypherrelIdล‘zรญtett automatatanulรกs Cypherrel
Idล‘zรญtett automatatanulรกs CypherrelGรกbor Szรกrnyas
ย 
Compiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark CatalystCompiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark CatalystGรกbor Szรกrnyas
ย 
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...Gรกbor Szรกrnyas
ย 
Sharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesSharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesGรกbor Szรกrnyas
ย 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsGรกbor Szรกrnyas
ย 
IncQuery-D: Distributed Incremental Graph Queries
IncQuery-D: Distributed Incremental Graph QueriesIncQuery-D: Distributed Incremental Graph Queries
IncQuery-D: Distributed Incremental Graph QueriesGรกbor Szรกrnyas
ย 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudGรกbor Szรกrnyas
ย 

More from Gรกbor Szรกrnyas (14)

What Makes Graph Queries Difficult?
What Makes Graph Queries Difficult?What Makes Graph Queries Difficult?
What Makes Graph Queries Difficult?
ย 
Mapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQLMapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQL
ย 
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
An early look at the LDBC Social Network Benchmark's Business Intelligence wo...
ย 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher Queries
ย 
Writing a Cypher Engine in Clojure
Writing a Cypher Engine in ClojureWriting a Cypher Engine in Clojure
Writing a Cypher Engine in Clojure
ย 
Learning Timed Automata with Cypher
Learning Timed Automata with CypherLearning Timed Automata with Cypher
Learning Timed Automata with Cypher
ย 
Idล‘zรญtett automatatanulรกs Cypherrel
Idล‘zรญtett automatatanulรกs CypherrelIdล‘zรญtett automatatanulรกs Cypherrel
Idล‘zรญtett automatatanulรกs Cypherrel
ย 
Parsing process
Parsing processParsing process
Parsing process
ย 
Compiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark CatalystCompiling openCypher graph queries with Spark Catalyst
Compiling openCypher graph queries with Spark Catalyst
ย 
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...
Towards the Characterization of Realistic Models: Evaluation of Multidiscipli...
ย 
Sharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph QueriesSharded Joins for Scalable Incremental Graph Queries
Sharded Joins for Scalable Incremental Graph Queries
ย 
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java ApplicationsTowards a Macrobenchmark Framework for Performance Analysis of Java Applications
Towards a Macrobenchmark Framework for Performance Analysis of Java Applications
ย 
IncQuery-D: Distributed Incremental Graph Queries
IncQuery-D: Distributed Incremental Graph QueriesIncQuery-D: Distributed Incremental Graph Queries
IncQuery-D: Distributed Incremental Graph Queries
ย 
IncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the CloudIncQuery-D: Incremental Queries in the Cloud
IncQuery-D: Incremental Queries in the Cloud
ย 

Recently uploaded

Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
ย 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
ย 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7Call Girls in Nagpur High Profile Call Girls
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
ย 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
ย 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
ย 

Recently uploaded (20)

Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
ย 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
ย 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
ย 

GraphBLAS: A linear algebraic approach for high-performance graph queries

  • 1. GraphBLAS: A linear algebraic approach for high-performance graph algorithms Gรกbor Szรกrnyas szarnyas@mit.bme.hu
  • 2. WHAT MAKES GRAPH PROCESSING DIFFICULT? the โ€œcurse of connectednessโ€ contemporary computer architectures are good at processing linear and hierarchical data structures, such as Lists, Stacks, or Trees a massive amount of random data access is required, CPU has frequent cache misses, and implementing parallelism is difficult B. Shao, Y. Li, H. Wang, H. Xia (Microsoft Research), Trinity Graph Engine and its Applications, IEEE Data Engineering Bulleting 2017 connectedness computer architectures caching and parallelization
  • 3. Graph processing in linear algebra
  • 4. ADJACENCY MATRIX ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 1 0 1 0 0 0 ๏‚‚ 0 0 0 0 1 0 1 ๏‚ƒ 0 0 0 0 0 1 0 ๏‚„ 1 0 1 0 0 0 0 ๏‚… 0 0 0 0 0 1 0 ๏‚† 0 0 1 0 0 0 0 ๏‚‡ 0 0 1 1 1 0 0 ๐€ ๐‘–๐‘— = เต 1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ 0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚ ๏‚‚ ๏‚ƒ
  • 5. ADJACENCY MATRIX ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 1 0 1 0 0 0 ๏‚‚ 0 0 0 0 1 0 1 ๏‚ƒ 0 0 0 0 0 1 0 ๏‚„ 1 0 1 0 0 0 0 ๏‚… 0 0 0 0 0 1 0 ๏‚† 0 0 1 0 0 0 0 ๏‚’ 0 0 1 1 1 0 0 ๐€ ๐‘–๐‘— = เต 1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ 0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ ๏‚† ๏‚… ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚’ source target Most cells are zero: sparse matrix
  • 6. ADJACENCY MATRIX ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚ƒ 1 ๏‚„ 1 1 ๏‚… 1 ๏‚† 1 ๏‚’ 1 1 1 ๐€ ๐‘–๐‘— = เต 1 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆˆ ๐ธ 0 if (๐‘ฃ๐‘–, ๐‘ฃ๐‘—) โˆ‰ ๐ธ ๏‚† ๏‚… ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚’ source target Most cells are zero: sparse matrix
  • 7. GRAPH TRAVERSAL WITH MATRIX MULTIPLICATION ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚’ ๐ฏ 1 ๐€ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚ƒ 1 ๏‚„ 1 1 ๏‚… 1 ๏‚† 1 ๏‚’ 1 1 1 one-hop: ๐ฏ๐€ 1 1 1 ๏‚ ๏‚‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚‡ ๏‚ ๏‚๏‚’ ๏‚‚ ๏‚Ž Use vector/matrix operations to express graph algorithms: ๐ฏ๐€ ๐‘˜ means ๐‘˜ hops in the graph ๏‚† ๏‚
  • 8. GRAPH TRAVERSAL WITH MATRIX MULTIPLICATION ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚’ ๐ฏ 1 ๐€ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚ƒ 1 ๏‚„ 1 1 ๏‚… 1 ๏‚† 1 ๏‚’ 1 1 1 one-hop: ๐ฏ๐€ 1 1 1 ๏‚ ๏‚‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚‡ ๐€ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚Ž 1 ๏‚ 1 1 ๏‚ 1 ๏‚† 1 ๏‚‡ 1 1 1 1 1 2 ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚‘ ๏‚‡ two-hop: ๐ฏ๐€ ๐Ÿ ๏‚ ๏‚๏‚’ ๏‚Œ ๏‚‚ ๏‚Ž Use vector/matrix operations to express graph algorithms: ๐ฏ๐€ ๐‘˜ means ๐‘˜ hops in the graph
  • 9. BOOKS ON LINEAR ALGEBRA FOR GRAPH PROCESSING ๏‚ง 1974: Aho-Hopcroft-Ullman book o The Design and Analysis of Computer Algorithms ๏‚ง 1990: Cormen-Leiserson-Rivest book o Introduction to Algorithms ๏‚ง 2011: GALLA book (ed. Kepner and Gilbert) o Graph Algorithms in the Language of Linear Algebra A lot of literature but few practical implementations and particularly few easy-to-use libraries.
  • 10. THE GRAPHBLAS STANDARD BLAS GraphBLAS Hardware architecture Hardware architecture Numerical applications Graph analytical apps LAGraphLINPACK/LAPACK Separation of concernsSeparation of concerns Goal: separate the concerns of the hardware/library/application designers. ๏‚ง 1979: BLAS Basic Linear Algebra Subprograms (dense) ๏‚ง 2001: Sparse BLAS an extension to BLAS (insufficient for graphs, little uptake) ๏‚ง 2013: GraphBLAS standard building blocks for graph algorithms in LA
  • 12. MATRIX MULTIPLICATION Definition: ๐‚ = ๐€๐ ๐‚ ๐‘–, ๐‘— = ฮฃ ๐‘˜ ๐€ ๐‘–, ๐‘˜ โ‹… ๐ ๐‘˜, ๐‘— Example: ๐‚ 2,3 = ๐€ 2,1 โ‹… ๐ 1,3 + ๐€ 2,2 โ‹… ๐ 2,3 = 2 โ‹… 5 + 3 โ‹… 4 = 22 22 ๐€ 2 3 ๐ 5 4 ๐‚ = ๐€ โ‹… ๐ 10 + 12 = 22 3 ยท 4 = 12 2 ยท 5 = 10
  • 13. MATRIX MULTIPLICATION ON SEMIRINGS ๏‚ง Using the conventional semiring ๐‚ = ๐€๐ ๐‚ ๐‘–, ๐‘— = ฮฃ ๐‘˜ ๐€ ๐‘–, ๐‘˜ โ‹… ๐ ๐‘˜, ๐‘— ๏‚ง Use arbitrary semirings that override the โจ addition and โจ‚ multiplication operators. Generalized formula (simplified) ๐‚ = ๐€ โจ.โจ‚ ๐ ๐‚ ๐‘–, ๐‘— = โŠ• ๐‘˜ ๐€ ๐‘–, ๐‘˜ โจ‚๐ ๐‘˜, ๐‘—
  • 14. GRAPHBLAS SEMIRINGS The ๐ท,โŠ•,โŠ—, 0 algebraic structure is a GraphBLAS semiring if ๏‚ง ๐ท,โŠ•, 0 is a commutative monoid over domain ๐ท with an addition operator โŠ• and identity 0, where โˆ€๐‘Ž, ๐‘, ๐‘ โˆˆ ๐ท: o Commutative ๐‘Ž โŠ• ๐‘ = ๐‘ โŠ• ๐‘Ž o Associative ๐‘Ž โŠ• ๐‘ โŠ• ๐‘ = ๐‘Ž โŠ• ๐‘ โŠ• ๐‘ o Identity ๐‘Ž โŠ• 0 = ๐‘Ž ๏‚ง The multiplication operator is a closed binary operator โŠ—: ๐ท ร— ๐ท โ†’ ๐ท. This is less strict than the standard mathematical definition which requires that โŠ— is a monoid and distributes over โŠ•.
  • 15. COMMON SEMIRINGS semiring domain โจ โจ‚ 0 integer arithmetic ๐‘Ž โˆˆ โ„• + โ‹… 0 real arithmetic ๐‘Ž โˆˆ โ„ + โ‹… 0 lor-land ๐‘Ž โˆˆ F, T โ‹ โ‹€ F Galois field ๐‘Ž โˆˆ 0,1 xor โ‹€ 0 power set ๐‘Ž โŠ‚ โ„ค โˆช โˆฉ โˆ… Notation: ๐€ โŠ•.โŠ— ๐ is a matrix multiplication using addition โŠ• and multiplication โŠ—, e.g. ๐€ โˆจ.โˆง ๐. The default is ๐€ + . โ‹… ๐
  • 16. MATRIX MULTIPLICATION SEMANTICS Semantics: number of paths ๏‚ ๏‚‘ ๏‚…๏‚‡ ๏‚Œ ๏‚‚ ๏‚Ž semiring domain โจ โจ‚ 0 integer arithmetic ๐‘Ž โˆˆ โ„• + โ‹… 0 ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡ ๐ฏ 0 0 0 1 0 1 0 ๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚ƒ 1 ๏‚ 1 1 ๏‚… 1 ๏‚‘ 1 ๏‚‡ 1 1 1 1 2 1ยท1=1 1+1=2 1ยท1=1 ๐ฏ โŠ•.โŠ— ๐€
  • 17. MATRIX MULTIPLICATION SEMANTICS semiring domain โจ โจ‚ 0 lor-land ๐‘Ž โˆˆ F, T โˆจ โˆง F ๏‚ ๏‚‘ ๏‚…๏‚‡ ๏‚Œ ๏‚‚ ๏‚Ž Semantics: reachability ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡ ๐ฏ F F F T F T F ๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ T T ๏‚‚ T T ๏‚ƒ T ๏‚ T T ๏‚… T ๏‚‘ T ๏‚‡ T T T T T TโˆงT=T TโˆงT=T TโˆจT=T ๐ฏ โˆจ.โˆง ๐€Identity element: F
  • 18. MATRIX MULTIPLICATION SEMANTICS semiring domain โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž Semantics: shortest path .2 .4 .5 .6 ๏‚ ๏‚‘ ๏‚…๏‚‡ ๏‚Œ ๏‚‚ ๏‚Ž .5 ๏‚ ๏‚‚ ๏‚ƒ ๏‚ ๏‚… ๏‚‘ ๏‚‡ ๐ฏ โˆž โˆž โˆž .5 โˆž .6 โˆž ๐€ ๏‚Œ ๏‚‚ ๏‚Ž ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 ๏‚ƒ 1 ๏‚ .2 .4 ๏‚… 1 ๏‚‘ .5 ๏‚‡ 1 1 1 .7 .9 min(0.9,1.1)=0.9 ๐ฏ min . + ๐€ 0.5+0.4=0.9 0.6+0.5=1.1
  • 19. Graph algorithms in GraphBLAS Single-source shortest path
  • 20. SSSP โ€“ SINGLE-SOURCE SHORTEST PATHS ๏‚ง Problem: o From a given start node ๐‘ , find the shortest paths to every other (reachable) node in the graph ๏‚ง Bellman-Ford algorithm: o Relaxes all edges in each step o Guaranteed to find the shortest paths using at most ๐‘› โˆ’ 1 steps ๏‚ง Observation: o The relaxation step can be captured using a VM multiplication
  • 21. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚Œ ๏‚‚ ๏‚ƒ .5 ๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 โˆž .8 โˆž โˆž โˆž ๏‚‚ โˆž 0 โˆž โˆž .1 โˆž .7 ๏‚ƒ โˆž โˆž 0 โˆž โˆž .5 โˆž ๏‚„ .2 โˆž .4 0 โˆž โˆž โˆž ๏‚… โˆž โˆž โˆž โˆž 0 .1 โˆž ๏‚† โˆž โˆž .5 โˆž โˆž 0 โˆž ๏‚‡ โˆž โˆž .1 .5 .9 โˆž 0 .3 .8 .8 .7 .1 .5 .1 .1 .5 ๐ min.+ ๐€ ๐€ ๐‘–๐‘— = เตž 0 if ๐‘– = ๐‘— ๐‘ค ๐‘’๐‘–๐‘— if ๐‘’๐‘–๐‘— โˆˆ ๐ธ โˆž if ๐‘’๐‘–๐‘— โˆ‰ ๐ธ ๐ = โˆž โˆž โ€ฆ โˆž ๐ ๐‘  = 0 We use the min-plus semiring with identity โˆž.
  • 22. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚Œ ๏‚‚ ๏‚ƒ .5 ๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž .3 .8 .8 .7 .1 .5 .1 .1 .5 ๐ min.+ ๐€ semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0
  • 23. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚ ๏‚† ๏‚…๏‚‡ ๏‚Œ ๏‚ ๏‚ƒ .5 ๏‚Œ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๐ 0 โˆž โˆž โˆž โˆž โˆž โˆž ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0 0 .3 .8 .3 .8 .8 .7 .1 .5 .1 .1 .5 ๐ min.+ ๐€ semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
  • 24. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚ ๏‚† ๏‚๏‚’ ๏‚Œ ๏‚ ๏‚Ž .5 ๏‚Œ ๏‚ ๏‚ƒ ๏‚ ๏‚… ๏‚† ๏‚‡ ๐ 0 .3 โˆž .8 โˆž โˆž โˆž ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0 0 .3 1.2 .8 .4 1 .3 .8 .8 .7 .1 .5 .1 .1 .5 semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž ๐ min.+ ๐€
  • 25. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚ ๏‚‘ ๏‚๏‚’ ๏‚Œ ๏‚ ๏‚Ž .5 ๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚† ๏‚’ ๐ 0 .3 1.2 .8 .4 โˆž 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0 0 .3 1.1.8 .4 .5 1 .3 .8 .8 .7 .1 .5 .1 .1 .5 ๐ min.+ ๐€ semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž
  • 26. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚ ๏‚‘ ๏‚๏‚’ ๏‚Œ ๏‚ ๏‚Ž ๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚‘ ๏‚’ ๐ 0 .3 1.1.8 .4 .5 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0 0 .3 1 .8 .4 .5 1 .5 .5 .3 .8 .8 .7 .1 .5 .1 .1 semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž ๐ min.+ ๐€
  • 27. SSSP โ€“ ALGEBRAIC BELLMAN-FORD .2 .4 ๏‚ ๏‚‘ ๏‚๏‚’ ๏‚Œ ๏‚ ๏‚Ž ๏‚Œ ๏‚ ๏‚Ž ๏‚ ๏‚ ๏‚‘ ๏‚’ ๐ 0 .3 1 .8 .4 .5 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 0 .3 .8 ๏‚‚ 0 .1 .7 ๏‚ƒ 0 .5 ๏‚„ .2 .4 0 ๏‚… 0 .1 ๏‚† .5 0 ๏‚‡ .1 .5 .9 0 .5 .5 .3 .8 .8 .7 .1 .5 .1 .1 semiring set โจ โจ‚ 0 min-plus ๐‘Ž โˆˆ โ„ โˆช โˆž min + โˆž 0 .3 1 .8 .4 .5 1 ๐ min.+ ๐€
  • 28. SSSP โ€“ ALGEBRAIC BELLMAN-FORD ALGO. Input: adjacency matrix ๐€, source node ๐‘ , #nodes ๐‘› ๐€ ๐‘–๐‘— = เตž 0 if ๐‘– = ๐‘— ๐‘ค ๐‘’๐‘–๐‘— if ๐‘’๐‘–๐‘— โˆˆ ๐ธ โˆž if ๐‘’๐‘–๐‘— โˆ‰ ๐ธ Output: distance vector ๐ โˆˆ โ„ โˆช โˆž ๐‘› 1. ๐ = โˆž โˆž โ€ฆ โˆž 2. ๐ ๐‘  = 0 3. for ๐‘˜ = 1 to ๐‘› โˆ’ 1 *terminate earlier if we reach a fixed point 4. ๐ = ๐ min.+ ๐€ Optimization: switch between ๐ min.+ ๐€ and ๐€โŠค min.+ ๐ (push/pull).
  • 29. Graph algorithms in GraphBLAS Node-wise triangle count
  • 30. NODE-WISE TRIANGLE COUNT Triangle โ€“ Def 1: a set of three mutually adjacent nodes. Def 2: a three-length closed path. Usages: ๏‚ง Global clustering coefficient ๏‚ง Local clustering coefficient ๏‚ง Finding communities ๐‘ฃ ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚ ๏‚‚ ๏‚ƒ 2 8 4 6 6 2 2 GraphChallenge.org: Raising the Bar on Graph Analytic Performance, HPEC 2018
  • 31. TC: NAรVE APPROACH ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚ ๏‚‚ ๏‚ƒ 2 8 4 6 6 2 2 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 4 2 2 1 2 2 1 2 3 2 2 1 1 1 2 2 5 3 1 2 1 1 2 3 3 1 1 2 1 1 3 3 2 2 1 2 1 3 4 2 6 4 7 4 3 4 6 6 6 11 8 5 9 4 6 4 8 4 7 9 7 11 8 8 5 10 12 4 8 4 5 2 8 9 3 5 7 10 8 2 4 4 9 9 12 9 4 6 ๐ญ๐ซ๐ข = diagโˆ’1 ๐€ โŠ•.โŠ— ๐€ โŠ•.โŠ— ๐€ 2 6 4 8 2 2 6 ๐ญ๐ซ๐ข
  • 32. TC: OPTIMIZATION Observation: Matrix ๐€ โŠ•.โŠ— ๐€ โŠ•.โŠ— ๐€ is no longer sparse. Optimization: Use element-wise multiplication โŠ— to close wedges into triangles: ๐“๐‘๐ˆ = ๐€ โŠ•.โŠ— ๐€ โŠ— ๐€ Then, perform a row-wise summation to get the number of triangles in each row: ๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘—
  • 33. TC: ELEMENT-WISE MULTIPLICATION ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 2 1 1 1 1 1 2 1 4 2 2 1 2 2 1 2 3 2 2 1 1 1 2 2 5 3 1 2 1 1 2 3 3 1 1 2 1 1 3 3 2 2 1 2 1 3 4 1 1 1 2 1 2 2 1 1 1 2 2 1 2 1 1 1 1 2 1 2 1 ๐“๐‘๐ˆ = ๐€ โŠ•.โŠ— ๐€ โŠ— ๐€ ๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘— ๐€ โŠ•.โŠ— ๐€ is still very dense. 2 6 4 8 2 2 6 ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚ ๏‚‚ ๏‚ƒ 2 8 4 6 6 2 2 ๐ญ๐ซ๐ข โŠ• ๐‘— โ‹ฏ ๐“๐‘๐ˆ โŠ— ๐€
  • 34. TC: ELEMENT-WISE MULTIPLICATION ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 ๐€ ๏‚ ๏‚‚ ๏‚ƒ ๏‚„ ๏‚… ๏‚† ๏‚‡ ๏‚ 1 1 ๏‚‚ 1 1 1 1 ๏‚ƒ 1 1 1 ๏‚„ 1 1 1 1 1 ๏‚… 1 1 1 ๏‚† 1 1 1 ๏‚‡ 1 1 1 1 ๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐€ ๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘— 2 6 4 8 2 2 6 ๏‚„ ๏‚† ๏‚…๏‚‡ ๏‚ ๏‚‚ ๏‚ƒ 2 8 4 6 6 2 2 ๐ญ๐ซ๐ข โŠ• ๐‘— โ‹ฏ 1 1 1 2 1 2 2 1 1 1 2 2 1 2 1 1 1 1 2 1 2 1 Masking limits where the operation is computed. Here, we use ๐€ as a mask for ๐€ โŠ•.โŠ— ๐€.
  • 35. TC: ALGORITHM Input: adjacency matrix ๐€ Output: vector ๐ญ๐ซ๐ข Workspace: matrix ๐“๐‘๐ˆ 1. ๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐€ compute the triangle count matrix 2. ๐ญ๐ซ๐ข = โŠ• ๐‘— ๐“๐‘๐ˆ : , ๐‘— compute the triangle count vector Optimization: use ๐‹, the lower triangular part of ๐€ to avoid duplicates. ๐“๐‘๐ˆ ๐€ = ๐€ โŠ•.โŠ— ๐‹ Worst-case optimal joins: There are deep theoretical connections between masked matrix multiplication and relational joins. It has been proven in 2013 that for the triangle query, binary joins always provide suboptimal runtime, which gave rise to new research on the family of worst-case optimal multi-way joins algorithms.
  • 36. Graph algorithms in GraphBLAS Other algorithms
  • 37. GRAPH ALGORITHMS IN GRAPHBLAS problem category algorithm canonical complexity ฮ˜ LA-based complexity ฮ˜ breadth-first search ๐‘š ๐‘š single-source shortest paths Dijkstra ๐‘š + ๐‘› log ๐‘› ๐‘›2 Bellman-Ford ๐‘š๐‘› ๐‘š๐‘› all-pairs shortest paths Floyd-Warshall ๐‘›3 ๐‘›3 minimum spanning tree Prim ๐‘š + ๐‘› log ๐‘› ๐‘›2 Borลฏvka ๐‘š log ๐‘› ๐‘š log ๐‘› maximum flow Edmonds-Karp ๐‘š2 ๐‘› ๐‘š2 ๐‘› maximal independent set greedy ๐‘š + ๐‘› log ๐‘› ๐‘š๐‘› + ๐‘›2 Luby ๐‘š + ๐‘› log ๐‘› ๐‘š log ๐‘› Based on the table in J. Kepner: Analytic Theory of Power Law Graphs, SIAM Workshop for HPC on Large Graphs, 2008 Notation: ๐‘› = ๐‘‰ , ๐‘š = |๐ธ|. The complexity cells contain asymptotic bounds. Takeaway: The majority of common graph algorithms can be expressed efficiently in LA. See also L. Dhulipala, G.E. Blelloch, J. Shun: Theoretically Efficient Parallel Graph Algorithms Can Be Fast and Scalable, SPAA 2018
  • 39. GRAPHBLAS C API ๏‚ง โ€œA crucial piece of the GraphBLAS effort is to translate the mathematical specification to an API that o is faithful to the mathematics as much as possible, and o enables efficient implementations on modern hardware.โ€ mxm(Matrix *C, Matrix M, BinaryOp accum, Semiring op, Matrix A, Matrix B, Descriptor desc) ๐‚ ยฌ๐Œ โŠ™= โŠ•.โŠ— ๐€โŠค , ๐โŠค A. Buluรง et al.: Design of the GraphBLAS C API, GABB@IPDPS 2017
  • 40. SUITESPARSE:GRAPHBLAS ๏‚ง Authored by Prof. Tim Davis at Texas A&M University, based on his SuiteSparse library (used in MATLAB). ๏‚ง Additional extension operations for efficiency. ๏‚ง Sophisticated load balancer for multi-threaded execution. ๏‚ง CPU-based, single machine implementation. ๏‚ง Powers the RedisGraph graph database. T.A. Davis: Algorithm 1000: SuiteSparse:GraphBLAS: graph algorithms in the language of sparse linear algebra, ACM TOMS, 2019 T.A. Davis: SuiteSparse:GraphBLAS: graph algorithms via sparse matrix operations on semirings, Sparse Days 2017 R. Lipman, T.A. Davis: Graph Algebra โ€“ Graph operations in the language of linear algebra, RedisConf 2018 R. Lipman: RedisGraph internals, RedisConf 2019
  • 41. PYTHON WRAPPERS Two libraries, both offer: ๏‚ง Concise GraphBLAS operations ๏‚ง Wrapping SuiteSparse:GrB ๏‚ง Jupyter support Difference: pygraphblas is more Pythonic, grblas strives to stay close to the C API. michelp/pygraphblas jim22k/grblas
  • 43. SUITESPARSE:GRAPHBLAS / LDBC GRAPHALYTICS Twitter 50M nodes, 2B edges Results from late 2019, new version is even faster graph500-26 33M nodes, 1.1B edges d-8.8-zf 168M nodes, 413M edges d-8.6-fb 6M nodes, 422M edges Ubuntu Server, 512 GB RAM, 64 CPU cores, 128 threads
  • 44. THE GAP BENCHMARK SUITE S. Beamer, K. Asanovic, D. Patterson: The GAP Benchmark Suite, arXiv, 2017 ๏‚ง Part of the Berkeley Graph Algorithm Platform project ๏‚ง Algorithms: o BFS, SSSP, PageRank, connected components o betweenness centrality, triangle count ๏‚ง Very efficient baseline implementation in C++ ๏‚ง Comparing executions of implementations that were carefully optimized and fine-tuned by research groups ๏‚ง Ongoing benchmark effort, paper to be submitted in Q2 gap.cs.berkeley.edu/benchmark.html
  • 46. RESOURCES List of GraphBLAS-related books, papers, presentations, posters, and software szarnyasg/graphblas-pointers Library of GraphBLAS algorithms GraphBLAS/LAGraph Extended version of this talk: 200+ slides ๏‚ง Theoretical foundations ๏‚ง BFS variants, PageRank ๏‚ง clustering coefficient, ๐‘˜-truss and triangle count variants ๏‚ง Community detection using label propagation ๏‚ง Lubyโ€™s maximal independent set algorithm ๏‚ง computing connected components on an overlay graph ๏‚ง connections to relational algebra
  • 47. SUMMARY ๏‚ง Linear algebra is a powerful abstraction o Good expressive power o Concise formulation of most graph algorithms o Very good performance o Still lots of ongoing research ๏‚ง Trade-offs: o Learning curve (theory and GraphBLAS API) o Some algorithms are difficult to formulate in linear algebra o Only a few GraphBLAS implementations (yet) ๏‚ง Overall: a very promising programming model for graph algorithms suited to the age of heterogeneous hardware
  • 48. ACKNOWLEDGEMENTS ๏‚ง Tim Davis and Tim Mattson for helpful discussions, members of GraphBLAS mailing list for their detailed feedback. ๏‚ง The LDBC Graphalytics task force for creating the benchmark and assisting in the measurements. ๏‚ง Masterโ€™s students at BME for developing GraphBLAS-based algorithms: Bรกlint Hegyi, Mรกrton Elekes, Petra Vรกrhegyi, Lehel Boรฉr