Skip to content

Commit

Permalink
Build pyg_lib==0.1.0 wheels (part 2) (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s authored Nov 28, 2022
1 parent 15019e6 commit 25648b0
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 39 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
22 changes: 22 additions & 0 deletions .github/workflows/cuda/Windows-env.sh
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions .github/workflows/cuda/Windows.sh
Original file line number Diff line number Diff line change
@@ -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}"
1 change: 1 addition & 0 deletions .github/workflows/cuda/macOS-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/bash
16 changes: 14 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down

0 comments on commit 25648b0

Please sign in to comment.