Skip to content

Building Wheels

Building Wheels #107

Workflow file for this run

name: Building Wheels
on: [workflow_dispatch]
jobs:
wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022, ubuntu-22.04-arm]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
torch-version: [2.8.0]
cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128', 'cu129']
exclude:
- torch-version: 2.6.0
cuda-version: 'cu128'
- torch-version: 2.7.0
cuda-version: 'cu124'
- torch-version: 2.8.0
cuda-version: 'cu124'
- torch-version: 2.8.0
cuda-version: 'cu118'
- os: macos-14
cuda-version: 'cu118'
- os: macos-14
cuda-version: 'cu124'
- os: macos-14
cuda-version: 'cu126'
- os: macos-14
cuda-version: 'cu128'
- os: macos-14
cuda-version: 'cu129'
- os: ubuntu-22.04-arm
cuda-version: 'cu118'
- os: ubuntu-22.04-arm
cuda-version: 'cu124'
- os: ubuntu-22.04-arm
cuda-version: 'cu126'
- os: ubuntu-22.04-arm
cuda-version: 'cu128'
- os: ubuntu-22.04-arm
cuda-version: 'cu129'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade setuptools
pip install wheel
- name: Free Disk Space (Ubuntu)
if: ${{ runner.os == 'Linux' }}
uses: jlumbroso/free-disk-space@main
- name: Install CUDA ${{ matrix.cuda-version }}
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
bash .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}.sh
- name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
run: |
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: Patch PyTorch static constexpr on Windows
if: ${{ runner.os == 'Windows' }}
run: |
Torch_DIR=`python -c 'import os; import torch; print(os.path.dirname(torch.__file__))'`
sed -i '31,38c\
TORCH_API void lazy_init_num_threads();' ${Torch_DIR}/include/ATen/Parallel.h
shell: bash
- name: Set version
if: ${{ runner.os != 'macOS' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_scatter/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
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/" torch_scatter/__init__.py
shell:
bash
- name: Build wheel for CPU
if: ${{ matrix.cuda-version == 'cpu' }}
run: |
FORCE_ONLY_CPU=1 python setup.py bdist_wheel --dist-dir=dist
shell:
bash
- name: Build wheel for GPU
if: ${{ matrix.cuda-version != 'cpu' }}
run: |
source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
FORCE_CUDA=1 python setup.py bdist_wheel --dist-dir=dist
shell:
bash
- 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