diff --git a/.github/workflows/building-conda.yml b/.github/workflows/building-conda.yml index 3970750a..3fbe1eb7 100644 --- a/.github/workflows/building-conda.yml +++ b/.github/workflows/building-conda.yml @@ -13,25 +13,18 @@ jobs: # We have trouble building for Windows - drop for now. os: [ubuntu-18.04, macos-10.15] # windows-2019 python-version: ['3.7', '3.8', '3.9', '3.10'] - torch-version: [1.12.0, 1.13.0] - cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117'] + torch-version: [1.13.0, 2.0.0] + # We have trouble building for `cu116` due to PyTorch 1.13.0 bugs + cuda-version: ['cpu', 'cu117', 'cu118'] exclude: - - torch-version: 1.12.0 - cuda-version: 'cu117' - - torch-version: 1.13.0 - cuda-version: 'cu102' + - torch-version: 2.0.0 + python-version: '3.7' - torch-version: 1.13.0 - cuda-version: 'cu113' - - os: macos-10.15 - cuda-version: 'cu102' - - os: macos-10.15 - cuda-version: 'cu113' - - os: macos-10.15 - cuda-version: 'cu116' + cuda-version: 'cu118' - os: macos-10.15 cuda-version: 'cu117' - - os: windows-2019 - cuda-version: 'cu102' + - os: macos-10.15 + cuda-version: 'cu118' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index 23459440..92b2e25d 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -11,26 +11,24 @@ jobs: fail-fast: false matrix: os: [ubuntu-18.04, macos-10.15, windows-2019] - python-version: ['3.7', '3.8', '3.9', '3.10'] - torch-version: [1.12.0, 1.13.0] - cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + torch-version: [1.13.0, 2.0.0] + cuda-version: ['cpu', 'cu116', 'cu117', 'cu118'] exclude: - - torch-version: 1.12.0 - cuda-version: 'cu117' - torch-version: 1.13.0 - cuda-version: 'cu102' + python-version: '3.11' + - torch-version: 2.0.0 + python-version: '3.7' - torch-version: 1.13.0 - cuda-version: 'cu113' - - os: macos-10.15 - cuda-version: 'cu102' - - os: macos-10.15 - cuda-version: 'cu113' + cuda-version: 'cu118' + - torch-version: 2.0.0 + cuda-version: 'cu116' - os: macos-10.15 cuda-version: 'cu116' - os: macos-10.15 cuda-version: 'cu117' - - os: windows-2019 - cuda-version: 'cu102' + - os: macos-10.15 + cuda-version: 'cu118' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/cuda/cu118-Linux-env.sh b/.github/workflows/cuda/cu118-Linux-env.sh new file mode 100644 index 00000000..18d97b8a --- /dev/null +++ b/.github/workflows/cuda/cu118-Linux-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/usr/local/cuda-11.8 +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" diff --git a/.github/workflows/cuda/cu118-Linux.sh b/.github/workflows/cuda/cu118-Linux.sh new file mode 100755 index 00000000..000a3bd3 --- /dev/null +++ b/.github/workflows/cuda/cu118-Linux.sh @@ -0,0 +1,15 @@ +#!/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.8.0/local_installers/cuda-repo-${OS}-11-8-local_11.8.0-520.61.05-1_amd64.deb +sudo dpkg -i cuda-repo-${OS}-11-8-local_11.8.0-520.61.05-1_amd64.deb +sudo cp /var/cuda-repo-${OS}-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/ + +sudo apt-get -qq update +sudo apt install cuda-nvcc-11-8 cuda-libraries-dev-11-8 +sudo apt clean + +rm -f https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-${OS}-11-8-local_11.8.0-520.61.05-1_amd64.deb diff --git a/.github/workflows/cuda/cu118-Windows-env.sh b/.github/workflows/cuda/cu118-Windows-env.sh new file mode 100644 index 00000000..d0ff04b6 --- /dev/null +++ b/.github/workflows/cuda/cu118-Windows-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.8 +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" diff --git a/.github/workflows/cuda/cu118-Windows.sh b/.github/workflows/cuda/cu118-Windows.sh new file mode 100755 index 00000000..b82a5a9b --- /dev/null +++ b/.github/workflows/cuda/cu118-Windows.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# 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.8 +export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers +export CUDA_FILE=cuda_${CUDA_SHORT}.0_522.06_windows.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}" diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0ff7a7ae..78734f7c 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.8 - name: Install dependencies run: | @@ -26,30 +26,3 @@ jobs: - name: Run linting run: | flake8 . - - pyroma: - runs-on: ubuntu-latest - - strategy: - matrix: - torch-version: [1.13.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 }} --extra-index-url https://download.pytorch.org/whl/cpu - - - name: Install dependencies - run: | - pip install pyroma - - - name: Check package metadata - run: | - pyroma --min=10 . diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e50a0fd6..bb9c2af5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.7] - torch-version: [1.12.0, 1.13.0] + python-version: [3.8] + torch-version: [1.13.0, 2.0.0] steps: - uses: actions/checkout@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 24c6e838..4972b2da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(torchscatter) set(CMAKE_CXX_STANDARD 14) -set(TORCHSCATTER_VERSION 2.1.0) +set(TORCHSCATTER_VERSION 2.1.1) option(WITH_CUDA "Enable CUDA support" OFF) option(WITH_PYTHON "Link to Python when building" ON) diff --git a/README.md b/README.md index 09f179c3..a6c1be61 100644 --- a/README.md +++ b/README.md @@ -54,39 +54,39 @@ conda install pytorch-scatter -c pyg We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl). -#### PyTorch 1.13 +#### PyTorch 2.0 -To install the binaries for PyTorch 1.13.0, simply run +To install the binaries for PyTorch 2.0.0, simply run ``` -pip install torch-scatter -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html +pip install torch-scatter -f https://data.pyg.org/whl/torch-2.0.0+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation. +where `${CUDA}` should be replaced by either `cpu`, `cu117`, or `cu118` depending on your PyTorch installation. -| | `cpu` | `cu116` | `cu117` | +| | `cpu` | `cu117` | `cu118` | |-------------|-------|---------|---------| | **Linux** | ✅ | ✅ | ✅ | | **Windows** | ✅ | ✅ | ✅ | | **macOS** | ✅ | | | -#### PyTorch 1.12 +#### PyTorch 1.13 -To install the binaries for PyTorch 1.12.0, simply run +To install the binaries for PyTorch 1.13.0, simply run ``` -pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html +pip install torch-scatter -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation. +where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation. -| | `cpu` | `cu102` | `cu113` | `cu116` | -|-------------|-------|---------|---------|---------| -| **Linux** | ✅ | ✅ | ✅ | ✅ | -| **Windows** | ✅ | | ✅ | ✅ | -| **macOS** | ✅ | | | | +| | `cpu` | `cu116` | `cu117` | +|-------------|-------|---------|---------| +| **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, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2 and PyTorch 1.11.0 (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, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, PyTorch 1.11.0 and PyTorch 1.12.0/1.12.1 (following the same procedure). For older versions, you need to explicitly specify the latest supported version number or install via `pip install --no-index` in order to prevent a manual installation from source. You can look up the latest supported version number [here](https://data.pyg.org/whl). diff --git a/conda/pytorch-scatter/README.md b/conda/pytorch-scatter/README.md index 6476246b..6207e22a 100644 --- a/conda/pytorch-scatter/README.md +++ b/conda/pytorch-scatter/README.md @@ -1,3 +1,3 @@ ``` -./build_conda.sh 3.9 1.13.0 cu116 # python, pytorch and cuda version +./build_conda.sh 3.9 2.0.0 cu117 # python, pytorch and cuda version ``` diff --git a/conda/pytorch-scatter/build_conda.sh b/conda/pytorch-scatter/build_conda.sh index 14355ea4..21d94c2f 100755 --- a/conda/pytorch-scatter/build_conda.sh +++ b/conda/pytorch-scatter/build_conda.sh @@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]" else case $CUDA_VERSION in + cu118) + export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.8.*" + ;; cu117) export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.7.*" ;; diff --git a/conda/pytorch-scatter/meta.yaml b/conda/pytorch-scatter/meta.yaml index f897da20..87ee29b1 100644 --- a/conda/pytorch-scatter/meta.yaml +++ b/conda/pytorch-scatter/meta.yaml @@ -1,6 +1,6 @@ package: name: pytorch-scatter - version: 2.1.0 + version: 2.1.1 source: path: ../.. diff --git a/setup.py b/setup.py index 4f4959dc..647a65d1 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from torch.utils.cpp_extension import (CUDA_HOME, BuildExtension, CppExtension, CUDAExtension) -__version__ = '2.1.0' +__version__ = '2.1.1' URL = 'https://github.com/rusty1s/pytorch_scatter' WITH_CUDA = False diff --git a/torch_scatter/__init__.py b/torch_scatter/__init__.py index 0d20faee..28dcd8a2 100644 --- a/torch_scatter/__init__.py +++ b/torch_scatter/__init__.py @@ -1,10 +1,10 @@ -import os import importlib +import os import os.path as osp import torch -__version__ = '2.1.0' +__version__ = '2.1.1' for library in ['_version', '_scatter', '_segment_csr', '_segment_coo']: cuda_spec = importlib.machinery.PathFinder().find_spec( @@ -28,18 +28,18 @@ torch.ops.torch_scatter.scatter_min = scatter_arg_placeholder torch.ops.torch_scatter.scatter_max = scatter_arg_placeholder - from .placeholder import segment_csr_placeholder - from .placeholder import segment_csr_arg_placeholder - from .placeholder import gather_csr_placeholder + from .placeholder import (gather_csr_placeholder, + segment_csr_arg_placeholder, + segment_csr_placeholder) torch.ops.torch_scatter.segment_sum_csr = segment_csr_placeholder torch.ops.torch_scatter.segment_mean_csr = segment_csr_placeholder torch.ops.torch_scatter.segment_min_csr = segment_csr_arg_placeholder torch.ops.torch_scatter.segment_max_csr = segment_csr_arg_placeholder torch.ops.torch_scatter.gather_csr = gather_csr_placeholder - from .placeholder import segment_coo_placeholder - from .placeholder import segment_coo_arg_placeholder - from .placeholder import gather_coo_placeholder + from .placeholder import (gather_coo_placeholder, + segment_coo_arg_placeholder, + segment_coo_placeholder) torch.ops.torch_scatter.segment_sum_coo = segment_coo_placeholder torch.ops.torch_scatter.segment_mean_coo = segment_coo_placeholder torch.ops.torch_scatter.segment_min_coo = segment_coo_arg_placeholder