Skip to content

Commit 84bbb71

Browse files
authored
PyTorch 2.0 wheels (#169)
* update * update * update * update
1 parent 0e10871 commit 84bbb71

17 files changed

+128
-115
lines changed

.github/workflows/building-conda.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,18 @@ jobs:
1313
# We have trouble building for Windows - drop for now.
1414
os: [ubuntu-18.04, macos-10.15] # windows-2019
1515
python-version: ['3.7', '3.8', '3.9', '3.10']
16-
torch-version: [1.13.0] # [1.12.0, 1.13.0]
17-
cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117']
16+
torch-version: [1.13.0, 2.0.0]
17+
# We have trouble building for `cu116` due to PyTorch 1.13.0 bugs
18+
cuda-version: ['cpu', 'cu117', 'cu118']
1819
exclude:
19-
- torch-version: 1.12.0
20-
cuda-version: 'cu117'
21-
- torch-version: 1.13.0
22-
cuda-version: 'cu102'
20+
- torch-version: 2.0.0
21+
python-version: '3.7'
2322
- torch-version: 1.13.0
24-
cuda-version: 'cu113'
25-
- os: macos-10.15
26-
cuda-version: 'cu102'
27-
- os: macos-10.15
28-
cuda-version: 'cu113'
29-
- os: macos-10.15
30-
cuda-version: 'cu116'
23+
cuda-version: 'cu118'
3124
- os: macos-10.15
3225
cuda-version: 'cu117'
33-
- os: windows-2019
34-
cuda-version: 'cu102'
35-
- os: windows-2019 # Complains about CUDA mismatch.
36-
python-version: '3.7'
26+
- os: macos-10.15
27+
cuda-version: 'cu118'
3728

3829
steps:
3930
- uses: actions/checkout@v2

.github/workflows/building.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,24 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os: [ubuntu-18.04, macos-10.15, windows-2019]
14-
python-version: ['3.7', '3.8', '3.9', '3.10']
15-
torch-version: [1.12.0, 1.13.0]
16-
cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117']
14+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
15+
torch-version: [1.13.0, 2.0.0]
16+
cuda-version: ['cpu', 'cu116', 'cu117', 'cu118']
1717
exclude:
18-
- torch-version: 1.12.0
19-
cuda-version: 'cu117'
2018
- torch-version: 1.13.0
21-
cuda-version: 'cu102'
19+
python-version: '3.11'
20+
- torch-version: 2.0.0
21+
python-version: '3.7'
2222
- torch-version: 1.13.0
23-
cuda-version: 'cu113'
24-
- os: macos-10.15
25-
cuda-version: 'cu102'
26-
- os: macos-10.15
27-
cuda-version: 'cu113'
23+
cuda-version: 'cu118'
24+
- torch-version: 2.0.0
25+
cuda-version: 'cu116'
2826
- os: macos-10.15
2927
cuda-version: 'cu116'
3028
- os: macos-10.15
3129
cuda-version: 'cu117'
32-
- os: windows-2019
33-
cuda-version: 'cu102'
30+
- os: macos-10.15
31+
cuda-version: 'cu118'
3432

3533
steps:
3634
- uses: actions/checkout@v2
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
CUDA_HOME=/usr/local/cuda-11.8
4+
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
5+
PATH=${CUDA_HOME}/bin:${PATH}
6+
7+
export FORCE_CUDA=1
8+
export TORCH_CUDA_ARCH_LIST="3.5;5.0+PTX;6.0;7.0;7.5;8.0;8.6"

.github/workflows/cuda/cu118-Linux.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
OS=ubuntu1804
4+
5+
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
6+
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600
7+
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
8+
sudo dpkg -i cuda-repo-${OS}-11-8-local_11.8.0-520.61.05-1_amd64.deb
9+
sudo cp /var/cuda-repo-${OS}-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
10+
11+
sudo apt-get -qq update
12+
sudo apt install cuda-nvcc-11-8 cuda-libraries-dev-11-8
13+
sudo apt clean
14+
15+
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
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.8
4+
PATH=${CUDA_HOME}/bin:$PATH
5+
PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH
6+
7+
export FORCE_CUDA=1
8+
export TORCH_CUDA_ARCH_LIST="6.0+PTX"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Install NVIDIA drivers, see:
4+
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
5+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
6+
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
7+
8+
export CUDA_SHORT=11.8
9+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers
10+
export CUDA_FILE=cuda_${CUDA_SHORT}.0_522.06_windows.exe
11+
12+
# Install CUDA:
13+
curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"
14+
echo ""
15+
echo "Installing from ${CUDA_FILE}..."
16+
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"
17+
echo "Done!"
18+
rm -f "${CUDA_FILE}"

.github/workflows/linting.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: 3.9
20+
python-version: 3.8
2121

2222
- name: Install dependencies
2323
run: |
@@ -26,30 +26,3 @@ jobs:
2626
- name: Run linting
2727
run: |
2828
flake8 .
29-
30-
pyroma:
31-
runs-on: ubuntu-latest
32-
33-
strategy:
34-
matrix:
35-
torch-version: [1.13.0]
36-
37-
steps:
38-
- uses: actions/checkout@v2
39-
40-
- name: Set up Python
41-
uses: actions/setup-python@v2
42-
with:
43-
python-version: 3.9
44-
45-
- name: Install PyTorch ${{ matrix.torch-version }}
46-
run: |
47-
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
48-
49-
- name: Install dependencies
50-
run: |
51-
pip install pyroma
52-
53-
- name: Check package metadata
54-
run: |
55-
pyroma --min=10 .

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, windows-latest]
18-
python-version: [3.7]
19-
torch-version: [1.12.0, 1.13.0]
18+
python-version: [3.8]
19+
torch-version: [1.13.0, 2.0.0]
2020

2121
steps:
2222
- uses: actions/checkout@v2

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22
project(torchcluster)
33
set(CMAKE_CXX_STANDARD 14)
4-
set(TORCHCLUSTER_VERSION 1.6.0)
4+
set(TORCHCLUSTER_VERSION 1.6.1)
55

66
option(WITH_CUDA "Enable CUDA support" OFF)
77
option(WITH_PYTHON "Link to Python when building" ON)

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,39 @@ conda install pytorch-cluster -c pyg
4343

4444
We alternatively provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl).
4545

46-
#### PyTorch 1.13
46+
#### PyTorch 2.0
4747

48-
To install the binaries for PyTorch 1.13.0, simply run
48+
To install the binaries for PyTorch 2.0.0, simply run
4949

5050
```
51-
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
51+
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-2.0.0+${CUDA}.html
5252
```
5353

54-
where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation.
54+
where `${CUDA}` should be replaced by either `cpu`, `cu117`, or `cu118` depending on your PyTorch installation.
5555

56-
| | `cpu` | `cu116` | `cu117` |
56+
| | `cpu` | `cu117` | `cu118` |
5757
|-------------|-------|---------|---------|
5858
| **Linux** ||||
5959
| **Windows** ||||
6060
| **macOS** || | |
6161

62-
#### PyTorch 1.12
62+
#### PyTorch 1.13
6363

64-
To install the binaries for PyTorch 1.12.0, simply run
64+
To install the binaries for PyTorch 1.13.0, simply run
6565

6666
```
67-
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
67+
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
6868
```
6969

70-
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation.
70+
where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation.
7171

72-
| | `cpu` | `cu102` | `cu113` | `cu116` |
73-
|-------------|-------|---------|---------|---------|
74-
| **Linux** |||||
75-
| **Windows** || | ||
76-
| **macOS** || | | |
72+
| | `cpu` | `cu116` | `cu117` |
73+
|-------------|-------|---------|---------|
74+
| **Linux** ||||
75+
| **Windows** ||||
76+
| **macOS** || | |
7777

78-
**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).
78+
**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).
7979
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.
8080
You can look up the latest supported version number [here](https://data.pyg.org/whl).
8181

conda/pytorch-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```
2-
./build_conda.sh 3.9 1.13.0 cu116 # python, pytorch and cuda version
2+
./build_conda.sh 3.9 2.0.0 cu117 # python, pytorch and cuda version
33
```

conda/pytorch-cluster/build_conda.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then
1010
export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]"
1111
else
1212
case $CUDA_VERSION in
13+
cu118)
14+
export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.8.*"
15+
;;
1316
cu117)
1417
export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.7.*"
1518
;;

conda/pytorch-cluster/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: pytorch-cluster
3-
version: 1.6.0
3+
version: 1.6.1
44

55
source:
66
path: ../..

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from torch.utils.cpp_extension import (CUDA_HOME, BuildExtension, CppExtension,
1212
CUDAExtension)
1313

14-
__version__ = '1.6.0'
14+
__version__ = '1.6.1'
1515
URL = 'https://github.com/rusty1s/pytorch_cluster'
1616

1717
WITH_CUDA = False

test/test_nearest.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,27 @@ def test_nearest(dtype, device):
3838
batch_x = tensor([0, 0, 0, 0, 1, 1, 1, 1], torch.long, device)
3939
batch_y = tensor([0, 0, 0, 0], torch.long, device)
4040
with pytest.raises(ValueError):
41-
out = nearest(x, y, batch_x, batch_y)
41+
nearest(x, y, batch_x, batch_y)
4242

4343
# Invalid input: instance 1 only in batch_x (implicitly as batch_y=None)
4444
with pytest.raises(ValueError):
45-
out = nearest(x, y, batch_x, batch_y=None)
46-
47-
# Valid input: instance 1 only in batch_y
48-
batch_x = tensor([0, 0, 0, 0, 0, 0, 0, 0], torch.long, device)
49-
batch_y = tensor([0, 0, 1, 1], torch.long, device)
50-
out = nearest(x, y, batch_x, batch_y)
51-
assert out.tolist() == [0, 0, 1, 1, 0, 0, 1, 1]
45+
nearest(x, y, batch_x, batch_y=None)
5246

5347
# Invalid input: instance 2 only in batch_x
5448
# (i.e.instance in the middle missing)
5549
batch_x = tensor([0, 0, 1, 1, 2, 2, 3, 3], torch.long, device)
5650
batch_y = tensor([0, 1, 3, 3], torch.long, device)
5751
with pytest.raises(ValueError):
58-
out = nearest(x, y, batch_x, batch_y)
52+
nearest(x, y, batch_x, batch_y)
5953

6054
# Invalid input: batch_x unsorted
6155
batch_x = tensor([0, 0, 1, 0, 0, 0, 0], torch.long, device)
6256
batch_y = tensor([0, 0, 1, 1], torch.long, device)
6357
with pytest.raises(ValueError):
64-
out = nearest(x, y, batch_x, batch_y)
58+
nearest(x, y, batch_x, batch_y)
6559

6660
# Invalid input: batch_y unsorted
6761
batch_x = tensor([0, 0, 0, 0, 1, 1, 1, 1], torch.long, device)
6862
batch_y = tensor([0, 0, 1, 0], torch.long, device)
6963
with pytest.raises(ValueError):
70-
out = nearest(x, y, batch_x, batch_y)
64+
nearest(x, y, batch_x, batch_y)

torch_cluster/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import torch
55

6-
__version__ = '1.6.0'
6+
__version__ = '1.6.1'
77

88
for library in [
99
'_version', '_grid', '_graclus', '_fps', '_rw', '_sampler', '_nearest',

0 commit comments

Comments
 (0)