SPbLA

SPbLA: The Library of GPGPU-powered Sparse Boolean Linear Algebra Operations - Published in JOSS (2022)

https://github.com/SparseLinearAlgebra/spbla

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

boolean-algebra cplusplus cuda graph-algorithms graphblas opencl python sparse-matrix suitesparse
Last synced: 6 months ago · JSON representation

Repository

Sparse Boolean linear algebra for Nvidia Cuda, OpenCL and CPU computations

Basic Info
Statistics
  • Stars: 15
  • Watchers: 11
  • Forks: 4
  • Open Issues: 1
  • Releases: 2
Topics
boolean-algebra cplusplus cuda graph-algorithms graphblas opencl python sparse-matrix suitesparse
Created about 5 years ago · Last pushed over 3 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

spbla

JB Research Ubuntu Pages License Package

spbla is a linear Boolean algebra library primitives and operations for work with sparse matrices written for CPU, Cuda and OpenCL platforms. The primary goal of the library is implementation, testing and profiling algorithms for solving formal-language-constrained problems, such as context-free and regular path queries with various semantics for graph databases. The library provides C-compatible API, written in the GraphBLAS style. The library is shipped with python package pyspbla - wrapper for spbla library C API. This package exports library features and primitives in high-level format with automated resources management and fancy syntax sugar.

Features summary

  • Python package for every-day tasks
  • C API for performance-critical computations
  • Cuda backend for computations
  • OpenCL backend for computations
  • Cpu (fallback) backend for computations
  • Matrix creation (empty, from data, with random data)
  • Matrix-matrix operations (multiplication, element-wise addition, kronecker product)
  • Matrix operations (equality, transpose, reduce to vector, extract sub-matrix)
  • Matrix data extraction (as lists, as list of pairs)
  • Matrix syntax sugar (pretty string printing, slicing, iterating through non-zero values)
  • IO (import/export matrix from/to .mtx file format)
  • GraphViz (export single matrix or set of matrices as a graph with custom color and label settings)
  • Debug (matrix string debug markers, logging)

Platforms

  • Linux based OS (tested on Ubuntu 20.04)

Installation

Get the latest package version from PyPI package index:

shell $ python3 -m pip install pyspbla

Simple example

Create sparse matrices, compute matrix-matrix product and print the result to the output:

```python import pyspbla as sp

a = sp.Matrix.empty(shape=(2, 3)) a[0, 0] = True a[1, 2] = True

b = sp.Matrix.empty(shape=(3, 4)) b[0, 1] = True b[0, 2] = True b[1, 3] = True b[2, 1] = True

print(a, b, a.mxm(b), sep="\n") ```

Performance

Sparse Boolean matrix-matrix multiplication evaluation results are listed bellow. Machine configuration: PC with Ubuntu 20.04, Intel Core i7-6700 3.40GHz CPU, DDR4 64Gb RAM, GeForce GTX 1070 GPU with 8Gb VRAM.

time mem

The matrix data is selected from the SuiteSparse Matrix Collection link.

| Matrix name | # Rows | Nnz M | Nnz/row | Max Nnz/row | Nnz M^2 | |:---------------------------|-----------:|----------:|--------:|------------:|------------:| | SNAP/amazon0312 | 400,727 | 3,200,440 | 7.9 | 10 | 14,390,544 | | LAW/amazon-2008 | 735,323 | 5,158,388 | 7.0 | 10 | 25,366,745 | | SNAP/web-Google | 916,428 | 5,105,039 | 5.5 | 456 | 29,710,164 | | SNAP/roadNet-PA | 1,090,920 | 3,083,796 | 2.8 | 9 | 7,238,920 | | SNAP/roadNet-TX | 1,393,383 | 3,843,320 | 2.7 | 12 | 8,903,897 | | SNAP/roadNet-CA | 1,971,281 | 5,533,214 | 2.8 | 12 | 12,908,450 | | DIMACS10/netherlands_osm | 2,216,688 | 4,882,476 | 2.2 | 7 | 8,755,758 |

Detailed comparison is available in the full paper text at link .

Directory structure

spbla ├── .github - GitHub Actions CI setup ├── docs - documents, text files and various helpful stuff ├── scripts - short utility programs ├── spbla - library core source code │ ├── include - library public C API │ ├── sources - source-code for implementation │ │ ├── core - library core and state management │ │ ├── io - logging and i/o stuff │ │ ├── utils - auxilary class shared among modules │ │ ├── backend - common interfaces │ │ ├── cuda - cuda backend │ │ ├── opencl - opencl backend │ │ └── sequential - fallback cpu backend │ ├── utils - testing utilities │ └── tests - gtest-based unit-tests collection ├── python - pyspbla related sources │ ├── pyspbla - spbla library wrapper for python (similar to pygraphblas) │ ├── tests - regression tests for python wrapper │ └── data - generate data for pyspbla regression tests ├── deps - project dependencies │ ├── clbool - OpenCL based matrix operations for dcsr, csr and coo matrices │ ├── cub - cuda utility, required for nsparse │ ├── gtest - google test framework for unit testing │ └── nsparse - SpGEMM implementation for csr matrices (with unified memory, configurable) └── CMakeLists.txt - library cmake config, add this as sub-directory to your project

Contributing

If you want to contribute to this project, follow our short and simple open-source contributors guide. Also have a look at code of conduct.

Contributors

Citation

ignorelang @online{spbla, author = {Orachyov, Egor and Karpenko, Maria and Alimov, Pavel and Grigorev, Semyon}, title = {spbla: sparse Boolean linear algebra for CPU, Cuda and OpenCL computations}, year = 2021, url = {https://github.com/JetBrains-Research/spbla}, note = {Version 1.0.0} }

License

This project is licensed under MIT License. License text can be found in the license file.

Acknowledgments

This is a research project of the Programming Languages and Tools Laboratory at JetBrains-Research. Laboratory website link.

Owner

  • Name: SparseLinearAlgebra
  • Login: SparseLinearAlgebra
  • Kind: organization

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 72
  • Total Committers: 3
  • Avg Commits per committer: 24.0
  • Development Distribution Score (DDS): 0.264
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
EgorOrachev e****5@g****m 53
Maria Karpenko m****b@m****u 17
Semyon r****y@g****m 2
Committer Domains (Top 20 + Academic)
mail.ru: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 9
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 2 months
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 1.09
  • Average comments per pull request: 0.11
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mlxd (8)
  • bencardoen (3)
Pull Request Authors
  • EgorOrachyov (4)
  • mkarpenkospb (4)
  • gsvgit (1)
Top Labels
Issue Labels
enhancement (2) help wanted (2) bug (1)
Pull Request Labels
opencl (3) bug (2) enhancement (2) python (1)