spconv

Spatial Sparse Convolution Library

https://github.com/traveller59/spconv

Science Score: 54.0%

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

  • CITATION.cff file
    Found 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
    1 of 10 committers (10.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.4%) to scientific vocabulary

Keywords

point-cloud
Last synced: 6 months ago · JSON representation ·

Repository

Spatial Sparse Convolution Library

Basic Info
  • Host: GitHub
  • Owner: traveller59
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 6.32 MB
Statistics
  • Stars: 2,113
  • Watchers: 22
  • Forks: 385
  • Open Issues: 183
  • Releases: 0
Topics
point-cloud
Created about 7 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License Citation

README.md

SpConv: Spatially Sparse Convolution Library

Build Status pypi versions

| | PyPI | Install |Downloads | | -------------- |:---------------------:| ---------------------:| ---------------------:| | CPU (Linux Only) | PyPI Version | pip install spconv | pypi monthly download | | CUDA 10.2 | PyPI Version | pip install spconv-cu102| pypi monthly download| | CUDA 11.3 | PyPI Version | pip install spconv-cu113| pypi monthly download| | CUDA 11.4 | PyPI Version | pip install spconv-cu114| pypi monthly download| | CUDA 11.6 | PyPI Version | pip install spconv-cu116| pypi monthly download| | CUDA 11.7 | PyPI Version | pip install spconv-cu117| pypi monthly download| | CUDA 11.8 | PyPI Version | pip install spconv-cu118| pypi monthly download| | CUDA 12.0 | PyPI Version | pip install spconv-cu120| pypi monthly download|

spconv is a project that provide heavily-optimized sparse convolution implementation with tensor core support. check benchmark to see how fast spconv 2.x runs.

Spconv 1.x code. We won't provide any support for spconv 1.x since it's deprecated. use spconv 2.x if possible. <!--remove this message in spconv 2.2-->

Check spconv 2.x algorithm introduction to understand sparse convolution algorithm in spconv 2.x!

WARNING

Use spconv >= cu114 if possible. cuda 11.4 can compile greatly faster kernel in some situation.

Update Spconv: you MUST UNINSTALL all spconv/cumm/spconv-cuxxx/cumm-cuxxx first, use pip list | grep spconv and pip list | grep cumm to check all installed package. then use pip to install new spconv.

NEWS

  • spconv 2.3: int8 quantization support. see docs and examples for more details.

  • spconv 2.2: ampere feature support (by EvernightAurora), pure c++ code generation, nvrtc, drop python 3.6

Spconv 2.2 vs Spconv 2.1

  • faster fp16 conv kernels (~5-30%) in ampere GPUs (tested in RTX 3090)
  • greatly faster int8 conv kernels (~1.2x-2.7x) in ampere GPUs (tested in RTX 3090)
  • drop python 3.6 support
  • nvrtc support: kernel in old GPUs will be compiled in runtime.
  • libspconv: pure c++ build of all spconv ops. see example
  • tf32 kernels, faster fp32 training, disabled by default. set import spconv as spconv_core; spconv_core.constants.SPCONV_ALLOW_TF32 = True to enable them.
  • all weights are KRSC layout, some old model can't be loaded anymore.

Spconv 2.1 vs Spconv 1.x

  • spconv now can be installed by pip. see install section in readme for more details. Users don't need to build manually anymore!
  • Microsoft Windows support (only windows 10 has been tested).
  • fp32 (not tf32) training/inference speed is increased (+50~80%)
  • fp16 training/inference speed is greatly increased when your layer support tensor core (channel size must be multiple of 8).
  • int8 op is ready, but we still need some time to figure out how to run int8 in pytorch.
  • doesn't depend on pytorch binary, but you may need at least pytorch >= 1.5.0 to run spconv 2.x.
  • since spconv 2.x doesn't depend on pytorch binary (never in future), it's impossible to support torch.jit/libtorch inference.

Usage

Firstly you need to use import spconv.pytorch as spconv in spconv 2.x.

Then see this.

Don't forget to check performance guide.

Common Solution for Some Bugs

see common problems.

Install

You need to install python >= 3.7 first to use spconv 2.x.

You need to install CUDA toolkit first before using prebuilt binaries or build from source.

You need at least CUDA 11.0 to build and run spconv 2.x. We won't offer any support for CUDA < 11.0.

Prebuilt

We offer python 3.7-3.11 and cuda 10.2/11.3/11.4/11.7/12.0 prebuilt binaries for linux (manylinux).

We offer python 3.7-3.11 and cuda 10.2/11.4/11.7/12.0 prebuilt binaries for windows 10/11.

For Linux users, you need to install pip >= 20.3 first to install prebuilt.

WARNING: spconv-cu117 may require CUDA Driver >= 515.

pip install spconv for CPU only (Linux Only). you should only use this for debug usage, the performance isn't optimized due to manylinux limit (no omp support).

pip install spconv-cu102 for CUDA 10.2

pip install spconv-cu113 for CUDA 11.3 (Linux Only)

pip install spconv-cu114 for CUDA 11.4

pip install spconv-cu117 for CUDA 11.7

pip install spconv-cu120 for CUDA 12.0

NOTE It's safe to have different minor cuda version between system and conda (pytorch) in CUDA >= 11.0 because of CUDA Minor Version Compatibility. For example, you can use spconv-cu114 with anaconda version of pytorch cuda 11.1 in a OS with CUDA 11.2 installed.

NOTE In Linux, you can install spconv-cuxxx without install CUDA to system! only suitable NVIDIA driver is required. for CUDA 11, we need driver >= 450.82. You may need newer driver if you use newer CUDA. for cuda 11.8, you need to have driver >= 520 installed.

Prebuilt GPU Support Matrix

See this page to check supported GPU names by arch.

If you use a GPU architecture that isn't compiled in prebuilt, spconv will use NVRTC to compile a slightly slower kernel.

| CUDA version | GPU Arch List | | -------------- |:---------------------:| | 11.1~11.7 | 52,60,61,70,75,80,86 | | 11.8+ | 60,70,75,80,86,89,90 |

Build from source for development (JIT, recommend)

The c++ code will be built automatically when you change c++ code in project.

For NVIDIA Embedded Platforms, you need to specify cuda arch before build: export CUMM_CUDA_ARCH_LIST="7.2" for xavier, export CUMM_CUDA_ARCH_LIST="6.2" for TX2, export CUMM_CUDA_ARCH_LIST="8.7" for orin.

You need to remove cumm in requires section in pyproject.toml after install editable cumm and before install spconv due to pyproject limit (can't find editable installed cumm).

You need to ensure pip list | grep spconv and pip list | grep cumm show nothing before install editable spconv/cumm.

Linux

  1. uninstall spconv and cumm installed by pip
  2. install build-essential, install CUDA
  3. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  4. git clone https://github.com/traveller59/spconv, cd ./spconv, pip install -e .
  5. in python, import spconv and wait for build finish.

Windows

  1. uninstall spconv and cumm installed by pip
  2. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
  3. set powershell script execution policy
  4. start a new powershell, run tools/msvc_setup.ps1
  5. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  6. git clone https://github.com/traveller59/spconv, cd ./spconv, pip install -e .
  7. in python, import spconv and wait for build finish.

Build wheel from source (not recommend, this is done in CI.)

You need to rebuild cumm first if you are build along a CUDA version that not provided in prebuilts.

Linux

  1. install build-essential, install CUDA
  2. run export SPCONV_DISABLE_JIT="1"
  3. run pip install pccm cumm wheel
  4. run python setup.py bdist_wheel+pip install dists/xxx.whl

Windows

  1. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
  2. set powershell script execution policy
  3. start a new powershell, run tools/msvc_setup.ps1
  4. run $Env:SPCONV_DISABLE_JIT = "1"
  5. run pip install pccm cumm wheel
  6. run python setup.py bdist_wheel+pip install dists/xxx.whl

Citation

If you find this project useful in your research, please consider cite:

latex @misc{spconv2022, title={Spconv: Spatially Sparse Convolution Library}, author={Spconv Contributors}, howpublished = {\url{https://github.com/traveller59/spconv}}, year={2022} }

Contributers

Note

The work is done when the author is an employee at Tusimple.

LICENSE

Apache 2.0

Owner

  • Name: Yan Yan
  • Login: traveller59
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - name: "Spconv Contributors"
title: "Spconv: Spatially Sparse Convolution Library"
date-released: 2022-10-12
url: "https://github.com/traveller59/spconv"
license: Apache-2.0

GitHub Events

Total
  • Issues event: 36
  • Watch event: 240
  • Issue comment event: 88
  • Push event: 4
  • Pull request event: 5
  • Fork event: 22
  • Create event: 1
Last Year
  • Issues event: 36
  • Watch event: 240
  • Issue comment event: 88
  • Push event: 4
  • Pull request event: 5
  • Fork event: 22
  • Create event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 227
  • Total Committers: 10
  • Avg Commits per committer: 22.7
  • Development Distribution Score (DDS): 0.493
Past Year
  • Commits: 5
  • Committers: 1
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
yan.yan y****b@o****m 115
traveller59 s****n@f****m 50
yan.yan y****r@o****m 44
xmyqsh x****h@g****m 5
tusimple t****e@d****i 5
EvernightAurora 2****8@q****m 2
Benzlxs 8****s 2
benzlxs x****i@u****u 2
dev-fennek 5****k 1
Mohammad Shahedul Islam m****m@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 283
  • Total pull requests: 15
  • Average time to close issues: 4 months
  • Average time to close pull requests: 13 days
  • Total issue authors: 234
  • Total pull request authors: 13
  • Average comments per issue: 2.46
  • Average comments per pull request: 0.2
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 33
  • Pull requests: 6
  • Average time to close issues: 29 days
  • Average time to close pull requests: 4 minutes
  • Issue authors: 31
  • Pull request authors: 4
  • Average comments per issue: 0.91
  • Average comments per pull request: 0.17
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shuyuan-wang (10)
  • akjt (6)
  • QING-ML (4)
  • hygxy (3)
  • hlyyyyy (3)
  • ArseniuML (3)
  • Miles629 (3)
  • konyul (3)
  • emilyemliyM (3)
  • sun-sey (2)
  • rangganast (2)
  • Haerxu (2)
  • shawnding (2)
  • MrForExample (2)
  • Gofinge (2)
Pull Request Authors
  • xiaohuang2004 (2)
  • x1y9 (2)
  • zahidpichen (2)
  • StefOe (2)
  • yinguobing (2)
  • FindDefinition (1)
  • WanchaoYao (1)
  • APassbyDreg (1)
  • waveleaf27 (1)
  • Jhonve (1)
  • JiaqingFu (1)
  • huixiancheng (1)
Top Labels
Issue Labels
Stale (62) bug (2)
Pull Request Labels

Packages

  • Total packages: 13
  • Total downloads:
    • pypi 376,680 last-month
  • Total docker downloads: 369
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 192
    (may contain duplicates)
  • Total versions: 255
  • Total maintainers: 1
pypi.org: spconv

spatial sparse convolution

  • Versions: 39
  • Dependent Packages: 2
  • Dependent Repositories: 172
  • Downloads: 7,647 Last month
  • Docker Downloads: 20
Rankings
Dependent repos count: 1.2%
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 3.3%
Average: 4.1%
Downloads: 5.4%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu113

spatial sparse convolution

  • Versions: 33
  • Dependent Packages: 0
  • Dependent Repositories: 7
  • Downloads: 2,315 Last month
  • Docker Downloads: 219
Rankings
Stargazers count: 1.7%
Docker downloads count: 2.8%
Forks count: 2.8%
Downloads: 4.0%
Average: 4.5%
Dependent repos count: 5.5%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu111

spatial sparse convolution

  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 5
  • Downloads: 1,310 Last month
  • Docker Downloads: 22
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 4.1%
Average: 5.2%
Downloads: 5.8%
Dependent repos count: 6.6%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu114

spatial sparse convolution

  • Versions: 37
  • Dependent Packages: 0
  • Dependent Repositories: 4
  • Downloads: 4,359 Last month
  • Docker Downloads: 0
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 4.3%
Average: 5.3%
Downloads: 5.5%
Dependent repos count: 7.5%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/traveller59/spconv
  • Versions: 45
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.6%
Average: 5.8%
Dependent repos count: 5.9%
Last synced: 6 months ago
pypi.org: spconv-cu117

spatial sparse convolution

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 1,428 Last month
  • Docker Downloads: 76
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 2.9%
Downloads: 6.2%
Average: 7.6%
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu116

spatial sparse convolution

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 1,188 Last month
  • Docker Downloads: 22
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 4.1%
Downloads: 6.9%
Average: 7.9%
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu102

spatial sparse convolution

  • Versions: 34
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 825 Last month
  • Docker Downloads: 10
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Docker downloads count: 3.8%
Downloads: 7.9%
Average: 8.0%
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu118

spatial sparse convolution

  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 56,408 Last month
Rankings
Stargazers count: 1.7%
Forks count: 2.8%
Downloads: 5.5%
Average: 8.3%
Dependent packages count: 10.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu120

spatial sparse convolution

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 268,524 Last month
Rankings
Stargazers count: 1.8%
Forks count: 2.8%
Dependent packages count: 6.6%
Average: 11.0%
Downloads: 13.0%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu121

spatial sparse convolution

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 10,605 Last month
Rankings
Stargazers count: 2.4%
Forks count: 3.6%
Dependent packages count: 9.9%
Average: 17.9%
Dependent repos count: 55.8%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu126

spatial sparse convolution

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 17,474 Last month
Rankings
Dependent packages count: 9.9%
Average: 32.8%
Dependent repos count: 55.8%
Maintainers (1)
Last synced: 6 months ago
pypi.org: spconv-cu124

spatial sparse convolution

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 4,597 Last month
Rankings
Dependent packages count: 9.9%
Average: 32.8%
Dependent repos count: 55.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/build.yaml actions
  • actions/checkout master composite
  • actions/setup-python v4 composite
  • dorny/paths-filter v2 composite
  • ilammy/msvc-dev-cmd v1 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/stale.yaml actions
  • actions/stale v4 composite