Skip to content

Commit 8204a56

Browse files
authored
PyTorch 2.7 support (#253)
1 parent 150dd5c commit 8204a56

File tree

10 files changed

+84
-29
lines changed

10 files changed

+84
-29
lines changed

.github/workflows/building.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,31 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-20.04, macos-14, windows-2019, ubuntu-22.04-arm]
13+
os: [ubuntu-22.04, macos-14, windows-2019, ubuntu-22.04-arm]
1414
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
15-
torch-version: [2.6.0] # [2.5.0]
16-
cuda-version: ['cpu', 'cu118', 'cu121', 'cu124', 'cu126']
15+
torch-version: [2.7.0] # [2.6.0]
16+
cuda-version: ['cpu', 'cu118', 'cu124', 'cu126', 'cu128']
1717
exclude:
18-
- torch-version: 2.5.0
19-
python-version: '3.13'
20-
- torch-version: 2.5.0
21-
cuda-version: 'cu126'
2218
- torch-version: 2.6.0
23-
cuda-version: 'cu121'
19+
cuda-version: 'cu128'
20+
- torch-version: 2.7.0
21+
cuda-version: 'cu124'
2422
- os: macos-14
2523
cuda-version: 'cu118'
26-
- os: macos-14
27-
cuda-version: 'cu121'
2824
- os: macos-14
2925
cuda-version: 'cu124'
3026
- os: macos-14
3127
cuda-version: 'cu126'
28+
- os: macos-14
29+
cuda-version: 'cu128'
30+
- os: ubuntu-22.04-arm
31+
cuda-version: 'cu118'
32+
- os: ubuntu-22.04-arm
33+
cuda-version: 'cu124'
34+
- os: ubuntu-22.04-arm
35+
cuda-version: 'cu126'
36+
- os: ubuntu-22.04-arm
37+
cuda-version: 'cu128'
3238

3339
steps:
3440
- uses: actions/checkout@v2
@@ -76,15 +82,15 @@ jobs:
7682
- name: Install main package for CPU
7783
if: ${{ matrix.cuda-version == 'cpu' }}
7884
run: |
79-
FORCE_ONLY_CPU=1 python setup.py develop
85+
FORCE_ONLY_CPU=1 pip install -e . --no-build-isolation
8086
shell:
8187
bash
8288

8389
- name: Install main package for GPU
8490
if: ${{ matrix.cuda-version != 'cpu' }}
8591
run: |
8692
source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
87-
python setup.py develop
93+
pip install -e . --no-build-isolation
8894
shell:
8995
bash
9096

.github/workflows/cuda/cu118-Linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OS=ubuntu2004
3+
OS=ubuntu2204
44

55
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
66
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600

.github/workflows/cuda/cu124-Linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OS=ubuntu2004
3+
OS=ubuntu2204
44

55
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
66
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600

.github/workflows/cuda/cu126-Linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OS=ubuntu2004
3+
OS=ubuntu2204
44

55
wget -nv https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin
66
sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600
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.8
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="5.0+PTX;6.0;7.0;7.5;8.0;8.6;9.0"

.github/workflows/cuda/cu128-Linux.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
wget -nv https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda-repo-${OS}-12-8-local_12.8.0-570.86.10-1_amd64.deb
8+
9+
sudo dpkg -i cuda-repo-${OS}-12-8-local_12.8.0-570.86.10-1_amd64.deb
10+
sudo cp /var/cuda-repo-${OS}-12-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
11+
12+
sudo apt-get -qq update
13+
sudo apt install cuda-nvcc-12-8 cuda-libraries-dev-12-8
14+
sudo apt clean
15+
16+
rm -f https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda-repo-${OS}-12-8-local_12.8.0-570.86.10-1_amd64.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.8
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.8
9+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers
10+
export CUDA_FILE=cuda_${CUDA_SHORT}.0_571.96_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/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [ubuntu-latest, windows-latest, ubuntu-22.04-arm]
17+
os: [ubuntu-latest, windows-latest]
1818
python-version: [3.9]
19-
torch-version: [2.5.0, 2.6.0]
19+
torch-version: [2.6.0, 2.7.0]
2020

2121
steps:
2222
- uses: actions/checkout@v2

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,39 @@ All included operations work on varying data types and are implemented both for
3434

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

37-
#### PyTorch 2.6
37+
#### PyTorch 2.7
3838

39-
To install the binaries for PyTorch 2.6.0, simply run
39+
To install the binaries for PyTorch 2.7.0, simply run
4040

4141
```
42-
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.6.0+${CUDA}.html
42+
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.7.0+${CUDA}.html
4343
```
4444

45-
where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu124`, or `cu126` depending on your PyTorch installation.
45+
where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu126`, or `cu128` depending on your PyTorch installation.
4646

47-
| | `cpu` | `cu118` | `cu124` | `cu126` |
47+
| | `cpu` | `cu118` | `cu126` | `cu128` |
4848
|-------------|-------|---------|---------|---------|
4949
| **Linux** |||||
5050
| **Windows** |||||
5151
| **macOS** || | | |
5252

53+
#### PyTorch 2.6
5354

54-
#### PyTorch 2.5
55-
56-
To install the binaries for PyTorch 2.5.0/2.5.1, simply run
55+
To install the binaries for PyTorch 2.6.0, simply run
5756

5857
```
59-
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.5.0+${CUDA}.html
58+
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.6.0+${CUDA}.html
6059
```
6160

62-
where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu121`, or `cu124` depending on your PyTorch installation.
61+
where `${CUDA}` should be replaced by either `cpu`, `cu118`, `cu124`, or `cu126` depending on your PyTorch installation.
6362

64-
| | `cpu` | `cu118` | `cu121` | `cu124` |
63+
| | `cpu` | `cu118` | `cu124` | `cu126` |
6564
|-------------|-------|---------|---------|---------|
6665
| **Linux** |||||
6766
| **Windows** |||||
6867
| **macOS** || | | |
6968

70-
**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, PyTorch 1.11.0, PyTorch 1.12.0/1.12.1, PyTorch 1.13.0/1.13.1, PyTorch 2.0.0/2.0.1, PyTorch 2.1.0/2.1.1/2.1.2, PyTorch 2.2.0/2.2.1/2.2.2, PyTorch 2.3.0/2.3.1, and PyTorch 2.4.0/2.4.1 (following the same procedure).
69+
**Note:** Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0, PyTorch 1.6.0, PyTorch 1.7.0/1.7.1, PyTorch 1.8.0/1.8.1, PyTorch 1.9.0, PyTorch 1.10.0/1.10.1/1.10.2, PyTorch 1.11.0, PyTorch 1.12.0/1.12.1, PyTorch 1.13.0/1.13.1, PyTorch 2.0.0/2.0.1, PyTorch 2.1.0/2.1.1/2.1.2, PyTorch 2.2.0/2.2.1/2.2.2, PyTorch 2.3.0/2.3.1, PyTorch 2.4.0/2.4.1, and PyTorch 2.5.0/2.5.1 (following the same procedure).
7170
For older versions, you need to explicitly specify the latest supported version number or install via `pip install --no-index` in order to prevent a manual installation from source.
7271
You can look up the latest supported version number [here](https://data.pyg.org/whl).
7372

0 commit comments

Comments
 (0)