GraphBLAS explained
GraphBLAS is an API specification that defines standard building blocks for graph algorithms in the language of linear algebra.[1] [2] GraphBLAS is built upon the notion that a sparse matrix can be used to represent graphs as either an adjacency matrix or an incidence matrix. The GraphBLAS specification describes how graph operations (e.g. traversing and transforming graphs) can be efficiently implemented via linear algebraic methods (e.g. matrix multiplication) over different semirings.[3]
The development of GraphBLAS and its various implementations is an ongoing community effort, including representatives from industry, academia, and government research labs.[4] [5]
Background
Graph algorithms have long taken advantage of the idea that a graph can be represented as a matrix, and graph operations can be performed as linear transformations and other linear algebraic operations on sparse matrices.[6] For example, matrix-vector multiplication can be used to perform a step in a breadth-first search.
The GraphBLAS specification (and the various libraries that implement it) provides data structures and functions to compute these linear algebraic operations. In particular, GraphBLAS specifies sparse matrix objects which map well to graphs where vertices are likely connected to relatively few neighbors (i.e. the degree of a vertex is significantly smaller than the total number of vertices in the graph). The specification also allows for the use of different semirings to accomplish operations in a variety of mathematical contexts.
Originally motivated by the need for standardization in graph analytics, similar to its namesake BLAS,[7] the GraphBLAS standard has also begun to interest people outside the graph community, including researchers in machine learning,[8] and bioinformatics.[9] GraphBLAS implementations have also been used in high-performance graph database applications such as RedisGraph.[10] [11] [12] [13] [14]
Specification
The GraphBLAS specification has been in development since 2013,[15] and has reached version 2.1.0 as of December 2023.[16] While formally a specification for the C programming language, a variety of programming languages have been used to develop implementations in the spirit of GraphBLAS, including C++,[17] Java,[18] and Nvidia CUDA.[19]
Compliant implementations and language bindings
There are currently two fully-compliant reference implementations of the GraphBLAS specification.[20] [21] Bindings assuming a compliant specification exist for the Python,[22] MATLAB,[23] and Julia[24] [25] programming languages.
Linear algebraic foundations
The mathematical foundations of GraphBLAS are based in linear algebra and the duality between matrices and graphs.[26] [27]
Each graph operation in GraphBLAS operates on a semiring, which is made up of the following elements:
)
)
Note that the zero element (i.e. the element that represents the absence of an edge in the graph) can also be reinterpreted. For example, the following algebras can be implemented in GraphBLAS:
Algebra |
|
| Domain | Zero Element |
---|
Standard arithmetic |
|
|
| 0 |
|
|
|
|
|
|
|
|
|
|
Max–min algebra |
|
|
|| 0|-| Min–max algebra ||
||
||
| 0 |
| | |
| 0 | |
All the examples above satisfy the following two conditions in their respective domains:
For instance, a user can specify the min-plus algebra over the domain of double-precision floating point numbers with GrB_Semiring_new(&min_plus_semiring, GrB_MIN_FP64, GrB_PLUS_FP64)
.
Functionality
While the GraphBLAS specification generally allows significant flexibility in implementation, some functionality and implementation details are explicitly described:
- GraphBLAS objects, including matrices and vectors, are opaque data structures.
- Non-blocking execution mode, which permits lazy or asynchronous evaluation of certain operations.
- Masked assignment, denoted
, which assigns elements of matrix
to matrix
only in positions where the mask matrix
is non-zero.
The GraphBLAS specification also prescribes that library implementations be thread-safe.
Example code
The following is a GraphBLAS 2.1-compliant example of a breadth-first search in the C programming language.
- include
- include
- include
- include
- include "GraphBLAS.h"
/* * Given a boolean n x n adjacency matrix A and a source vertex s, performs a BFS traversal * of the graph and sets v[i] to the level in which vertex i is visited (v[s]
See also
External links
Notes and References
- Web site: GraphBLAS. graphblas.org. 2021-12-04.
- Web site: GraphBLAS: A Programming Specification for Graph Analysis. www.sei.cmu.edu. 2019-11-08.
- Web site: Pereira . Juliana . High-Performance Graph Algorithms Using Linear Algebra . Central European University, Department of Network and Data Science . 13 February 2020.
- Web site: People of ACM - Tim Davis . acm.org . Association for Computing Machinery . 8 November 2019.
- Web site: Mattson . Tim . Gabb . Henry . Graph Analytics: A Foundational Building Block for the Data Analytics World . Tech.Decoded . Intel . 14 February 2020.
- Book: Kepner . Jeremy . Gilbert . John . Graph Algorithms in the Language of Linear Algebra . 2011 . Society for Industrial and Applied Mathematics . Philadelphia, PA, USA . 9780898719901 . 8 November 2019.
- Web site: GraphBLAS: Building Blocks for High Performance Graph Analytics . crd.lbl.gov . Linda . Vu . 8 November 2019 . "In subsequent years, various research collaborations created a variety of BLAS libraries for different tasks. Realizing the benefits to users, vendors also worked with researchers to optimize these building blocks to run on their hardware. GraphBLAS is essentially a continuation of this BLAS heritage.".
- Book: 12–14 September 2017 . 10.1109/HPEC.2017.8091098 . Jeremy . Kepner . Manoj . Kumar . José . Moreira . Pratap . Pattnaik . Mauricio . Serrano . Henry . Tufo . 2017 IEEE High Performance Extreme Computing Conference (HPEC) . Enabling massive deep neural networks with the GraphBLAS . 1–10 . "In this paper we have shown that the key [deep neural network] computations can be represented in GraphBLAS, a library interface defined for sparse matrix algebra. Furthermore, we have shown that the key step of forward propagation, with ReLU as the nonlinearity, can be performed much more efficiently with GraphBLAS implementation as compared to BLAS implementation when the weight matrices are sparse.". 1708.02937 . 2017arXiv170802937K . 978-1-5386-3472-1 . 3632940 .
- News: Vu . Linda . A Game Changer: Metagenomic Clustering Powered by Supercomputers . 10 November 2019 . Lawrence Berkeley National Laboratory News Center . 12 March 2018.
- Web site: RedisGraph . Redis Labs . 11 November 2019.
- News: Anadiotis . George . Redis Labs goes Google Cloud, Graph, and other interesting places . 8 November 2019 . ZDNet . 24 October 2019.
- News: Redis Labs Introduces RedisGraph and Streams to Support a Zero Latency Future . 10 November 2019 . DevOps.com . 16 November 2018 . "Built on GraphBLAS, an open-source library that employs linear algebra including matrix multiplication, RedisGraph can complete calculations up to 600 times faster than any alternate graph solution according to benchmark results.".
- News: Woodie . Alex . Redis Speeds Towards a Multi-Model Future . 10 November 2019 . Datanami . 28 September 2018 . "One of the newest modules to emerge from Redis Labs turns the key value store into a graph database. The module, called RedisGraph, will be based on the GraphBLAS technology that emerged out of academia and industry.".
- News: Dsouza . Melisha . RedisGraph v1.0 released, benchmarking proves its 6-600 times faster than existing graph databases . 10 November 2019 . Packt . 20 November 2018 . "RedisGraph is a Redis module that adds a graph database functionality to Redis. RedisGraph delivers a fast and efficient way to store, manage and process graphs, around 6 to 600 times faster than existing graph databases. RedisGraph represents connected data as adjacency matrices and employs the power of GraphBLAS which is a highly optimized library for sparse matrix operations.".
- Book: 2013 IEEE High Performance Extreme Computing . 10–12 September 2013 . 10.1109/HPEC.2013.6670338 . Tim . Mattson . David . Bader . Jon . Berry . Aydin . Buluç . Jack . Dongarra . Christos . Faloutsos . John . Feo . John . Gilbert . Joseph . Gonzalez . Bruce . Hendrickson . Jeremy . Kepner . Charles . Leiserson . Andrew . Lumsdaine . David . Padua . Stephen . Poole . Steve . Reinhardt . Mike . Stonebraker . Steve . Wallach . Andrew . Yoo . 2013 IEEE High Performance Extreme Computing Conference (HPEC) . Standards for graph algorithm primitives . 1–2 . "It is our view that the state of the art in constructing a large collection of graph algorithms in terms of linear algebraic operations is mature enough to support the emergence of a standard set of primitive building blocks. This paper is a position paper defining the problem and announcing our intention to launch an open effort to define this standard.". 1408.0393 . 978-1-4799-1365-7 . 12099965 .
- Web site: The GraphBLAS C API Specification: Version 2.1.0 . Benjamin . Brock . Aydın . Buluç . Raye . Kimmerer . Jim . Kitchen . Manoj . Kumar . Timothy . Mattson . Scott . McMillan . José . Moreira . Michel . Pelletier . Erik . Welch . 22 December 2023.
- Web site: GraphBLAS Template Library (GBTL) . GitHub.com . 8 November 2019.
- Web site: Graphulo: Graph Processing on Accumulo . graphulo.mit.edu . 8 November 2019.
- Web site: GraphBLAST . GitHub.com . 8 November 2019.
- Web site: Davis . Timothy . SuiteSparse:GraphBLAS . 11 November 2019 . "SuiteSparse:GraphBLAS is a full implementation of the GraphBLAS standard (graphblas.org), which defines a set of sparse matrix operations on an extended algebra of semirings using an almost unlimited variety of operators and types.".
- Web site: Moreira . Jose . Horn . Bill . ibmgraphblas . GitHub.com . 19 November 2019.
- Web site: Pelletier . Michel . GraphBLAS for Python . GitHub.com . 11 November 2019.
- Web site: Davis . Timothy . SuiteSparse:GraphBLAS . 11 November 2019 . "Now with OpenMP parallelism and a MATLAB interface".
- Web site: Mehndiratta . Abhinav . GraphBLAS Implementation . Google Summer of Code Archive . 11 November 2019.
- Web site: Mehndiratta . Abhinav . An introduction to GraphBLAS . 7 June 2019 . GSoC'19 Blog . 11 November 2019.
- Book: 13–15 September 2016 . 10.1109/HPEC.2016.7761646 . Jeremy . Kepner . Peter . Aaltonen . David . Bader . Aydın . Buluç . Franz . Franchetti . John . Gilbert . Dylan . Hutchison . Manoj . Kumar . Andrew . Lumsdaine . Henning . Meyerhenke . Scott . McMillan . José . Moreira . John D. . Owens . Carl . Yang . Marcin . Zalewski . Timothy . Mattson . 2016 IEEE High Performance Extreme Computing Conference (HPEC) . Mathematical foundations of the GraphBLAS . 1–9 . 1606.05790 . 2016arXiv160605790K . 978-1-5090-3525-0 . 3654505 .
- For additional mathematical background, see Book: Kepner . Jeremy . Jananthan . Hayden . Mathematics of Big Data: Spreadsheets, Databases, Matrices, and Graphs . 17 July 2018 . The MIT Press . 978-0262038393 . 81–168 . 10 November 2019.