Skip to content

Commit 2a62830

Browse files
committed
update to torch 1.5 [ci-deploy]
1 parent 14c7e1c commit 2a62830

File tree

6 files changed

+85
-52
lines changed

6 files changed

+85
-52
lines changed

.travis.yml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,50 @@ os:
88
env:
99
global:
1010
- CUDA_HOME=/usr/local/cuda
11+
1112
jobs:
12-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cpu
13-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
14-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100
15-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101
16-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cpu
17-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
18-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
19-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
20-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
21-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
22-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
23-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
13+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cpu
14+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
15+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
16+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
17+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cpu
18+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
19+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
20+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
21+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cpu
22+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
23+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
24+
- TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
2425

2526
jobs:
26-
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs.
27+
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2 jobs.
2728
- os: osx
28-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
29+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
2930
- os: osx
30-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100
31+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
3132
- os: osx
32-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101
33+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
3334
- os: osx
34-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
35+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
3536
- os: osx
36-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
37+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
3738
- os: osx
38-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
39+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
3940
- os: osx
40-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
41+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
4142
- os: osx
42-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
43+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
4344
- os: osx
44-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
45-
- os: windows
46-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
47-
- os: windows
48-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100
49-
- os: windows
50-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
51-
- os: windows
52-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
45+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
5346
- os: windows
54-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
47+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
5548
- os: windows
56-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
49+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
5750
- os: windows
58-
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101
51+
env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
5952

6053
install:
54+
- source script/gcc.sh
6155
- source script/cuda.sh
6256
- source script/conda.sh
6357
- conda create --yes -n test python="${PYTHON_VERSION}"

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,26 @@ All included operations work on varying data types and are implemented both for
3030
### Binaries
3131

3232
We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/index.html).
33-
To install from binaries, simply run
33+
34+
#### PyTorch 1.5.0
35+
36+
To install the binaries for PyTorch 1.5.0, simply run
37+
38+
```
39+
pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html
40+
```
41+
42+
where `${CUDA}` should be replaced by either `cpu`, `cu92`, `cu101` or `cu102` depending on your PyTorch installation.
43+
44+
| | `cpu` | `cu92` | `cu101` | `cu102` |
45+
|-------------|-------|--------|---------|---------|
46+
| **Linux** |||||
47+
| **Windows** |||||
48+
| **macOS** || | | |
49+
50+
#### PyTorch 1.4.0
51+
52+
To install the binaries for PyTorch 1.4.0, simply run
3453

3554
```
3655
pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.4.0.html

script/cuda.sh

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu92" ]; then
1212
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
1313
fi
1414

15-
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu100" ]; then
16-
export CUDA_SHORT=10.0
17-
export CUDA=10.0.130-1
18-
export UBUNTU_VERSION=ubuntu1804
19-
export CUBLAS=cuda-cublas-dev-10-0
20-
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
21-
fi
22-
2315
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then
2416
export IDX=cu101
2517
export CUDA_SHORT=10.1
@@ -29,6 +21,15 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then
2921
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
3022
fi
3123

24+
25+
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu102" ]; then
26+
export CUDA_SHORT=10.2
27+
export CUDA=10.2.89-1
28+
export UBUNTU_VERSION=ubuntu1804
29+
export CUBLAS=libcublas-dev
30+
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
31+
fi
32+
3233
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cpu" ]; then
3334
export TOOLKIT=cpuonly
3435
fi
@@ -40,20 +41,20 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu92" ]; then
4041
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
4142
fi
4243

43-
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu100" ]; then
44-
export CUDA_SHORT=10.0
45-
export CUDA_URL=https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
46-
export CUDA_FILE=cuda_${CUDA_SHORT}.130_411.31_win10
47-
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
48-
fi
49-
5044
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu101" ]; then
5145
export CUDA_SHORT=10.1
5246
export CUDA_URL=https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
5347
export CUDA_FILE=cuda_${CUDA_SHORT}.105_418.96_win10.exe
5448
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
5549
fi
5650

51+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu102" ]; then
52+
export CUDA_SHORT=10.2
53+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
54+
export CUDA_FILE=cuda_${CUDA_SHORT}.89_441.22_win10.exe
55+
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
56+
fi
57+
5758
if [ "${TRAVIS_OS_NAME}" = "osx" ] && [ "$IDX" = "cpu" ]; then
5859
export TOOLKIT=""
5960
fi
@@ -80,6 +81,12 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${IDX}" != "cpu" ]; then
8081
fi
8182

8283
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
84+
# Install NVIDIA drivers, see:
85+
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
86+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
87+
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
88+
89+
# Install CUDA
8390
wget -nv "${CUDA_URL}/${CUDA_FILE}"
8491
PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT}\" -Wait -NoNewWindow"
8592
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_SHORT}

script/gcc.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
4+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
5+
sudo apt update
6+
sudo apt install gcc-7 g++-7 --yes
7+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
8+
--slave /usr/bin/g++ g++ /usr/bin/g++-7
9+
sudo update-alternatives --config gcc
10+
gcc --version
11+
g++ --version
12+
fi
13+

script/rename_wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import shutil
66

77
idx = sys.argv[1]
8-
assert idx in ['cpu', 'cu92', 'cu100', 'cu101']
8+
assert idx in ['cpu', 'cu92', 'cu101', 'cu102']
99

1010
dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist')
1111
wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True)

script/torch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
44
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
5-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
6-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h
5+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/api/module.h
6+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/runtime/argument_spec.h
77
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
88
fi
99

0 commit comments

Comments
 (0)