Commit 908779b2 authored by rusty1s's avatar rusty1s
Browse files

version up + PyTorch 1.11 support

parent 576e0bbf
......@@ -10,21 +10,29 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
torch-version: [1.10.0]
cuda-version: ['cpu', 'cu102', 'cu111', 'cu113']
os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0, 1.11.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
exclude:
- torch-version: 1.9.0
cuda-version: 'cu113'
- torch-version: 1.10.0
cuda-version: 'cu111'
- os: macos-10.15
cuda-version: 'cu115'
- torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu111'
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird `glibc=2.27` bug going on for this combination:
- os: ubuntu-18.04
python-version: '3.10'
- os: ubuntu-18.04
cuda-version: 'cu115'
steps:
- uses: actions/checkout@v2
......@@ -34,7 +42,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Free up disk space
if: ${{ runner.os == 'Linux' && matrix.cuda-version == 'cu111' }}
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm -rf /usr/share/dotnet
......
......@@ -10,21 +10,28 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
torch-version: [1.10.0]
cuda-version: ['cpu', 'cu102', 'cu111', 'cu113']
os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0, 1.11.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
exclude:
- torch-version: 1.9.0
cuda-version: 'cu113'
- torch-version: 1.10.0
cuda-version: 'cu111'
- os: macos-10.15
cuda-version: 'cu115'
- torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu111'
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird bug going on for this combination:
- os: windows-2019
python-version: '3.7'
cuda-version: 'cu115'
steps:
- uses: actions/checkout@v2
......
#!/bin/bash
CUDA_HOME=/usr/local/cuda-11.5
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
PATH=${CUDA_HOME}/bin:${PATH}
export FORCE_CUDA=1
export TORCH_CUDA_ARCH_LIST="3.5;5.0+PTX;6.0;7.0;7.5;8.0;8.6"
#!/bin/bash
OS=ubuntu1804
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget -nv https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-1_amd64.deb
sudo dpkg -i cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-1_amd64.deb
sudo apt-key add /var/cuda-repo-${OS}-11-5-local/7fa2af80.pub
sudo apt-get -qq update
sudo apt install cuda-nvcc-11-5 cuda-libraries-dev-11-5
sudo apt clean
rm -f https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-1_amd64.deb
#!/bin/bash
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3
PATH=${CUDA_HOME}/bin:$PATH
PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH
export FORCE_CUDA=1
export TORCH_CUDA_ARCH_LIST="6.0+PTX"
#!/bin/bash
# TODO We currently use CUDA 11.3 to build CUDA 11.5 Windows wheels
# Install NVIDIA drivers, see:
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
export CUDA_SHORT=11.3
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers
export CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe
# Install CUDA:
curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"
echo ""
echo "Installing from ${CUDA_FILE}..."
PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT}\" -Wait -NoNewWindow"
echo "Done!"
rm -f "${CUDA_FILE}"
name: Linting
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
jobs:
flake8:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.9
- name: Install dependencies
run: |
......@@ -26,3 +26,30 @@ jobs:
- name: Run linting
run: |
flake8 .
pyroma:
runs-on: ubuntu-latest
strategy:
matrix:
torch-version: [1.11.0]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install PyTorch ${{ matrix.torch-version }}
run: |
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
pip install pyroma
- name: Check package metadata
run: |
pyroma --min=9 .
name: Testing
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
jobs:
......@@ -8,10 +12,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.6]
torch-version: [1.9.0, 1.10.0]
python-version: [3.7]
torch-version: [1.10.0, 1.11.0]
steps:
- uses: actions/checkout@v2
......@@ -30,16 +35,10 @@ jobs:
- name: Run test-suite
run: |
python setup.py test
pytest --cov --cov-report=xml
- name: Generate coverage report
if: success()
run: |
pip install coverage
coverage xml
- name: Upload coverage report to codecov
- name: Upload coverage
uses: codecov/codecov-action@v1
if: success()
with:
file: coverage.xml
fail_ci_if_error: false
cmake_minimum_required(VERSION 3.0)
project(torchcluster)
set(CMAKE_CXX_STANDARD 14)
set(TORCHCLUSTER_VERSION 1.5.9)
set(TORCHCLUSTER_VERSION 1.6.0)
option(WITH_CUDA "Enable CUDA support" OFF)
......
......@@ -43,39 +43,41 @@ conda install pytorch-cluster -c pyg
We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl).
#### PyTorch 1.10.0
#### PyTorch 1.11
To install the binaries for PyTorch 1.10.0, simply run
To install the binaries for PyTorch 1.11.0, simply run
```
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
```
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu113` depending on your PyTorch installation.
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation.
| | `cpu` | `cu102` | `cu113` |
|-------------|-------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | |
| | `cpu` | `cu102` | `cu113` | `cu115` |
|-------------|-------|---------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ | ✅ |
| **Windows** | ✅ | | ✅ | ✅ |
| **macOS** | ✅ | | | |
#### PyTorch 1.9.0/1.9.1
#### PyTorch 1.10
To install the binaries for PyTorch 1.9.0 and 1.9.1, simply run
To install the binaries for PyTorch 1.10.0, PyTorch 1.10.1 and PyTorch 1.10.2, simply run
```
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.9.0+${CUDA}.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
```
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu111` depending on your PyTorch installation.
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu111`, or `cu113` depending on your PyTorch installation.
| | `cpu` | `cu102` | `cu111` |
|-------------|-------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | |
| | `cpu` | `cu102` | `cu111` | `cu113` |
|-------------|-------|---------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | | |
**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1 and PyTorch 1.8.0/1.8.1 (following the same procedure).
**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1 and PyTorch 1.9.0 (following the same procedure).
For older versions, you might need to explicitly specify the latest supported version number in order to prevent a manual installation from source.
You can look up the latest supported version number [here](https://data.pyg.org/whl).
### From source
......@@ -274,7 +276,7 @@ tensor([[0, 1, 2, 4],
## Running tests
```
python setup.py test
pytest
```
## C++ API
......
```
./build_conda.sh 3.9 1.9.0 cu111 # python, pytorch and cuda version
./build_conda.sh 3.9 1.11.0 cu113 # python, pytorch and cuda version
```
......@@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then
export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]"
else
case $CUDA_VERSION in
cu115)
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.5.*"
;;
cu113)
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.3.*"
;;
......@@ -33,4 +36,4 @@ echo "PyTorch $TORCH_VERSION+$CUDA_VERSION"
echo "- $CONDA_PYTORCH_CONSTRAINT"
echo "- $CONDA_CUDATOOLKIT_CONSTRAINT"
conda build . -c nvidia -c pytorch -c default -c conda-forge --output-folder "$HOME/conda-bld"
conda build . -c pytorch -c default -c nvidia --output-folder "$HOME/conda-bld"
package:
name: pytorch-cluster
version: 1.5.9
version: 1.6.0
source:
path: ../..
......
[metadata]
description-file = README.md
long_description=file: README.md
long_description_content_type=text/markdown
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
[aliases]
test = pytest
[tool:pytest]
addopts = --cov
addopts = --capture=no
import os
import sys
import glob
import os
import os.path as osp
from itertools import product
from setuptools import setup, find_packages
import platform
import sys
from itertools import product
import torch
from setuptools import find_packages, setup
from torch.__config__ import parallel_info
from torch.utils.cpp_extension import BuildExtension
from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME
from torch.utils.cpp_extension import (CUDA_HOME, BuildExtension, CppExtension,
CUDAExtension)
__version__ = '1.6.0',
URL = 'https://github.com/rusty1s/pytorch_cluster'
WITH_CUDA = torch.cuda.is_available() and CUDA_HOME is not None
suffices = ['cpu', 'cuda'] if WITH_CUDA else ['cpu']
......@@ -85,33 +88,38 @@ def get_extensions():
install_requires = []
setup_requires = []
tests_require = ['pytest', 'pytest-runner', 'pytest-cov', 'scipy']
test_requires = [
'pytest',
'pytest-cov',
'scipy',
]
setup(
name='torch_cluster',
version='1.5.9',
author='Matthias Fey',
author_email='matthias.fey@tu-dortmund.de',
url='https://github.com/rusty1s/pytorch_cluster',
version=__version__,
description=('PyTorch Extension Library of Optimized Graph Cluster '
'Algorithms'),
author='Matthias Fey',
author_email='matthias.fey@tu-dortmund.de',
url=URL,
download_url=f'{URL}/archive/{__version__}.tar.gz',
keywords=[
'pytorch',
'geometric-deep-learning',
'graph-neural-networks',
'cluster-algorithms',
],
license='MIT',
python_requires='>=3.6',
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
extras_require={
'test': test_requires,
},
ext_modules=get_extensions() if not BUILD_DOCS else [],
cmdclass={
'build_ext':
BuildExtension.with_options(no_python_abi_suffix=True, use_ninja=False)
},
packages=find_packages(),
include_package_data=True,
)
......@@ -3,7 +3,7 @@ import os.path as osp
import torch
__version__ = '1.5.9'
__version__ = '1.6.0'
for library in [
'_version', '_grid', '_graclus', '_fps', '_rw', '_sampler', '_nearest',
......@@ -36,11 +36,11 @@ if torch.cuda.is_available() and cuda_version != -1: # pragma: no cover
f'{major}.{minor}. Please reinstall the torch_cluster that '
f'matches your PyTorch install.')
from .fps import fps # noqa
from .graclus import graclus_cluster # noqa
from .grid import grid_cluster # noqa
from .fps import fps # noqa
from .nearest import nearest # noqa
from .knn import knn, knn_graph # noqa
from .nearest import nearest # noqa
from .radius import radius, radius_graph # noqa
from .rw import random_walk # noqa
from .sampler import neighbor_sampler # noqa
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment