Skip to content

Commit 908779b

Browse files
committed
version up + PyTorch 1.11 support
1 parent 576e0bb commit 908779b

File tree

16 files changed

+202
-86
lines changed

16 files changed

+202
-86
lines changed

.github/workflows/building-conda.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,29 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-18.04, macos-10.15, windows-latest]
14-
python-version: [3.6, 3.7, 3.8, 3.9]
15-
torch-version: [1.10.0]
16-
cuda-version: ['cpu', 'cu102', 'cu111', 'cu113']
13+
os: [ubuntu-18.04, macos-10.15, windows-2019]
14+
python-version: ['3.7', '3.8', '3.9', '3.10']
15+
torch-version: [1.10.0, 1.11.0]
16+
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
1717
exclude:
18-
- torch-version: 1.9.0
19-
cuda-version: 'cu113'
2018
- torch-version: 1.10.0
21-
cuda-version: 'cu111'
22-
- os: macos-10.15
19+
cuda-version: 'cu115'
20+
- torch-version: 1.10.0
21+
python-version: '3.10'
22+
- os: windows-2019
23+
torch-version: 1.11.0
2324
cuda-version: 'cu102'
2425
- os: macos-10.15
25-
cuda-version: 'cu111'
26+
cuda-version: 'cu102'
2627
- os: macos-10.15
2728
cuda-version: 'cu113'
29+
- os: macos-10.15
30+
cuda-version: 'cu115'
31+
# There is a weird `glibc=2.27` bug going on for this combination:
32+
- os: ubuntu-18.04
33+
python-version: '3.10'
34+
- os: ubuntu-18.04
35+
cuda-version: 'cu115'
2836

2937
steps:
3038
- uses: actions/checkout@v2
@@ -34,7 +42,7 @@ jobs:
3442
python-version: ${{ matrix.python-version }}
3543

3644
- name: Free up disk space
37-
if: ${{ runner.os == 'Linux' && matrix.cuda-version == 'cu111' }}
45+
if: ${{ runner.os == 'Linux' }}
3846
run: |
3947
sudo rm -rf /usr/share/dotnet
4048

.github/workflows/building.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,28 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-18.04, macos-10.15, windows-latest]
14-
python-version: [3.6, 3.7, 3.8, 3.9]
15-
torch-version: [1.10.0]
16-
cuda-version: ['cpu', 'cu102', 'cu111', 'cu113']
13+
os: [ubuntu-18.04, macos-10.15, windows-2019]
14+
python-version: ['3.7', '3.8', '3.9', '3.10']
15+
torch-version: [1.10.0, 1.11.0]
16+
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
1717
exclude:
18-
- torch-version: 1.9.0
19-
cuda-version: 'cu113'
2018
- torch-version: 1.10.0
21-
cuda-version: 'cu111'
22-
- os: macos-10.15
19+
cuda-version: 'cu115'
20+
- torch-version: 1.10.0
21+
python-version: '3.10'
22+
- os: windows-2019
23+
torch-version: 1.11.0
2324
cuda-version: 'cu102'
2425
- os: macos-10.15
25-
cuda-version: 'cu111'
26+
cuda-version: 'cu102'
2627
- os: macos-10.15
2728
cuda-version: 'cu113'
29+
- os: macos-10.15
30+
cuda-version: 'cu115'
31+
# There is a weird bug going on for this combination:
32+
- os: windows-2019
33+
python-version: '3.7'
34+
cuda-version: 'cu115'
2835

2936
steps:
3037
- uses: actions/checkout@v2
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-11.5
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="3.5;5.0+PTX;6.0;7.0;7.5;8.0;8.6"

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
OS=ubuntu1804
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/11.5.2/local_installers/cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-1_amd64.deb
8+
sudo dpkg -i cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-1_amd64.deb
9+
sudo apt-key add /var/cuda-repo-${OS}-11-5-local/7fa2af80.pub
10+
11+
sudo apt-get -qq update
12+
sudo apt install cuda-nvcc-11-5 cuda-libraries-dev-11-5
13+
sudo apt clean
14+
15+
rm -f https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda-repo-${OS}-11-5-local_11.5.2-495.29.05-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/v11.3
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# TODO We currently use CUDA 11.3 to build CUDA 11.5 Windows wheels
4+
5+
# Install NVIDIA drivers, see:
6+
# https://github.com/pytorch/vision/blob/master/packaging/windows/internal/cuda_install.bat#L99-L102
7+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip"
8+
7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32"
9+
10+
export CUDA_SHORT=11.3
11+
export CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers
12+
export CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe
13+
14+
# Install CUDA:
15+
curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}"
16+
echo ""
17+
echo "Installing from ${CUDA_FILE}..."
18+
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"
19+
echo "Done!"
20+
rm -f "${CUDA_FILE}"

.github/workflows/linting.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
name: Linting
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
48

59
jobs:
610

711
flake8:
8-
runs-on: ${{ matrix.os }}
9-
10-
strategy:
11-
matrix:
12-
os: [ubuntu-latest]
13-
python-version: [3.6]
12+
runs-on: ubuntu-latest
1413

1514
steps:
1615
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
16+
17+
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: ${{ matrix.python-version }}
20+
python-version: 3.9
2121

2222
- name: Install dependencies
2323
run: |
@@ -26,3 +26,30 @@ jobs:
2626
- name: Run linting
2727
run: |
2828
flake8 .
29+
30+
pyroma:
31+
runs-on: ubuntu-latest
32+
33+
strategy:
34+
matrix:
35+
torch-version: [1.11.0]
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: 3.9
44+
45+
- name: Install PyTorch ${{ matrix.torch-version }}
46+
run: |
47+
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
48+
49+
- name: Install dependencies
50+
run: |
51+
pip install pyroma
52+
53+
- name: Check package metadata
54+
run: |
55+
pyroma --min=9 .

.github/workflows/testing.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
name: Testing
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
48

59
jobs:
610

711
pytest:
812
runs-on: ${{ matrix.os }}
913

1014
strategy:
15+
fail-fast: false
1116
matrix:
1217
os: [ubuntu-latest, windows-latest]
13-
python-version: [3.6]
14-
torch-version: [1.9.0, 1.10.0]
18+
python-version: [3.7]
19+
torch-version: [1.10.0, 1.11.0]
1520

1621
steps:
1722
- uses: actions/checkout@v2
@@ -30,16 +35,10 @@ jobs:
3035
3136
- name: Run test-suite
3237
run: |
33-
python setup.py test
38+
pytest --cov --cov-report=xml
3439
35-
- name: Generate coverage report
36-
if: success()
37-
run: |
38-
pip install coverage
39-
coverage xml
40-
41-
- name: Upload coverage report to codecov
40+
- name: Upload coverage
4241
uses: codecov/codecov-action@v1
4342
if: success()
4443
with:
45-
file: coverage.xml
44+
fail_ci_if_error: false

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22
project(torchcluster)
33
set(CMAKE_CXX_STANDARD 14)
4-
set(TORCHCLUSTER_VERSION 1.5.9)
4+
set(TORCHCLUSTER_VERSION 1.6.0)
55

66
option(WITH_CUDA "Enable CUDA support" OFF)
77

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,41 @@ conda install pytorch-cluster -c pyg
4343

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

46-
#### PyTorch 1.10.0
46+
#### PyTorch 1.11
4747

48-
To install the binaries for PyTorch 1.10.0, simply run
48+
To install the binaries for PyTorch 1.11.0, simply run
4949

5050
```
51-
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
51+
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
5252
```
5353

54-
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu113` depending on your PyTorch installation.
54+
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation.
5555

56-
| | `cpu` | `cu102` | `cu113` |
57-
|-------------|-------|---------|---------|
58-
| **Linux** ||||
59-
| **Windows** ||||
60-
| **macOS** || | |
56+
| | `cpu` | `cu102` | `cu113` | `cu115` |
57+
|-------------|-------|---------|---------|---------|
58+
| **Linux** |||||
59+
| **Windows** || | ||
60+
| **macOS** || | | |
6161

62-
#### PyTorch 1.9.0/1.9.1
62+
#### PyTorch 1.10
6363

64-
To install the binaries for PyTorch 1.9.0 and 1.9.1, simply run
64+
To install the binaries for PyTorch 1.10.0, PyTorch 1.10.1 and PyTorch 1.10.2, simply run
6565

6666
```
67-
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.9.0+${CUDA}.html
67+
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
6868
```
6969

70-
where `${CUDA}` should be replaced by either `cpu`, `cu102`, or `cu111` depending on your PyTorch installation.
70+
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu111`, or `cu113` depending on your PyTorch installation.
7171

72-
| | `cpu` | `cu102` | `cu111` |
73-
|-------------|-------|---------|---------|
74-
| **Linux** ||||
75-
| **Windows** ||||
76-
| **macOS** || | |
72+
| | `cpu` | `cu102` | `cu111` | `cu113` |
73+
|-------------|-------|---------|---------|---------|
74+
| **Linux** |||||
75+
| **Windows** |||||
76+
| **macOS** || | | |
7777

78-
**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 and PyTorch 1.8.0/1.8.1 (following the same procedure).
78+
**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 and PyTorch 1.9.0 (following the same procedure).
79+
For older versions, you might need to explicitly specify the latest supported version number in order to prevent a manual installation from source.
80+
You can look up the latest supported version number [here](https://data.pyg.org/whl).
7981

8082
### From source
8183

@@ -274,7 +276,7 @@ tensor([[0, 1, 2, 4],
274276
## Running tests
275277

276278
```
277-
python setup.py test
279+
pytest
278280
```
279281

280282
## C++ API

conda/pytorch-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```
2-
./build_conda.sh 3.9 1.9.0 cu111 # python, pytorch and cuda version
2+
./build_conda.sh 3.9 1.11.0 cu113 # python, pytorch and cuda version
33
```

conda/pytorch-cluster/build_conda.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [ "${CUDA_VERSION}" = "cpu" ]; then
1010
export CONDA_CUDATOOLKIT_CONSTRAINT="cpuonly # [not osx]"
1111
else
1212
case $CUDA_VERSION in
13+
cu115)
14+
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.5.*"
15+
;;
1316
cu113)
1417
export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit==11.3.*"
1518
;;
@@ -33,4 +36,4 @@ echo "PyTorch $TORCH_VERSION+$CUDA_VERSION"
3336
echo "- $CONDA_PYTORCH_CONSTRAINT"
3437
echo "- $CONDA_CUDATOOLKIT_CONSTRAINT"
3538

36-
conda build . -c nvidia -c pytorch -c default -c conda-forge --output-folder "$HOME/conda-bld"
39+
conda build . -c pytorch -c default -c nvidia --output-folder "$HOME/conda-bld"

conda/pytorch-cluster/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: pytorch-cluster
3-
version: 1.5.9
3+
version: 1.6.0
44

55
source:
66
path: ../..

setup.cfg

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
[metadata]
2-
description-file = README.md
2+
long_description=file: README.md
3+
long_description_content_type=text/markdown
4+
5+
classifiers =
6+
Development Status :: 5 - Production/Stable
7+
License :: OSI Approved :: MIT License
8+
Programming Language :: Python
9+
Programming Language :: Python :: 3.7
10+
Programming Language :: Python :: 3.8
11+
Programming Language :: Python :: 3.9
12+
Programming Language :: Python :: 3.10
13+
Programming Language :: Python :: 3 :: Only
314

415
[aliases]
516
test = pytest
617

718
[tool:pytest]
8-
addopts = --cov
19+
addopts = --capture=no

0 commit comments

Comments
 (0)