diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index cdbebdb78..573599e0f 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, macos-10.15, windows-2019] + 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, 1.13.0] cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116', 'cu117'] @@ -55,16 +55,27 @@ jobs: torch-version: ${{ matrix.torch-version }} cuda-version: ${{ matrix.cuda-version }} - - name: Set version + - name: Set version on non-macOS + if: ${{ runner.os != 'macOS' }} run: | VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py` TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"` - CUDA_VERSION=if [ ${{ os.runner }} != "macOS" ]; then `echo ${{ matrix.cuda-version }}`; else ""; fi + CUDA_VERSION=`echo ${{ matrix.cuda-version }}` echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION" sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" setup.py sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" pyg_lib/__init__.py shell: bash + - name: Set version on macOS + if: ${{ runner.os == 'macOS' }} + run: | + VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py` + TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"` + echo "New version name: $VERSION+$TORCH_VERSION" + sed -i "" "s/$VERSION/$VERSION+$TORCH_VERSION/" setup.py + sed -i "" "s/$VERSION/$VERSION+$TORCH_VERSION/" pyg_lib/__init__.py + shell: bash + - name: Build wheel run: | source ./.github/workflows/cuda/${{ runner.os }}-env.sh ${{ matrix.cuda-version }} @@ -80,13 +91,13 @@ jobs: python -c "import pyg_lib; print('CUDA:', pyg_lib.cuda_version())" cd .. - # - name: Configure AWS - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: us-west-1 + - name: Configure AWS + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-1 - # - name: Upload wheel - # run: | - # aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers + - name: Upload wheel + run: | + aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers diff --git a/.github/workflows/cuda/Windows-env.sh b/.github/workflows/cuda/Windows-env.sh new file mode 100755 index 000000000..922e1afc9 --- /dev/null +++ b/.github/workflows/cuda/Windows-env.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +case ${1} in + cu117) + export FORCE_CUDA=1 + export PATH=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7/bin:${PATH} + ;; + cu116) + export FORCE_CUDA=1 + export PATH=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3/bin:${PATH} + ;; + cu115) + export FORCE_CUDA=1 + export PATH=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3/bin:${PATH} + ;; + cu113) + export FORCE_CUDA=1 + export PATH=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3/bin:${PATH} + ;; + *) + ;; +esac diff --git a/.github/workflows/cuda/Windows.sh b/.github/workflows/cuda/Windows.sh new file mode 100644 index 000000000..4b24148d9 --- /dev/null +++ b/.github/workflows/cuda/Windows.sh @@ -0,0 +1,40 @@ +#!/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" + +case ${1} in + cu117) + CUDA_SHORT=11.7 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.1_516.94_windows.exe + ;; + cu116) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + cu115) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + cu113) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + *) + echo "Unrecognized CUDA_VERSION=${1}" + exit 1 + ;; +esac + +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/cuda/macOS-env.sh b/.github/workflows/cuda/macOS-env.sh new file mode 100755 index 000000000..a9bf588e2 --- /dev/null +++ b/.github/workflows/cuda/macOS-env.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d5c340a31..997bf32e3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -47,17 +47,29 @@ jobs: torch-version: ${{ matrix.torch-version }} cuda-version: ${{ matrix.cuda-version }} - - name: Set version + - name: Set version on non-macOS + if: ${{ runner.os != 'macOS' }} run: | VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py` TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"` - CUDA_VERSION=if [ ${{ os.runner }} != "macOS" ]; then `echo ${{ matrix.cuda-version }}`; else ""; fi + CUDA_VERSION=`echo ${{ matrix.cuda-version }}` TODAY=`date +'%Y%m%d'` echo "New version name: $VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION" sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" setup.py sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" pyg_lib/__init__.py shell: bash + - name: Set version on macOS + if: ${{ runner.os == 'macOS' }} + run: | + VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py` + TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"` + TODAY=`date +'%Y%m%d'` + echo "New version name: $VERSION.dev$TODAY+$TORCH_VERSION" + sed -i "" "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION/" setup.py + sed -i "" "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION/" pyg_lib/__init__.py + shell: bash + - name: Build wheel run: | source ./.github/workflows/cuda/${{ runner.os }}-env.sh ${{ matrix.cuda-version }} diff --git a/README.md b/README.md index a8ca3c312..4da9b391f 100644 --- a/README.md +++ b/README.md @@ -15,47 +15,48 @@ ## Installation -### Form nightly - -Nightly wheels are provided for Linux from Python 3.7 till 3.10: +We provide pre-built Python wheels for all major OS/PyTorch/CUDA combinations from Python 3.7 till 3.10, see [here](https://data.pyg.org/whl). +Note that currently, Windows wheels are not supported (we are working on fixing this as soon as possible). -#### PyTorch 1.13 +To install the wheels, simply run ``` -pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-1.13.0+${CUDA}.html +pip install pyg-lib -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu116`, or `cu117` depending on your PyTorch installation (`torch.version.cuda`). +where -| | `cpu` | `cu116` | `cu117` | -|-------------|-------|---------|---------| -| **Linux** | ✅ | ✅ | ✅ | +* `${TORCH}` should be replaced by either `1.11.0`, `1.12.0` or `1.13.0` +* `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, `cu115`, `cu116` or `cu117` +The following combinations are supported: -#### PyTorch 1.12 +| PyTorch 1.13 | `cpu` | `cu102` | `cu113` | `cu115` | `cu116` | `cu117` | +|--------------|-------|---------|---------|---------|---------|---------| +| **Linux** | ✅ | | | | ✅ | ✅ | +| **Windows** | | | | | | | +| **macOS** | ✅ | | | | | | -``` -pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-1.12.0+${CUDA}.html -``` +| PyTorch 1.12 | `cpu` | `cu102` | `cu113` | `cu115` | `cu116` | `cu117` | +|--------------|-------|---------|---------|---------|---------|---------| +| **Linux** | ✅ | ✅ | ✅ | | ✅ | | +| **Windows** | | | | | | | +| **macOS** | ✅ | | | | | | -where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation (`torch.version.cuda`). +| PyTorch 1.11 | `cpu` | `cu102` | `cu113` | `cu115` | `cu116` | `cu117` | +|--------------|-------|---------|---------|---------|---------|---------| +| **Linux** | ✅ | ✅ | ✅ | ✅ | | | +| **Windows** | | | | | | | +| **macOS** | ✅ | | | | | | -| | `cpu` | `cu102` | `cu113` | `cu116` | -|-------------|-------|---------|---------|---------| -| **Linux** | ✅ | ✅ | ✅ | ✅ | +### Form nightly -#### PyTorch 1.11 +Nightly wheels are provided for Linux from Python 3.7 till 3.10: ``` -pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-1.11.0+${CUDA}.html +pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-${TORCH}+${CUDA}.html ``` -where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation (`torch.version.cuda`). - -| | `cpu` | `cu102` | `cu113` | `cu115` | -|-------------|-------|---------|---------|---------| -| **Linux** | ✅ | ✅ | ✅ | ✅ | - ### From master ```