Skip to content

Commit f95330e

Browse files
authored
PyTorch 1.13 support (#334)
* update * update * update
1 parent 5737336 commit f95330e

File tree

11 files changed

+114
-40
lines changed

11 files changed

+114
-40
lines changed

.github/workflows/building-conda.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-18.04, macos-10.15, windows-2019]
13+
# We have trouble building for Windows - drop for now.
14+
os: [ubuntu-18.04, macos-10.15] # windows-2019
1415
python-version: ['3.7', '3.8', '3.9', '3.10']
15-
torch-version: [1.11.0, 1.12.0]
16-
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116']
16+
torch-version: [1.13.0] # [1.12.0, 1.13.0]
17+
cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117']
1718
exclude:
18-
- torch-version: 1.11.0
19-
cuda-version: 'cu116'
2019
- torch-version: 1.12.0
21-
cuda-version: 'cu115'
20+
cuda-version: 'cu117'
21+
- torch-version: 1.13.0
22+
cuda-version: 'cu102'
23+
- torch-version: 1.13.0
24+
cuda-version: 'cu113'
2225
- os: macos-10.15
2326
cuda-version: 'cu102'
2427
- os: macos-10.15
2528
cuda-version: 'cu113'
26-
- os: macos-10.15
27-
cuda-version: 'cu115'
2829
- os: macos-10.15
2930
cuda-version: 'cu116'
31+
- os: macos-10.15
32+
cuda-version: 'cu117'
3033
- os: windows-2019
3134
cuda-version: 'cu102'
3235
- os: windows-2019 # Complains about CUDA mismatch.

.github/workflows/building.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ jobs:
1212
matrix:
1313
os: [ubuntu-18.04, macos-10.15, windows-2019]
1414
python-version: ['3.7', '3.8', '3.9', '3.10']
15-
torch-version: [1.11.0, 1.12.0]
16-
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116']
15+
torch-version: [1.13.0] # [1.12.0, 1.13.0]
16+
cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117']
1717
exclude:
18-
- torch-version: 1.11.0
19-
cuda-version: 'cu116'
2018
- torch-version: 1.12.0
21-
cuda-version: 'cu115'
19+
cuda-version: 'cu117'
20+
- torch-version: 1.13.0
21+
cuda-version: 'cu102'
22+
- torch-version: 1.13.0
23+
cuda-version: 'cu113'
2224
- os: macos-10.15
2325
cuda-version: 'cu102'
2426
- os: macos-10.15
2527
cuda-version: 'cu113'
26-
- os: macos-10.15
27-
cuda-version: 'cu115'
2828
- os: macos-10.15
2929
cuda-version: 'cu116'
30+
- os: macos-10.15
31+
cuda-version: 'cu117'
3032
- os: windows-2019
3133
cuda-version: 'cu102'
3234
- os: windows-2019 # Complains about CUDA mismatch.
@@ -51,11 +53,18 @@ jobs:
5153
5254
- name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
5355
run: |
54-
pip install numpy typing-extensions dataclasses
55-
pip install --no-index --no-cache-dir torch==${{ matrix.torch-version}} -f https://download.pytorch.org/whl/${{ matrix.cuda-version }}/torch_stable.html
56+
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.cuda-version }}
5657
python -c "import torch; print('PyTorch:', torch.__version__)"
5758
python -c "import torch; print('CUDA:', torch.version.cuda)"
5859
60+
- name: Set version
61+
if: ${{ runner.os != 'macOS' }}
62+
run: |
63+
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_scatter/__init__.py`
64+
sed -i "s/$VERSION/$VERSION+${{ matrix.cuda-version }}/" torch_scatter/__init__.py
65+
shell:
66+
bash
67+
5968
- name: Install main package for CPU
6069
if: ${{ matrix.cuda-version == 'cpu' }}
6170
run: |
@@ -71,6 +80,10 @@ jobs:
7180
shell:
7281
bash
7382

83+
- name: Test installation
84+
run: |
85+
python -c "import torch_scatter; print('torch-scatter:', torch_scatter.__version__)"
86+
7487
- name: Build wheel
7588
run: |
7689
pip install wheel
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.7
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"
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.7.1/local_installers/cuda-repo-${OS}-11-7-local_11.7.1-515.65.01-1_amd64.deb
8+
sudo dpkg -i cuda-repo-${OS}-11-7-local_11.7.1-515.65.01-1_amd64.deb
9+
sudo cp /var/cuda-repo-${OS}-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
10+
11+
sudo apt-get -qq update
12+
sudo apt install cuda-nvcc-11-7 cuda-libraries-dev-11-7
13+
sudo apt clean
14+
15+
rm -f https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-${OS}-11-7-local_11.7.1-515.65.01-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.3
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# TODO We currently use CUDA 11.3 to build CUDA 11.5 Windows wheels
4+
5+
# Install NVIDIA drivers, see:
6+
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
7+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
8+
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
9+
10+
export CUDA_SHORT=11.3
11+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers
12+
export CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe
13+
14+
# Install CUDA:
15+
curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"
16+
echo ""
17+
echo "Installing from ${CUDA_FILE}..."
18+
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"
19+
echo "Done!"
20+
rm -f "${CUDA_FILE}"

.github/workflows/linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
strategy:
3434
matrix:
35-
torch-version: [1.12.0]
35+
torch-version: [1.13.0]
3636

3737
steps:
3838
- uses: actions/checkout@v2
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Install PyTorch ${{ matrix.torch-version }}
4646
run: |
47-
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
47+
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
4848
4949
- name: Install dependencies
5050
run: |

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest, windows-latest]
1818
python-version: [3.7]
19-
torch-version: [1.11.0, 1.12.0]
19+
torch-version: [1.12.0, 1.13.0]
2020

2121
steps:
2222
- uses: actions/checkout@v2
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Install PyTorch ${{ matrix.torch-version }}
2929
run: |
30-
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
30+
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
3131
3232
- name: Install main package
3333
run: |

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,40 +54,40 @@ conda install pytorch-scatter -c pyg
5454

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

57-
#### PyTorch 1.12
57+
#### PyTorch 1.13
5858

59-
To install the binaries for PyTorch 1.12.0, simply run
59+
To install the binaries for PyTorch 1.13.0, simply run
6060

6161
```
62-
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
62+
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.13.0+${CUDA}.html
6363
```
6464

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

67-
| | `cpu` | `cu102` | `cu113` | `cu116` |
68-
|-------------|-------|---------|---------|---------|
69-
| **Linux** |||||
70-
| **Windows** || | ||
71-
| **macOS** || | | |
67+
| | `cpu` | `cu116` | `cu117` |
68+
|-------------|-------|---------|---------|
69+
| **Linux** ||||
70+
| **Windows** ||||
71+
| **macOS** || | |
7272

73-
#### PyTorch 1.11
73+
#### PyTorch 1.12
7474

75-
To install the binaries for PyTorch 1.11.0, simply run
75+
To install the binaries for PyTorch 1.12.0, simply run
7676

7777
```
78-
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
78+
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
7979
```
8080

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

83-
| | `cpu` | `cu102` | `cu113` | `cu115` |
83+
| | `cpu` | `cu102` | `cu113` | `cu116` |
8484
|-------------|-------|---------|---------|---------|
8585
| **Linux** |||||
8686
| **Windows** || |||
8787
| **macOS** || | | |
8888

89-
**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, and PyTorch 1.10.0/1.10.1/1.10.2 (following the same procedure).
90-
For older versions, you might need to explicitly specify the latest supported version number in order to prevent a manual installation from source.
89+
**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).
90+
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.
9191
You can look up the latest supported version number [here](https://data.pyg.org/whl).
9292

9393
### From source

conda/pytorch-scatter/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.12.0 cu113 # python, pytorch and cuda version
2+
./build_conda.sh 3.9 1.13.0 cu116 # python, pytorch and cuda version
33
```

0 commit comments

Comments
 (0)