Installation
Blades is available for Python 3.9 to Python 3.11.
Note
We do not recommend installation as a root user on your system Python. Please setup a virtual environment, e.g., via Anaconda or Miniconda, or create a Docker image.
Installation via PyPi
You can install and use Blades without any external library required except for PyTorch and Ray.
For this, simply run:
pip install blades
Installation from Source
In case a specific version is not supported by our wheels, you can alternatively install them from source:
Ensure that your CUDA is setup correctly (optional):
Check if PyTorch is installed with CUDA support:
python -c "import torch; print(torch.cuda.is_available())" >>> True
Add CUDA to
$PATHand$CPATH(note that your actual CUDA path may vary from/usr/local/cuda):export PATH=/usr/local/cuda/bin:$PATH echo $PATH >>> /usr/local/cuda/bin:... export CPATH=/usr/local/cuda/include:$CPATH echo $CPATH >>> /usr/local/cuda/include:...
Add CUDA to
$LD_LIBRARY_PATHon Linux and to$DYLD_LIBRARY_PATHon macOS (note that your actual CUDA path may vary from/usr/local/cuda):export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH echo $LD_LIBRARY_PATH >>> /usr/local/cuda/lib64:... export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH echo $DYLD_LIBRARY_PATH >>> /usr/local/cuda/lib:...
Verify that
nvccis accessible from terminal:nvcc --version >>> 11.8
Ensure that PyTorch and system CUDA versions match:
python -c "import torch; print(torch.version.cuda)" >>> 11.8 nvcc --version >>> 11.8
Install the relevant packages:
pip install --verbose git+https://github.com/pyg-team/pyg-lib.git pip install --verbose torch_scatter pip install --verbose torch_sparse pip install --verbose torch_cluster pip install --verbose torch_spline_conv
In rare cases, CUDA or Python path problems can prevent a successful installation.
pip may even signal a successful installation, but execution simply crashes with Segmentation fault (core dumped).
We collected common installation errors in the Frequently Asked Questions subsection.
In case the FAQ does not help you in solving your problem, please create an issue.
Before, please verify that your CUDA is set up correctly by following the official installation guide.