* VoxelGenerator has been replaced by Point2VoxelGPU[1-4]d/Point2VoxelCPU[1-4]d.
* VoxelGenerator has been replaced by Point2VoxelGPU[1-4]d/Point2VoxelCPU[1-4]d.
* spconv 2.x don't support CPU for now
* spconv 2.x don't support CPU for now
* test spconv 2.x in spconv 1.x model: set environment variable before run program. Linux: ```export SPCONV_FILTER_HWIO="1"```, Windows powershell: ```$Env:SPCONV_FILTER_HWIO = "1"```
* test spconv 1.x model in spconv 2.x: set environment variable before run program. Linux: ```export SPCONV_FILTER_HWIO="1"```, Windows powershell: ```$Env:SPCONV_FILTER_HWIO = "1"```
## News in Spconv 2.0.0
## News in Spconv 2.0.0
* training/inference speed is increased
* training/inference speed is increased (+50~80% for float32)
* support int8/tensor core
* support int8/tensor core
* doesn't depend on pytorch binary.
* doesn't depend on pytorch binary.
* since spconv 2.x doesn't depend on pytorch binary (never in future), it's impossible to support torch.jit/libtorch inference.
* since spconv 2.x doesn't depend on pytorch binary (never in future), it's impossible to support torch.jit/libtorch inference.
## TODO in Spconv 2.x
- [ ] Ampere (A100 / RTX 3000 series) feature support (work in progress)
## Usage
- [ ] torch QAT support (work in progress)
- [ ] TensorRT (torch.fx based)
Firstly you need to use ```import spconv.pytorch as spconv``` in spconv 2.x.
- [ ] Build C++ only package
- [ ] JIT compilation for CUDA kernels
Then see docs/USAGE.md.
- [ ] Document (low priority)
- [ ] CPU support (low priority)
## Install
## Install
...
@@ -58,7 +57,7 @@ You need at least CUDA 10.2 to build and run spconv 2.x. We won't offer any supp
...
@@ -58,7 +57,7 @@ You need at least CUDA 10.2 to build and run spconv 2.x. We won't offer any supp
We offer python 3.7-3.10 and 11.1/11.4 prebuilt binaries for linux (manylinux) and windows 10/11.
We offer python 3.7-3.10 and 11.1/11.4 prebuilt binaries for linux (manylinux) and windows 10/11.
CUDA 10.2 support will be added in version 2.0.1.
CUDA 10.2 support will be added in version 2.0.2.
We will offer prebuilts for CUDA versions supported by latest pytorch release. For example, pytorch 1.9 support cuda 10.2 and 11.1, so we support them too.
We will offer prebuilts for CUDA versions supported by latest pytorch release. For example, pytorch 1.9 support cuda 10.2 and 11.1, so we support them too.
...
@@ -68,6 +67,8 @@ For Linux users, you need to install pip >= 20.3 first to install prebuilt.
...
@@ -68,6 +67,8 @@ For Linux users, you need to install pip >= 20.3 first to install prebuilt.
```pip install spconv-cu114``` for CUDA 11.4
```pip install spconv-cu114``` for CUDA 11.4
**NOTE** It's safe to have different minor cuda version between system and conda (pytorch). for example, you can use spconv-cu114 with anaconda version of pytorch cuda 11.1 in a OS with CUDA 11.2 installed.
### Build from source
### Build from source
You need to rebuild ```cumm``` first if you are build along a CUDA version that not provided in prebuilts.
You need to rebuild ```cumm``` first if you are build along a CUDA version that not provided in prebuilts.
...
@@ -76,7 +77,7 @@ You need to rebuild ```cumm``` first if you are build along a CUDA version that
...
@@ -76,7 +77,7 @@ You need to rebuild ```cumm``` first if you are build along a CUDA version that
* indices: ```[N, (batch_idx + x + y + z)]``` coordinate tensor with batch axis. note that the coordinates xyz order MUST match spatial shape and conv params such as kernel size
* indices: ```[N, (batch_idx + x + y + z)]``` coordinate tensor with batch axis. note that the coordinates xyz order MUST match spatial shape and conv params such as kernel size
```Python
```Python
import spconv.pytorch as spconv
features = # your features with shape [N, num_channels]
features = # your features with shape [N, num_channels]
indices = # your indices/coordinates with shape [N, ndim + 1], batch index must be put in indices[:, 0]
indices = # your indices/coordinates with shape [N, ndim + 1], batch index must be put in indices[:, 0]
spatial_shape = # spatial shape of your sparse tensor, spatial_shape[i] is shape of indices[:, 1 + i].
spatial_shape = # spatial shape of your sparse tensor, spatial_shape[i] is shape of indices[:, 1 + i].