Commit 42da9ac2 authored by rusty1s's avatar rusty1s
Browse files

update to torch 1.5 [ci-deploy]

parent afbfdc97
...@@ -5,59 +5,49 @@ os: ...@@ -5,59 +5,49 @@ os:
- osx - osx
- windows - windows
env:
global:
- CUDA_HOME=/usr/local/cuda
jobs: jobs:
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cpu - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cpu
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cpu - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cpu
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cpu
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101 - TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
jobs: jobs:
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs. exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2 jobs.
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu101
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu102
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu101
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu102
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu101
- os: osx - os: osx
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu102
- os: windows - os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.8 IDX=cu92
- os: windows - os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.7 IDX=cu92
- os: windows - os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92 env: TORCH_VERSION=1.5.0 PYTHON_VERSION=3.6 IDX=cu92
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
- os: windows
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101
install: install:
- source script/gcc.sh
- source script/cuda.sh - source script/cuda.sh
- source script/conda.sh - source script/conda.sh
- source script/metis.sh - source script/metis.sh
...@@ -86,7 +76,8 @@ deploy: ...@@ -86,7 +76,8 @@ deploy:
upload_dir: whl/torch-${TORCH_VERSION} upload_dir: whl/torch-${TORCH_VERSION}
acl: public_read acl: public_read
on: on:
repo: rusty1s/pytorch_sparse all_branches: true
tags: true repo: rusty1s/pytorch_scatter
condition: $TRAVIS_TAG != "" || $TRAVIS_COMMIT_MESSAGE =~ ci-deploy
notifications: notifications:
email: false email: false
...@@ -30,6 +30,25 @@ Note that only `value` comes with autograd support, as `index` is discrete and t ...@@ -30,6 +30,25 @@ Note that only `value` comes with autograd support, as `index` is discrete and t
### Binaries ### Binaries
We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://pytorch-geometric.com/whl). We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://pytorch-geometric.com/whl).
#### PyTorch 1.5.0
To install the binaries for PyTorch 1.5.0, simply run
```
pip install torch-scatter==latest+${CUDA} torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html
```
where `${CUDA}` should be replaced by either `cpu`, `cu92`, `cu101` or `cu102` depending on your PyTorch installation.
| | `cpu` | `cu92` | `cu101` | `cu102` |
|-------------|-------|--------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ❌ | ✅ | ✅ |
| **macOS** | ✅ | | | |
#### PyTorch 1.4.0
To install the binaries for PyTorch 1.4.0, simply run To install the binaries for PyTorch 1.4.0, simply run
``` ```
......
...@@ -12,14 +12,6 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu92" ]; then ...@@ -12,14 +12,6 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu92" ]; then
export TOOLKIT="cudatoolkit=${CUDA_SHORT}" export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi fi
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu100" ]; then
export CUDA_SHORT=10.0
export CUDA=10.0.130-1
export UBUNTU_VERSION=ubuntu1804
export CUBLAS=cuda-cublas-dev-10-0
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then
export IDX=cu101 export IDX=cu101
export CUDA_SHORT=10.1 export CUDA_SHORT=10.1
...@@ -29,6 +21,15 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then ...@@ -29,6 +21,15 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu101" ]; then
export TOOLKIT="cudatoolkit=${CUDA_SHORT}" export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi fi
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$IDX" = "cu102" ]; then
export CUDA_SHORT=10.2
export CUDA=10.2.89-1
export UBUNTU_VERSION=ubuntu1804
export CUBLAS=libcublas-dev
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cpu" ]; then if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cpu" ]; then
export TOOLKIT=cpuonly export TOOLKIT=cpuonly
fi fi
...@@ -40,13 +41,6 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu92" ]; then ...@@ -40,13 +41,6 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu92" ]; then
export TOOLKIT="cudatoolkit=${CUDA_SHORT}" export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu100" ]; then
export CUDA_SHORT=10.0
export CUDA_URL=https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
export CUDA_FILE=cuda_${CUDA_SHORT}.130_411.31_win10
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu101" ]; then if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu101" ]; then
export CUDA_SHORT=10.1 export CUDA_SHORT=10.1
export CUDA_URL=https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers export CUDA_URL=https://developer.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
...@@ -54,6 +48,13 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu101" ]; then ...@@ -54,6 +48,13 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu101" ]; then
export TOOLKIT="cudatoolkit=${CUDA_SHORT}" export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "$IDX" = "cu102" ]; then
export CUDA_SHORT=10.2
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}/Prod/local_installers
export CUDA_FILE=cuda_${CUDA_SHORT}.89_441.22_win10.exe
export TOOLKIT="cudatoolkit=${CUDA_SHORT}"
fi
if [ "${TRAVIS_OS_NAME}" = "osx" ] && [ "$IDX" = "cpu" ]; then if [ "${TRAVIS_OS_NAME}" = "osx" ] && [ "$IDX" = "cpu" ]; then
export TOOLKIT="" export TOOLKIT=""
fi fi
...@@ -80,6 +81,12 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${IDX}" != "cpu" ]; then ...@@ -80,6 +81,12 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${IDX}" != "cpu" ]; then
fi fi
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
# 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"
# Install CUDA
wget -nv "${CUDA_URL}/${CUDA_FILE}" wget -nv "${CUDA_URL}/${CUDA_FILE}"
PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT}\" -Wait -NoNewWindow" PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT}\" -Wait -NoNewWindow"
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_SHORT} CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_SHORT}
......
#!/bin/bash
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
sudo apt update
sudo apt install gcc-7 g++-7 --yes
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
gcc --version
g++ --version
fi
...@@ -5,7 +5,7 @@ import glob ...@@ -5,7 +5,7 @@ import glob
import shutil import shutil
idx = sys.argv[1] idx = sys.argv[1]
assert idx in ['cpu', 'cu92', 'cu100', 'cu101'] assert idx in ['cpu', 'cu92', 'cu101', 'cu102']
dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist') dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist')
wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True) wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958 # Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/api/module.h
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h 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
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 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
fi fi
...@@ -4,23 +4,13 @@ import os.path as osp ...@@ -4,23 +4,13 @@ import os.path as osp
import torch import torch
__version__ = '0.6.2' __version__ = '0.6.2'
expected_torch_version = (1, 4)
try: for library in [
for library in [ '_version', '_convert', '_diag', '_spmm', '_spspmm', '_metis', '_rw',
'_version', '_convert', '_diag', '_spmm', '_spspmm', '_metis', '_saint', '_padding'
'_rw', '_saint', '_padding' ]:
]: torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( library, [osp.dirname(__file__)]).origin)
library, [osp.dirname(__file__)]).origin)
except OSError as e:
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
t_major, t_minor = expected_torch_version
if major != t_major or (major == t_major and minor != t_minor):
raise RuntimeError(
f'Expected PyTorch version {t_major}.{t_minor} but found '
f'version {major}.{minor}.')
raise OSError(e)
if torch.version.cuda is not None: # pragma: no cover if torch.version.cuda is not None: # pragma: no cover
cuda_version = torch.ops.torch_sparse.cuda_version() cuda_version = torch.ops.torch_sparse.cuda_version()
......
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