Skip to content

Added PyTorch 2.2 support #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/building-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ jobs:
matrix:
# We have trouble building for Windows - drop for now.
os: [ubuntu-20.04, macos-11] # windows-2019
python-version: ['3.8', '3.9', '3.10', '3.11']
torch-version: [2.0.0, 2.1.0]
cuda-version: ['cpu', 'cu117', 'cu118', 'cu121']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [2.2.0] # [2.1.0, 2.2.0]
cuda-version: ['cpu', 'cu118', 'cu121']
exclude:
- torch-version: 2.0.0
cuda-version: 'cu121'
- python-version: '3.12' # Python 3.12 not yet supported in `conda-build`.
- torch-version: 2.1.0
cuda-version: 'cu117'
- os: macos-11
cuda-version: 'cu117'
python-version: '3.12'
- os: macos-11
cuda-version: 'cu118'
- os: macos-11
cuda-version: 'cu121'
# Fails with:
# * note: 'value' has been explicitly marked unavailable here
# * error: 'value' is unavailable: introduced in macOS 10.13
- torch-version: 2.2.0
os: macos-11

steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
python-version: ['3.8', '3.9', '3.10', '3.11']
torch-version: [2.0.0, 2.1.0]
cuda-version: ['cpu', 'cu117', 'cu118', 'cu121']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [2.2.0] # [2.1.0, 2.2.0]
cuda-version: ['cpu', 'cu118', 'cu121']
exclude:
- torch-version: 2.0.0
cuda-version: 'cu121'
- torch-version: 2.1.0
cuda-version: 'cu117'
- os: macos-11
cuda-version: 'cu117'
python-version: '3.12'
- os: macos-11
cuda-version: 'cu118'
- os: macos-11
cuda-version: 'cu121'
# Fails with:
# * note: 'value' has been explicitly marked unavailable here
# * error: 'value' is unavailable: introduced in macOS 10.13
- os: macos-11
python-version: '3.11'
- os: macos-11
python-version: '3.12'

steps:
- uses: actions/checkout@v2
Expand All @@ -39,7 +42,11 @@ jobs:
- name: Upgrade pip
run: |
pip install --upgrade setuptools
pip install scipy==1.10.1 # Python 3.8 support

- name: Install scipy
if: ${{ matrix.python-version == '3.8' }}
run: |
pip install scipy==1.10.1

- name: Free Disk Space (Ubuntu)
if: ${{ runner.os == 'Linux' }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-2019]
python-version: [3.8]
torch-version: [2.0.0, 2.1.0]
torch-version: [2.1.0, 2.2.0]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -46,9 +46,13 @@ jobs:
run: |
bash .github/workflows/metis-${{ runner.os }}.sh

- name: Install scipy
if: ${{ matrix.python-version == '3.8' }}
run: |
pip install scipy==1.10.1

- name: Install main package
run: |
pip install scipy==1.10.1 # Python 3.8 support
python setup.py develop
env:
WITH_METIS: 1
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ conda install pytorch-sparse -c pyg

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

#### PyTorch 2.1
#### PyTorch 2.2

To install the binaries for PyTorch 2.1.0, simply run
To install the binaries for PyTorch 2.2.0, simply run

```
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.1.0+${CUDA}.html
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.2.0+${CUDA}.html
```

where `${CUDA}` should be replaced by either `cpu`, `cu118`, or `cu121` depending on your PyTorch installation.
Expand All @@ -59,23 +59,24 @@ where `${CUDA}` should be replaced by either `cpu`, `cu118`, or `cu121` dependin
| **Windows** | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | |

#### PyTorch 2.0

To install the binaries for PyTorch 2.0.0, simply run
#### PyTorch 2.1

To install the binaries for PyTorch 2.1.0, simply run

```
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.0.0+${CUDA}.html
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.1.0+${CUDA}.html
```

where `${CUDA}` should be replaced by either `cpu`, `cu117`, or `cu118` depending on your PyTorch installation.
where `${CUDA}` should be replaced by either `cpu`, `cu118`, or `cu121` depending on your PyTorch installation.

| | `cpu` | `cu117` | `cu118` |
| | `cpu` | `cu118` | `cu121` |
|-------------|-------|---------|---------|
| **Linux** | ✅ | ✅ | ✅ |
| **Windows** | ✅ | ✅ | ✅ |
| **macOS** | ✅ | | |

**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 and PyTorch 1.13.0/1.13.1 (following the same procedure).
**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, and PyTorch 2.0.0 (following the same procedure).
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.
You can look up the latest supported version number [here](https://data.pyg.org/whl).

Expand Down
2 changes: 1 addition & 1 deletion conda/pytorch-sparse/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```
./build_conda.sh 3.9 2.1.0 cu118 # python, pytorch and cuda version
./build_conda.sh 3.11 2.2.0 cu118 # python, pytorch and cuda version
```
2 changes: 2 additions & 0 deletions conda/pytorch-sparse/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ echo "- $CONDA_CUDATOOLKIT_CONSTRAINT"

if [ "${TORCH_VERSION}" = "1.12.0" ] && [ "${CUDA_VERSION}" = "cu116" ]; then
conda build . -c pytorch -c pyg -c default -c nvidia -c conda-forge --output-folder "$HOME/conda-bld"
elif [ "${CUDA_VERSION}" = "cpu" ]; then
conda build . -c pytorch -c pyg -c default --output-folder "$HOME/conda-bld"
else
conda build . -c pytorch -c pyg -c default -c nvidia --output-folder "$HOME/conda-bld"
fi
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3 :: Only

[aliases]
Expand Down