From fb37bff99a06681b7c016c04e4bb4a648f995694 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Mon, 14 Nov 2022 08:05:03 +0000 Subject: [PATCH 1/3] update --- .github/workflows/building-conda.yml | 19 ++++++------ .github/workflows/building.yml | 31 ++++++++++++++------ .github/workflows/cuda/cu117-Linux-env.sh | 8 ++++++ .github/workflows/cuda/cu117-Linux.sh | 15 ++++++++++ .github/workflows/cuda/cu117-Windows-env.sh | 8 ++++++ .github/workflows/cuda/cu117-Windows.sh | 18 ++++++++++++ .github/workflows/linting.yml | 4 +-- .github/workflows/testing.yml | 4 +-- README.md | 32 ++++++++++----------- conda/pytorch-scatter/README.md | 2 +- conda/pytorch-scatter/build_conda.sh | 11 +++++-- 11 files changed, 112 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/cuda/cu117-Linux-env.sh create mode 100755 .github/workflows/cuda/cu117-Linux.sh create mode 100644 .github/workflows/cuda/cu117-Windows-env.sh create mode 100755 .github/workflows/cuda/cu117-Windows.sh diff --git a/.github/workflows/building-conda.yml b/.github/workflows/building-conda.yml index 70d0bba8..b00df8bb 100644 --- a/.github/workflows/building-conda.yml +++ b/.github/workflows/building-conda.yml @@ -10,23 +10,26 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, macos-10.15, windows-2019] + # 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.11.0, 1.12.0] - cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116'] + torch-version: [1.13.0] # [1.12.0, 1.13.0] + cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117'] exclude: - - torch-version: 1.11.0 - cuda-version: 'cu116' - torch-version: 1.12.0 - cuda-version: 'cu115' + cuda-version: 'cu117' + - torch-version: 1.13.0 + cuda-version: 'cu102' + - 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: 'cu115' - os: macos-10.15 cuda-version: 'cu116' + - os: macos-10.15 + cuda-version: 'cu117' - os: windows-2019 cuda-version: 'cu102' - os: windows-2019 # Complains about CUDA mismatch. diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index e483f754..97b86b57 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -12,21 +12,23 @@ jobs: matrix: os: [ubuntu-18.04, macos-10.15, windows-2019] python-version: ['3.7', '3.8', '3.9', '3.10'] - torch-version: [1.11.0, 1.12.0] - cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116'] + torch-version: [1.13.0] # [1.12.0, 1.13.0] + cuda-version: ['cpu', 'cu102', 'cu113', 'cu116', 'cu117'] exclude: - - torch-version: 1.11.0 - cuda-version: 'cu116' - torch-version: 1.12.0 - cuda-version: 'cu115' + cuda-version: 'cu117' + - torch-version: 1.13.0 + cuda-version: 'cu102' + - 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: 'cu115' - os: macos-10.15 cuda-version: 'cu116' + - os: macos-10.15 + cuda-version: 'cu117' - os: windows-2019 cuda-version: 'cu102' - os: windows-2019 # Complains about CUDA mismatch. @@ -51,11 +53,18 @@ jobs: - name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} run: | - pip install numpy typing-extensions dataclasses - pip install --no-index --no-cache-dir torch==${{ matrix.torch-version}} -f https://download.pytorch.org/whl/${{ matrix.cuda-version }}/torch_stable.html + pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.cuda-version }} python -c "import torch; print('PyTorch:', torch.__version__)" python -c "import torch; print('CUDA:', torch.version.cuda)" + - name: Set version + if: ${{ runner.os != 'macOS' }} + run: | + VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_spline_conv/__init__.py` + sed -i "s/$VERSION/$VERSION+${{ matrix.cuda-version }}/" torch_spline_conv/__init__.py + shell: + bash + - name: Install main package for CPU if: ${{ matrix.cuda-version == 'cpu' }} run: | @@ -71,6 +80,10 @@ jobs: shell: bash + - name: Test installation + run: | + python -c "import torch_scatter; print('torch-scatter:', torch_scatter.__version__)" + - name: Build wheel run: | pip install wheel diff --git a/.github/workflows/cuda/cu117-Linux-env.sh b/.github/workflows/cuda/cu117-Linux-env.sh new file mode 100644 index 00000000..b14f0744 --- /dev/null +++ b/.github/workflows/cuda/cu117-Linux-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/usr/local/cuda-11.7 +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/cu117-Linux.sh b/.github/workflows/cuda/cu117-Linux.sh new file mode 100755 index 00000000..0593f694 --- /dev/null +++ b/.github/workflows/cuda/cu117-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.7.1/local_installers/cuda-repo-${OS}-11-7-local_11.7.1-515.65.01-1_amd64.deb +sudo dpkg -i cuda-repo-${OS}-11-7-local_11.7.1-515.65.01-1_amd64.deb +sudo cp /var/cuda-repo-${OS}-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/ + +sudo apt-get -qq update +sudo apt install cuda-nvcc-11-7 cuda-libraries-dev-11-7 +sudo apt clean + +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 diff --git a/.github/workflows/cuda/cu117-Windows-env.sh b/.github/workflows/cuda/cu117-Windows-env.sh new file mode 100644 index 00000000..e408b526 --- /dev/null +++ b/.github/workflows/cuda/cu117-Windows-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7 +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/cu117-Windows.sh b/.github/workflows/cuda/cu117-Windows.sh new file mode 100755 index 00000000..76cd18cb --- /dev/null +++ b/.github/workflows/cuda/cu117-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.7 +export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers +export CUDA_FILE=cuda_${CUDA_SHORT}.1_516.94_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 0aa5afd8..0ff7a7ae 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: - torch-version: [1.12.0] + torch-version: [1.13.0] steps: - uses: actions/checkout@v2 @@ -44,7 +44,7 @@ jobs: - name: Install PyTorch ${{ matrix.torch-version }} run: | - pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu - name: Install dependencies run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bd1f6e72..a5dfdcf3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] python-version: [3.7] - torch-version: [1.11.0, 1.12.0] + torch-version: [1.12.0, 1.13.0] steps: - uses: actions/checkout@v2 @@ -27,7 +27,7 @@ jobs: - name: Install PyTorch ${{ matrix.torch-version }} run: | - pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu - name: Install main package run: | diff --git a/README.md b/README.md index 5fa66173..09f179c3 100644 --- a/README.md +++ b/README.md @@ -54,40 +54,40 @@ 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.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** | ✅ | | | -#### PyTorch 1.11 +#### PyTorch 1.12 -To install the binaries for PyTorch 1.11.0, simply run +To install the binaries for PyTorch 1.12.0, simply run ``` -pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html +pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation. +where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation. -| | `cpu` | `cu102` | `cu113` | `cu115` | +| | `cpu` | `cu102` | `cu113` | `cu116` | |-------------|-------|---------|---------|---------| | **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, and PyTorch 1.10.0/1.10.1/1.10.2 (following the same procedure). -For older versions, you might need to explicitly specify the latest supported version number in order to prevent a manual installation from source. +**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). +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). ### From source diff --git a/conda/pytorch-scatter/README.md b/conda/pytorch-scatter/README.md index 8bb44116..6476246b 100644 --- a/conda/pytorch-scatter/README.md +++ b/conda/pytorch-scatter/README.md @@ -1,3 +1,3 @@ ``` -./build_conda.sh 3.9 1.12.0 cu113 # python, pytorch and cuda version +./build_conda.sh 3.9 1.13.0 cu116 # python, pytorch and cuda version ``` diff --git a/conda/pytorch-scatter/build_conda.sh b/conda/pytorch-scatter/build_conda.sh index 7dcdcab2..14355ea4 100755 --- a/conda/pytorch-scatter/build_conda.sh +++ b/conda/pytorch-scatter/build_conda.sh @@ -10,8 +10,15 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]" else case $CUDA_VERSION in + cu117) + export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.7.*" + ;; cu116) - export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.6.*" + if [ "${TORCH_VERSION}" = "1.12.0" ]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.6.*" + else + export CONDA_CUDATOOLKIT_CONSTRAINT="pytorch-cuda==11.6.*" + fi ;; cu115) export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.5.*" @@ -39,7 +46,7 @@ echo "PyTorch $TORCH_VERSION+$CUDA_VERSION" echo "- $CONDA_PYTORCH_CONSTRAINT" echo "- $CONDA_CUDATOOLKIT_CONSTRAINT" -if [ "${CUDA_VERSION}" = "cu116" ]; then +if [ "${TORCH_VERSION}" = "1.12.0" ] && [ "${CUDA_VERSION}" = "cu116" ]; then conda build . -c pytorch -c default -c nvidia -c conda-forge --output-folder "$HOME/conda-bld" else conda build . -c pytorch -c default -c nvidia --output-folder "$HOME/conda-bld" From ecc2e82dd1b97d157cff78ad7eb91934f8c0f912 Mon Sep 17 00:00:00 2001 From: rusty1s Date: Mon, 14 Nov 2022 08:21:00 +0000 Subject: [PATCH 2/3] update --- .github/workflows/building.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index 97b86b57..ff60d80e 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -60,8 +60,8 @@ jobs: - name: Set version if: ${{ runner.os != 'macOS' }} run: | - VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_spline_conv/__init__.py` - sed -i "s/$VERSION/$VERSION+${{ matrix.cuda-version }}/" torch_spline_conv/__init__.py + VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_scatter/__init__.py` + sed -i "s/$VERSION/$VERSION+${{ matrix.cuda-version }}/" torch_scatter/__init__.py shell: bash From 50a6c76b8f4df42cd37c3219f61e19a3896d1f1e Mon Sep 17 00:00:00 2001 From: rusty1s Date: Mon, 14 Nov 2022 09:19:34 +0000 Subject: [PATCH 3/3] update --- .github/workflows/cuda/cu117-Windows-env.sh | 2 +- .github/workflows/cuda/cu117-Windows.sh | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cuda/cu117-Windows-env.sh b/.github/workflows/cuda/cu117-Windows-env.sh index e408b526..3a662fb8 100644 --- a/.github/workflows/cuda/cu117-Windows-env.sh +++ b/.github/workflows/cuda/cu117-Windows-env.sh @@ -1,6 +1,6 @@ #!/bin/bash -CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7 +CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3 PATH=${CUDA_HOME}/bin:$PATH PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH diff --git a/.github/workflows/cuda/cu117-Windows.sh b/.github/workflows/cuda/cu117-Windows.sh index 76cd18cb..db2559c4 100755 --- a/.github/workflows/cuda/cu117-Windows.sh +++ b/.github/workflows/cuda/cu117-Windows.sh @@ -1,13 +1,15 @@ #!/bin/bash +# TODO We currently use CUDA 11.3 to build CUDA 11.5 Windows wheels + # 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.7 -export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers -export CUDA_FILE=cuda_${CUDA_SHORT}.1_516.94_windows.exe +export CUDA_SHORT=11.3 +export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers +export CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe # Install CUDA: curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"