PyTorch bindings for gDel3D, a GPU-accelerated library for constructing Delaunay Triangulations of points in 3D.
This repository builds upon the original academic code and a modern CUDA refactor. It exposes the algorithm to Python, allowing for direct interaction with PyTorch tensors.
- PyTorch Integration: Supports input from both CPU-allocated and GPU-allocated tensors.
- Zero-Copy Support: Option to pass GPU tensors and avoid unnecessary host-to-device memory transfers.
- Modern CUDA: Tested on CUDA 12.6.
- Performance: Optimized for speed (Star Splaying and internal timing functions are disabled).
We use Conda to manage the CUDA environment.
conda create -y -n gdel3d python=3.12
conda activate gdel3d
conda install nvidia/label/cuda-12.6.0::cuda-toolkit
export CUDA_HOME=$CONDA_PREFIX
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH
pip install torch torchvision --index-url [https://download.pytorch.org/whl/cu126](https://download.pytorch.org/whl/cu126)
pip install -v -e . --no-build-isolation
# Run benchmark comparing function which keeps data in GPU vs transfers between CPU and GPU
python benchmark_host_device.pyThis project is based on the gDel3D algorithm. If you use this in research, please consult the original I3D 2014 paper.
Repositories:
- Original: ashwin/gDel3D
- Refactor: imanf94/gDel3D
Authors: Cao Thanh Tung and Ashwin Nanjappa
Project: gDel3D
Copyright (c) 2014, School of Computing, National University of Singapore. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the National University of Singapore nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission from the National University of Singapore.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.