{"id":26447336,"url":"https://github.com/SparseLinearAlgebra/spla","last_synced_at":"2025-03-18T13:51:49.639Z","repository":{"id":43595540,"uuid":"404781461","full_name":"SparseLinearAlgebra/spla","owner":"SparseLinearAlgebra","description":"An open-source generalized sparse linear algebra library with vendor-agnostic GPUs accelerated computations ","archived":false,"fork":false,"pushed_at":"2025-02-14T08:07:05.000Z","size":968040,"stargazers_count":26,"open_issues_count":9,"forks_count":6,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-14T06:11:12.525Z","etag":null,"topics":["cplusplus","cpp","gpgpu","gpu-computing","graph-algorithms","high-performance-computing","linear-algebra","opencl","parallel","python","python-bindings","sparse-matrix"],"latest_commit_sha":null,"homepage":"https://SparseLinearAlgebra.github.io/spla/docs-python/pyspla.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SparseLinearAlgebra.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-09T15:48:29.000Z","updated_at":"2025-02-14T08:06:22.000Z","dependencies_parsed_at":"2025-02-20T11:00:41.249Z","dependency_job_id":null,"html_url":"https://github.com/SparseLinearAlgebra/spla","commit_stats":null,"previous_names":["jetbrains-research/spla"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparseLinearAlgebra%2Fspla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparseLinearAlgebra%2Fspla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparseLinearAlgebra%2Fspla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparseLinearAlgebra%2Fspla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SparseLinearAlgebra","download_url":"https://codeload.github.com/SparseLinearAlgebra/spla/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236105,"owners_count":20420752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","gpgpu","gpu-computing","graph-algorithms","high-performance-computing","linear-algebra","opencl","parallel","python","python-bindings","sparse-matrix"],"created_at":"2025-03-18T13:51:48.479Z","updated_at":"2025-03-18T13:51:49.621Z","avatar_url":"https://github.com/SparseLinearAlgebra.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/SparseLinearAlgebra/spla/raw/main/docs/logos/spla-logo-light.png?raw=true\u0026sanitize=true\"\u003e\n\u003c/div\u003e\n\n[![Build](https://github.com/SparseLinearAlgebra/spla/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/SparseLinearAlgebra/spla/actions/workflows/build.yml)\n[![Python Package](https://github.com/SparseLinearAlgebra/spla/actions/workflows/deploy.yml/badge.svg)](https://pypi.org/project/pyspla/)\n[![Python Package (Test)](https://github.com/SparseLinearAlgebra/spla/actions/workflows/deploy-test.yml/badge.svg)](https://test.pypi.org/project/pyspla/)\n[![Docs C/C++](https://github.com/SparseLinearAlgebra/spla/actions/workflows/docs-cpp.yml/badge.svg?branch=main)](https://SparseLinearAlgebra.github.io/spla/docs-cpp/)\n[![Docs Python](https://github.com/SparseLinearAlgebra/spla/actions/workflows/docs-python.yml/badge.svg?branch=main)](https://SparseLinearAlgebra.github.io/spla/docs-python/pyspla.html)\n[![Clang Format](https://github.com/SparseLinearAlgebra/spla/actions/workflows/clang-format.yml/badge.svg?branch=main)](https://github.com/SparseLinearAlgebra/spla/actions/workflows/clang-format.yml)\n[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/SparseLinearAlgebra/spla/blob/master/LICENSE.md)\n\n**spla** is an open-source generalized sparse linear algebra framework for mathematical computations with GPUs\nacceleration. It provides linear algebra primitives, such as matrices, vectors and scalars, supports wide variety of\noperations. It gives an ability to customize underlying values types treatment and parametrise operations using built-in\nor custom user-defined functions.\n\n- **Website**:\n  [SparseLinearAlgebra.github.io/pyspla](https://SparseLinearAlgebra.github.io/spla/docs-python/pyspla.html)\n- **Package page**:\n  [pypi.org/project/pyspla](https://pypi.org/project/pyspla/)\n- **Package page (test)**:\n  [test.pypi.org/project/pyspla](https://test.pypi.org/project/pyspla/)\n- **Source code**:\n  [github.com/SparseLinearAlgebra/spla](https://github.com/SparseLinearAlgebra/spla)\n- **Contributing**:\n  [github.com/SparseLinearAlgebra/spla/CONTRIBUTING.md](https://github.com/SparseLinearAlgebra/spla/blob/main/CONTRIBUTING.md)\n- **Development**:\n  [github.com/SparseLinearAlgebra/spla/DEVELOPMENT.md](https://github.com/SparseLinearAlgebra/spla/blob/main/DEVELOPMENT.md)\n- **Examples**:\n  [github.com/SparseLinearAlgebra/spla/EXAMPLES.md](https://github.com/SparseLinearAlgebra/spla/blob/main/EXAMPLES.md)\n- **C/C++ API reference**:\n  [SparseLinearAlgebra.github.io/spla/docs-cpp](https://SparseLinearAlgebra.github.io/spla/docs-cpp/)\n- **Bug report**:\n  [github.com/SparseLinearAlgebra/spla/issues](https://github.com/SparseLinearAlgebra/spla/issues)\n\n\u003e Note: project under heavy development! Not ready for usage.\n\n## Installation\n\nInstall the release version of the package from **PyPI** repository for Windows, Linux and MacOS:\n\n```shell\n$ pip install pyspla\n```\n\nInstall the latest test version of the package from **Test PyPI** repository for Windows, Linux and MacOS:\n\n```shell\n$ pip install -i https://test.pypi.org/simple/ pyspla\n```\n\nDelete package if no more required:\n\n```shell\n$ pip uninstall pyspla\n```\n\n## Example of usage\n\nThis example demonstrates basic library primitives usage and shows how to implement simple breadth-first search\nalgorithm using `spla` primitives in a few lines of code and run it on your GPU using OpenCL backend for acceleration.\n\n```python\nfrom pyspla import *\n\ndef bfs(s: int, A: Matrix):\n    v = Vector(A.n_rows, INT)  # to store depths\n\n    front = Vector.from_lists([s], [1], A.n_rows, INT)  # front of new vertices to study\n    front_size = 1  # current front size\n    depth = Scalar(INT, 0)  # depth of search\n    count = 0  # num of reached vertices\n\n    while front_size \u003e 0:  # while have something to study\n        depth += 1\n        count += front_size\n        v.assign(front, depth, op_assign=INT.SECOND, op_select=INT.NQZERO)  # assign depths\n        front = front.vxm(v, A, op_mult=INT.LAND, op_add=INT.LOR, op_select=INT.EQZERO)  # do traversal\n        front_size = front.reduce(op_reduce=INT.PLUS).get()  # update front count to end algorithm\n\n    return v, count, depth.get()\n```\n\nCreate an adjacency matrix for a simple graph containing 4 vertices and 5 edges.\n\n```python\nI = [0, 1, 2, 2, 3]\nJ = [1, 2, 0, 3, 2]\nV = [1, 1, 1, 1, 1]\nA = Matrix.from_lists(I, J, V, shape=(4, 4), dtype=INT)\n```\n\nRun bfs algorithm starting from 0-vertex with the graph adjacency matrix created earlier. None, that `spla` will\nautomatically select GPU-based acceleration backed for computations.\n\n```python\nv, c, d = bfs(0, A)\n```\n\n## Performance\n\nSpla shows greate performance comparing to Nvidia CUDA based optimized GraphBLAST library, processing large graphs\nin extreme cases counting 1 BILLION edges with speed and without memory issues. Also, spla shows outstanding performance\nin Page-Rank algorithms, outperforming low-level Nvidia CUDA highly-optimized Gunrock library. Spla shows scalability\non GPUs on Intel, Nvidia and AMD with acceptable performance. Spla can be run even on integrated GPUs. Here you can\nget good speedup, what is much faster than `scipy` or `networkx`.\n\nMore details with performance study given down bellow.\n\n### Comparison on a Nvidia GPU\n\n| ![stats](./docs/stats/rq1_rel.png)                                                                                                            |\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| Description: Relative speedup of GraphBLAST, Gunrock and Spla compared to a LaGraph (SuiteSparse) used a baseline. Logarithmic scale is used. |\n\n\u003e **Configuration**: Ubuntu 20.04, 3.40Hz Intel Core i7-6700 4-core CPU, DDR4 64Gb RAM, Nvidia GeForce GTX 1070\n\u003e dedicated GPU with 8Gb on-board VRAM.\n\n### Scalability on Intel, Amd and Nvidia GPUs\n\n| ![stats](./docs/stats/rq2_cores.png)                                                                                           |\n|--------------------------------------------------------------------------------------------------------------------------------|\n| Description: Throughput of Spla library shown as a number of processed edges/s per single GPU core. Logarithmic scale is used. |\n\n\u003e **Configuration**: Nvidia GeForce GTX 1070 dedicated GPU with 8Gb on-board VRAM, Intel Arc A770 flux dedicated GPU\n\u003e with 8GB on-board VRAM and or AMD Radeon Vega Frontier Edition dedicated GPU with 16GB on-board VRAM.\n\n### Comparison running on integrated Intel and Amd GPUs\n\n| ![stats](./docs/stats/rq3_int.png)                                                                                                            |\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| Description: Relative speedup of Spla compared to a LaGraph (SuiteSparse) used a baseline running on a single CPU device with integrated GPU. |\n\n\u003e **Configuration**: Ubuntu 20.04, 3.40Hz Intel Core i7-6700 4-core CPU, DDR4 64Gb RAM, Intel HD Graphics 530 integrated\n\u003e GPU and Ubuntu 22.04, 4.70Hz AMD Ryzen 9 7900x 12-core CPU, DDR4 128 GB RAM, AMD GFX1036 integrated GPU.\n\n### Dataset\n\n| Name              | Vertices |   Edges | Avg Deg | Sd Deg |   Max Deg |                                                                                              Link |\n|:------------------|---------:|--------:|--------:|-------:|----------:|--------------------------------------------------------------------------------------------------:|\n| coAuthorsCiteseer |   227.3K |    1.6M |     7.2 |   10.6 |    1372.0 | [link](https://suitesparse-collection-website.herokuapp.com/MM/DIMACS10/coAuthorsCiteseer.tar.gz) |\n| coPapersDBLP      |   540.5K |   30.5M |    56.4 |   66.2 |    3299.0 |      [link](https://suitesparse-collection-website.herokuapp.com/MM/DIMACS10/coPapersDBLP.tar.gz) |\n| amazon-2008       |   735.3K |    7.0M |     9.6 |    7.6 |    1077.0 |                                                    [link](http://sparse.tamu.edu/LAW/amazon-2008) |\n| hollywood-2009    |     1.1M |  112.8M |    98.9 |  271.9 |   11467.0 |         [link](https://suitesparse-collection-website.herokuapp.com/MM/LAW/hollywood-2009.tar.gz) |\n| belgium_osm       |     1.4M |    3.1M |     2.2 |    0.5 |      10.0 |                                               [link](http://sparse.tamu.edu/DIMACS10/belgium_osm) |\n| roadNet-CA        |     2.0M |    5.5M |     2.8 |    1.0 |      12.0 |            [link](https://suitesparse-collection-website.herokuapp.com/MM/SNAP/roadNet-CA.tar.gz) |\n| com-Orkut         |     3.1M |  234.4M |    76.3 |  154.8 |   33313.0 |             [link](https://suitesparse-collection-website.herokuapp.com/MM/SNAP/com-Orkut.tar.gz) |\n| cit-Patents       |     3.8M |   33.0M |     8.8 |   10.5 |     793.0 |           [link](https://suitesparse-collection-website.herokuapp.com/MM/SNAP/cit-Patents.tar.gz) |\n| rgg_n_2_22_s0     |     4.2M |   60.7M |    14.5 |    3.8 |      36.0 |     [link](https://suitesparse-collection-website.herokuapp.com/MM/DIMACS10/rgg_n_2_22_s0.tar.gz) |\n| soc-LiveJournal   |     4.8M |   85.7M |    17.7 |   52.0 |   20333.0 |      [link](https://suitesparse-collection-website.herokuapp.com/MM/SNAP/soc-LiveJournal1.tar.gz) |\n| indochina-2004    |     7.4M |  302.0M |    40.7 |  329.6 |  256425.0 |         [link](https://suitesparse-collection-website.herokuapp.com/MM/LAW/indochina-2004.tar.gz) |\n| rgg_n_2_23_s0     |     8.4M |  127.0M |    15.1 |    3.9 |      40.0 |     [link](https://suitesparse-collection-website.herokuapp.com/MM/DIMACS10/rgg_n_2_23_s0.tar.gz) |\n| road_central      |    14.1M |   33.9M |     2.4 |    0.9 |       8.0 |                                              [link](http://sparse.tamu.edu/DIMACS10/road_central) |\n\n## Building from sources\n\n### Prerequisites\n\n- **Common**:\n    - Git (to get source code)\n    - CMake (the latest version)\n    - Ninja (as build files generator)\n    - Python 3.7+\n- **Windows 10**:\n    - Microsoft Visual C++ Compiler (MSVC) with C++ 17 support\n    - x64 Native Tools Command Prompt for VS\n- **Ubuntu 20.04**:\n    - GNU C++ Compiler with C++ 17 support\n- **MaсOS Catalina 10.15**:\n    - Clang Compiler with C++ 17 support\n\n### Get source code\n\nThe following code snippet downloads project source code repository, and enters project root folder. Must be executed\nfrom the folder where you want to locate project.\n\n```shell\n$ git clone https://github.com/SparseLinearAlgebra/spla.git\n$ cd spla\n```\n\n### Configure and run build\n\n\u003e **Attention!** On Windows platform building commands must be executed in `x64 Native Tools Command Prompt for VS`.\n\nThe following code snippet runs `build.py` script, which allows configuring cmake and running of actual build with\nselected options. You can specify build directory, build type, number of system threads for build, enable or disable\noptionally building of tests and example applications. Must be executed from project root folder.\n\n```shell\n$ python ./build.py --build-dir=build --build-type=Release --nt=4 --tests=YES --examples=YES\n```\n\nOn macOS, you can optionally specify target binaries architecture to build. Pass option `--arch`\nwith `x86_64` or `arm64` respectively. By default, build falls back to `CMAKE_SYSTEM_PROCESSOR` specified architecture.\nSee example bellow, replace `\u003carch\u003e` with desired architecture for your build. Must be executed from project root\nfolder.\n\n```shell\n$ python ./build.py --build-dir=build --build-type=Release --nt=4 --arch=\u003carch\u003e\n```\n\n### Run unit-tests\n\nThe following code snippet executed python script, which allows to run all native C++ library unit-tests, located in\nbuild directory, specified in `--build-dir` option. Must be executed from project root folder.\n\n```shell\n$ python ./run_tests.py --build-dir=build\n```\n\n## Contributors\n\n- Egor Orachyov (Github: [@EgorOrachyov](https://github.com/EgorOrachyov))\n- Semyon Grigorev (Github: [@gsvgit](https://github.com/gsvgit))\n\n## Citation\n\n```ignorelang\n@online{spla,\n  author = {Orachyov, Egor and Grigorev, Semyon},\n  title = {spla: An open-source generalized sparse linear algebra framework for GPU computations},\n  year = 2022,\n  url = {https://github.com/SparseLinearAlgebra/spla},\n  note = {Version 1.0.0}\n}\n```\n\n## Project structure\n\n| Entry                  | Description                                                        |\n| :--------------------- | :----------------------------------------------------------------- |\n| `📁 .github`           | CI/CD scripts and GitHub related files                             |\n| `📁 deps`              | Third-party project dependencies, stored as submodules             |\n| `📁 docs`              | Documentations and digital stuff                                   |\n| `📁 examples`          | Example applications of library C/C++ usage                        |\n| `📁 include`           | Library public C/C++ header files                                  |\n| `📁 src`               | Library private compiled source directory                          |\n| `📁 tests`             | Library C/C++ unit-tests                                           |\n| `📁 python`            | Python package bindings for library API                            |\n| `📄 CMakeLists.txt`    | CMake library configuration, add as sub directory to your project  |\n| `📄 build.py`          | Script to build library sources, tests and examples                |\n| `📄 bump_version.py`   | Script to increment or update version of package before release    |\n| `📄 run_tests.py`      | Script to run compiled library unit tests                          |\n| `📄 generate.py`       | Script to re-generate `.hpp` bindings from `.cl` source files      |\n\n## License\n\nThis project licensed under MIT License. License text can be found in the\n[license file](https://github.com/SparseLinearAlgebra/spla/blob/master/LICENSE.md).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSparseLinearAlgebra%2Fspla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSparseLinearAlgebra%2Fspla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSparseLinearAlgebra%2Fspla/lists"}