You can directly install with pip and set TORCH_CUDA_ARCH_LIST
to specify the cuda architecture if needed.
export TORCH_CUDA_ARCH_LIST="5.2 6.0 6.1 7.0 7.5 8.0 8.6+PTX"
pip install .
Or you can use build installation (Deprecated for newer python version).
bash make.sh
If you use python venv
, you can add --prefix
to specify the installation path.
bash make.sh --prefix $VIRTUAL_ENV
import torch
from vis4d_cuda_ops import ms_deform_attn_forward, ms_deform_attn_backward
...
- Add cuda and cpu ops.
- Delcare its Python interface in
src/vision.cpp
.