diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml index a8b615bb..4947af79 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/building.yml @@ -2,6 +2,10 @@ name: Building Wheels on: [workflow_dispatch] +defaults: + run: + shell: bash + jobs: wheel: @@ -10,15 +14,23 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-14, windows-2019, ubuntu-22.04-arm] + 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.7.0] # [2.6.0] - cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128'] + 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.6.0 + cuda-version: 'cu129' - torch-version: 2.7.0 cuda-version: 'cu124' + - torch-version: 2.7.0 + cuda-version: 'cu129' + - torch-version: 2.8.0 + cuda-version: 'cu118' + - torch-version: 2.8.0 + cuda-version: 'cu124' - os: macos-14 cuda-version: 'cu118' - os: macos-14 @@ -27,6 +39,8 @@ jobs: 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 @@ -35,14 +49,16 @@ jobs: cuda-version: 'cu126' - os: ubuntu-22.04-arm cuda-version: 'cu128' + - os: ubuntu-22.04-arm + cuda-version: 'cu129' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -52,7 +68,7 @@ jobs: pip install wheel - name: Install scipy - if: ${{ (matrix.python-version == '3.8') || (matrix.python-version == '3.9') }} + if: ${{ matrix.python-version == '3.9' }} run: | pip install scipy==1.10.1 @@ -80,8 +96,6 @@ jobs: 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_sparse/__init__.py - shell: - bash - name: Install torch-scatter run: | @@ -91,26 +105,30 @@ jobs: if: ${{ runner.os != 'Windows' }} run: | bash .github/workflows/metis.sh + echo WITH_METIS=1 >> $GITHUB_ENV - name: Install METIS on Windows if: ${{ runner.os == 'Windows' }} run: | - bash .github/workflows/metis-${{ runner.os }}.sh + # bash .github/workflows/metis-${{ runner.os }}.sh + echo WITH_METIS=0 >> $GITHUB_ENV - name: Build wheel for CPU if: ${{ matrix.cuda-version == 'cpu' }} run: | - FORCE_ONLY_CPU=1 WITH_METIS=1 python setup.py bdist_wheel --dist-dir=dist - shell: - bash + python setup.py bdist_wheel --dist-dir=dist + env: + FORCE_ONLY_CPU: 1 + WITH_METIS: ${{ env.WITH_METIS }} - 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 WITH_METIS=1 python setup.py bdist_wheel --dist-dir=dist - shell: - bash + python setup.py bdist_wheel --dist-dir=dist + env: + FORCE_CUDA: 1 + WITH_METIS: ${{ env.WITH_METIS }} - name: Configure AWS uses: aws-actions/configure-aws-credentials@v1 diff --git a/.github/workflows/cuda/cu129-Linux-env.sh b/.github/workflows/cuda/cu129-Linux-env.sh new file mode 100644 index 00000000..e3961b28 --- /dev/null +++ b/.github/workflows/cuda/cu129-Linux-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/usr/local/cuda-12.9 +LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} +PATH=${CUDA_HOME}/bin:${PATH} + +export FORCE_CUDA=1 +export TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX" diff --git a/.github/workflows/cuda/cu129-Linux.sh b/.github/workflows/cuda/cu129-Linux.sh new file mode 100755 index 00000000..19955145 --- /dev/null +++ b/.github/workflows/cuda/cu129-Linux.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +OS=ubuntu2204 + +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/12.9.1/local_installers/cuda-repo-${OS}-12-9-local_12.9.1-575.57.08-1_amd64.deb + +sudo dpkg -i cuda-repo-${OS}-12-9-local_12.9.1-575.57.08-1_amd64.deb +sudo cp /var/cuda-repo-${OS}-12-9-local/cuda-*-keyring.gpg /usr/share/keyrings/ + +sudo apt-get -qq update +sudo apt install cuda-nvcc-12-9 cuda-libraries-dev-12-9 +sudo apt clean + +rm -f *.deb diff --git a/.github/workflows/cuda/cu129-Windows-env.sh b/.github/workflows/cuda/cu129-Windows-env.sh new file mode 100644 index 00000000..dec7c275 --- /dev/null +++ b/.github/workflows/cuda/cu129-Windows-env.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.9 +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/cu129-Windows.sh b/.github/workflows/cuda/cu129-Windows.sh new file mode 100755 index 00000000..24bfeb4d --- /dev/null +++ b/.github/workflows/cuda/cu129-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=12.9 +export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers +export CUDA_FILE=cuda_${CUDA_SHORT}.1_576.57_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 78734f7c..14199b06 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d4e85024..215aba40 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4.0.0 + - uses: actions/stale@v9 with: stale-issue-message: 'This issue had no activity for **6 months**. It will be closed in **2 weeks** unless there is some new activity. Is this issue already resolved?' stale-issue-label: 'stale' diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4d1d6670..da3950f2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -6,6 +6,10 @@ on: - master pull_request: +defaults: + run: + shell: bash + jobs: pytest: @@ -14,17 +18,17 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-2019] + os: [ubuntu-latest, windows-2022] python-version: [3.9] - torch-version: [2.6.0, 2.7.0] + torch-version: [2.7.0, 2.8.0] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -40,11 +44,13 @@ jobs: if: ${{ runner.os != 'Windows' }} run: | bash .github/workflows/metis.sh + echo WITH_METIS=1 >> $GITHUB_ENV - name: Install METIS on Windows if: ${{ runner.os == 'Windows' }} run: | bash .github/workflows/metis-${{ runner.os }}.sh + echo WITH_METIS=0 >> $GITHUB_ENV - name: Install scipy if: ${{ matrix.python-version == '3.9' }} @@ -55,7 +61,7 @@ jobs: run: | python setup.py develop env: - WITH_METIS: 1 + WITH_METIS: ${{ env.WITH_METIS }} - name: Run test-suite run: | diff --git a/README.md b/README.md index d231dbaa..299b32ab 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,22 @@ Note that only `value` comes with autograd support, as `index` is discrete and t We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl). +#### PyTorch 2.8 + +To install the binaries for PyTorch 2.8.0, simply run + +``` +pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.8.0+${CUDA}.html +``` + +where `${CUDA}` should be replaced by either `cpu`, `cu126`, `cu128`, or `cu129` depending on your PyTorch installation. + +| | `cpu` | `cu126` | `cu128` | `cu129` | +|-------------|-------|---------|---------|---------| +| **Linux** | ✅ | ✅ | ✅ | ✅ | +| **Windows** | ✅ | ✅ | ✅ | ✅ | +| **macOS** | ✅ | | | | + #### PyTorch 2.7 To install the binaries for PyTorch 2.7.0, simply run diff --git a/setup.cfg b/setup.cfg index da2c9a2b..3838565d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,6 @@ classifiers = Development Status :: 5 - Production/Stable License :: OSI Approved :: MIT License Programming Language :: Python - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 diff --git a/setup.py b/setup.py index a54f3e1a..16b47e37 100644 --- a/setup.py +++ b/setup.py @@ -159,7 +159,7 @@ def get_extensions(): 'sparse-matrices', 'autograd', ], - python_requires='>=3.8', + python_requires='>=3.9', install_requires=install_requires, extras_require={ 'test': test_requires,