Skip to content

Commit cdfbc7e

Browse files
authored
Support PyTorch 2.8 (#404)
* update * update * update * Update .github/workflows/cuda/cu129-Windows.sh * update * update * update * update * update * update * update * Revert "update" This reverts commit b245edb. * update
1 parent 91feaa5 commit cdfbc7e

File tree

11 files changed

+116
-26
lines changed

11 files changed

+116
-26
lines changed

.github/workflows/building.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Building Wheels
22

33
on: [workflow_dispatch]
44

5+
defaults:
6+
run:
7+
shell: bash
8+
59
jobs:
610

711
wheel:
@@ -10,15 +14,23 @@ jobs:
1014
strategy:
1115
fail-fast: false
1216
matrix:
13-
os: [ubuntu-22.04, macos-14, windows-2019, ubuntu-22.04-arm]
17+
os: [ubuntu-22.04, macos-14, windows-2022, ubuntu-22.04-arm]
1418
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
15-
torch-version: [2.7.0] # [2.6.0]
16-
cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128']
19+
torch-version: [2.8.0]
20+
cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128', 'cu129']
1721
exclude:
1822
- torch-version: 2.6.0
1923
cuda-version: 'cu128'
24+
- torch-version: 2.6.0
25+
cuda-version: 'cu129'
2026
- torch-version: 2.7.0
2127
cuda-version: 'cu124'
28+
- torch-version: 2.7.0
29+
cuda-version: 'cu129'
30+
- torch-version: 2.8.0
31+
cuda-version: 'cu118'
32+
- torch-version: 2.8.0
33+
cuda-version: 'cu124'
2234
- os: macos-14
2335
cuda-version: 'cu118'
2436
- os: macos-14
@@ -27,6 +39,8 @@ jobs:
2739
cuda-version: 'cu126'
2840
- os: macos-14
2941
cuda-version: 'cu128'
42+
- os: macos-14
43+
cuda-version: 'cu129'
3044
- os: ubuntu-22.04-arm
3145
cuda-version: 'cu118'
3246
- os: ubuntu-22.04-arm
@@ -35,14 +49,16 @@ jobs:
3549
cuda-version: 'cu126'
3650
- os: ubuntu-22.04-arm
3751
cuda-version: 'cu128'
52+
- os: ubuntu-22.04-arm
53+
cuda-version: 'cu129'
3854

3955
steps:
40-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v4
4157
with:
4258
submodules: 'recursive'
4359

4460
- name: Set up Python ${{ matrix.python-version }}
45-
uses: actions/setup-python@v2
61+
uses: actions/setup-python@v5
4662
with:
4763
python-version: ${{ matrix.python-version }}
4864

@@ -52,7 +68,7 @@ jobs:
5268
pip install wheel
5369
5470
- name: Install scipy
55-
if: ${{ (matrix.python-version == '3.8') || (matrix.python-version == '3.9') }}
71+
if: ${{ matrix.python-version == '3.9' }}
5672
run: |
5773
pip install scipy==1.10.1
5874
@@ -80,8 +96,6 @@ jobs:
8096
echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION"
8197
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" setup.py
8298
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" torch_sparse/__init__.py
83-
shell:
84-
bash
8599
86100
- name: Install torch-scatter
87101
run: |
@@ -91,26 +105,30 @@ jobs:
91105
if: ${{ runner.os != 'Windows' }}
92106
run: |
93107
bash .github/workflows/metis.sh
108+
echo WITH_METIS=1 >> $GITHUB_ENV
94109
95110
- name: Install METIS on Windows
96111
if: ${{ runner.os == 'Windows' }}
97112
run: |
98-
bash .github/workflows/metis-${{ runner.os }}.sh
113+
# bash .github/workflows/metis-${{ runner.os }}.sh
114+
echo WITH_METIS=0 >> $GITHUB_ENV
99115
100116
- name: Build wheel for CPU
101117
if: ${{ matrix.cuda-version == 'cpu' }}
102118
run: |
103-
FORCE_ONLY_CPU=1 WITH_METIS=1 python setup.py bdist_wheel --dist-dir=dist
104-
shell:
105-
bash
119+
python setup.py bdist_wheel --dist-dir=dist
120+
env:
121+
FORCE_ONLY_CPU: 1
122+
WITH_METIS: ${{ env.WITH_METIS }}
106123

107124
- name: Build wheel for GPU
108125
if: ${{ matrix.cuda-version != 'cpu' }}
109126
run: |
110127
source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
111-
FORCE_CUDA=1 WITH_METIS=1 python setup.py bdist_wheel --dist-dir=dist
112-
shell:
113-
bash
128+
python setup.py bdist_wheel --dist-dir=dist
129+
env:
130+
FORCE_CUDA: 1
131+
WITH_METIS: ${{ env.WITH_METIS }}
114132

115133
- name: Configure AWS
116134
uses: aws-actions/configure-aws-credentials@v1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
CUDA_HOME=/usr/local/cuda-12.9
4+
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
5+
PATH=${CUDA_HOME}/bin:${PATH}
6+
7+
export FORCE_CUDA=1
8+
export TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
OS=ubuntu2204
4+
5+
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
6+
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600
7+
8+
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
9+
10+
sudo dpkg -i cuda-repo-${OS}-12-9-local_12.9.1-575.57.08-1_amd64.deb
11+
sudo cp /var/cuda-repo-${OS}-12-9-local/cuda-*-keyring.gpg /usr/share/keyrings/
12+
13+
sudo apt-get -qq update
14+
sudo apt install cuda-nvcc-12-9 cuda-libraries-dev-12-9
15+
sudo apt clean
16+
17+
rm -f *.deb
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.9
4+
PATH=${CUDA_HOME}/bin:$PATH
5+
PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH
6+
7+
export FORCE_CUDA=1
8+
export TORCH_CUDA_ARCH_LIST="6.0+PTX"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Install NVIDIA drivers, see:
4+
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
5+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
6+
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
7+
8+
export CUDA_SHORT=12.9
9+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers
10+
export CUDA_FILE=cuda_${CUDA_SHORT}.1_576.57_windows.exe
11+
12+
# Install CUDA:
13+
curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"
14+
echo ""
15+
echo "Installing from ${CUDA_FILE}..."
16+
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"
17+
echo "Done!"
18+
rm -f "${CUDA_FILE}"

.github/workflows/linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616

1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.8
20+
python-version: 3.9
2121

2222
- name: Install dependencies
2323
run: |

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/stale@v4.0.0
14+
- uses: actions/stale@v9
1515
with:
1616
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?'
1717
stale-issue-label: 'stale'

.github/workflows/testing.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- master
77
pull_request:
88

9+
defaults:
10+
run:
11+
shell: bash
12+
913
jobs:
1014

1115
pytest:
@@ -14,17 +18,17 @@ jobs:
1418
strategy:
1519
fail-fast: false
1620
matrix:
17-
os: [ubuntu-latest, windows-2019]
21+
os: [ubuntu-latest, windows-2022]
1822
python-version: [3.9]
19-
torch-version: [2.6.0, 2.7.0]
23+
torch-version: [2.7.0, 2.8.0]
2024

2125
steps:
22-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2327
with:
2428
submodules: 'recursive'
2529

2630
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v5
2832
with:
2933
python-version: ${{ matrix.python-version }}
3034

@@ -40,11 +44,13 @@ jobs:
4044
if: ${{ runner.os != 'Windows' }}
4145
run: |
4246
bash .github/workflows/metis.sh
47+
echo WITH_METIS=1 >> $GITHUB_ENV
4348
4449
- name: Install METIS on Windows
4550
if: ${{ runner.os == 'Windows' }}
4651
run: |
4752
bash .github/workflows/metis-${{ runner.os }}.sh
53+
echo WITH_METIS=0 >> $GITHUB_ENV
4854
4955
- name: Install scipy
5056
if: ${{ matrix.python-version == '3.9' }}
@@ -55,7 +61,7 @@ jobs:
5561
run: |
5662
python setup.py develop
5763
env:
58-
WITH_METIS: 1
64+
WITH_METIS: ${{ env.WITH_METIS }}
5965

6066
- name: Run test-suite
6167
run: |

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ Note that only `value` comes with autograd support, as `index` is discrete and t
3434

3535
We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://data.pyg.org/whl).
3636

37+
#### PyTorch 2.8
38+
39+
To install the binaries for PyTorch 2.8.0, simply run
40+
41+
```
42+
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.8.0+${CUDA}.html
43+
```
44+
45+
where `${CUDA}` should be replaced by either `cpu`, `cu126`, `cu128`, or `cu129` depending on your PyTorch installation.
46+
47+
| | `cpu` | `cu126` | `cu128` | `cu129` |
48+
|-------------|-------|---------|---------|---------|
49+
| **Linux** |||||
50+
| **Windows** |||||
51+
| **macOS** || | | |
52+
3753
#### PyTorch 2.7
3854

3955
To install the binaries for PyTorch 2.7.0, simply run

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ classifiers =
66
Development Status :: 5 - Production/Stable
77
License :: OSI Approved :: MIT License
88
Programming Language :: Python
9-
Programming Language :: Python :: 3.8
109
Programming Language :: Python :: 3.9
1110
Programming Language :: Python :: 3.10
1211
Programming Language :: Python :: 3.11

0 commit comments

Comments
 (0)