Skip to content

Commit

Permalink
PyTorch 1.12 support (pyg-team#4975)
Browse files Browse the repository at this point in the history
* Fix norm in examples and dmon_pool

* changelog

* update

* PyTorch 1.12 support

* changelog

* updaet

* reset

* update

* update

Co-authored-by: Guohao Li <lighaime@gmail.com>
  • Loading branch information
rusty1s and Guohao Li authored Jul 13, 2022
1 parent da7be5d commit 6522693
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 72 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/building_pyg_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,25 @@ jobs:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0, 1.11.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
torch-version: [1.11.0, 1.12.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116']
exclude:
- torch-version: 1.10.0
- torch-version: 1.11.0
cuda-version: 'cu116'
- torch-version: 1.12.0
cuda-version: 'cu115'
- torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird `glibc=2.27` bug going on for this combination:
- os: ubuntu-18.04
python-version: '3.10'
- os: ubuntu-18.04
cuda-version: 'cu115'
- os: macos-10.15
cuda-version: 'cu116'
- os: windows-2019
cuda-version: 'cu102'
- os: windows-2019 # Complains about CUDA mismatch.
python-version: '3.7'

steps:
- uses: actions/checkout@v3
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/building_rusty1s_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,25 @@ jobs:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.10.0, 1.11.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115']
torch-version: [1.11.0, 1.12.0]
cuda-version: ['cpu', 'cu102', 'cu113', 'cu115', 'cu116']
exclude:
- torch-version: 1.10.0
- torch-version: 1.11.0
cuda-version: 'cu116'
- torch-version: 1.12.0
cuda-version: 'cu115'
- torch-version: 1.10.0
python-version: '3.10'
- os: windows-2019
torch-version: 1.11.0
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu102'
- os: macos-10.15
cuda-version: 'cu113'
- os: macos-10.15
cuda-version: 'cu115'
# There is a weird `glibc=2.27` bug going on for this combination:
- os: ubuntu-18.04
python-version: '3.10'
- os: ubuntu-18.04
cuda-version: 'cu115'
- os: macos-10.15
cuda-version: 'cu116'
- os: windows-2019
cuda-version: 'cu102'
- os: windows-2019 # Complains about CUDA mismatch.
python-version: '3.7'

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
torch-version: [1.11.0]
torch-version: [1.12.0]

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
torch-version: [1.11.0]
torch-version: [1.12.0]
include:
- torch-version: 1.11.0
torchvision-version: 0.12.0
- torch-version: 1.12.0
torchvision-version: 0.13.0

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/full_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9']
torch-version: [1.10.0]
python-version: ['3.7', '3.8', '3.9', '3.10']
torch-version: [1.12.0]
include:
- torch-version: 1.10.0
torchvision-version: 0.11.1
- torch-version: 1.12.0
torchvision-version: 0.13.0

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
torch-version: [1.11.0]
torch-version: [1.12.0]

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
torch-version: [1.10.0, 1.11.0]
torch-version: [1.11.0, 1.12.0]
include:
- torch-version: 1.10.0
torchvision-version: 0.11.1
- torch-version: 1.11.0
torchvision-version: 0.12.0
- torch-version: 1.12.0
torchvision-version: 0.13.0

steps:
- uses: actions/checkout@v3
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install internal dependencies
run: |
pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
pip install torch-sparse==0.6.13 -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [2.0.5] - 2022-MM-DD
### Added
- Added PyTorch 1.12 support ([#4975](https://github.com/pyg-team/pytorch_geometric/pull/4975))
- Added `unbatch_edge_index` functionality for splitting an `edge_index` tensor according to a `batch` vector ([#4903](https://github.com/pyg-team/pytorch_geometric/pull/4903))
- Added node-wise normalization mode in `LayerNorm` ([#4944](https://github.com/pyg-team/pytorch_geometric/pull/4944))
- Added support for `normalization_resolver` ([#4926](https://github.com/pyg-team/pytorch_geometric/pull/4926), [#4951](https://github.com/pyg-team/pytorch_geometric/pull/4951), [#4958](https://github.com/pyg-team/pytorch_geometric/pull/4958), [#4959](https://github.com/pyg-team/pytorch_geometric/pull/4959))
Expand Down
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,25 @@ Given that you have [PyTorch >= 1.8.0 installed](https://pytorch.org/get-started
conda install pyg -c pyg
```

**Note:** Conda packages are not published for PyTorch 1.12 yet.

### Pip Wheels

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

#### PyTorch 1.11
#### PyTorch 1.12

To install the binaries for PyTorch 1.11.0, simply run
To install the binaries for PyTorch 1.12.0, simply run

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

where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation (`torch.version.cuda`).
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu116` depending on your PyTorch installation.

| | `cpu` | `cu102` | `cu113` | `cu115` |
| | `cpu` | `cu102` | `cu113` | `cu116` |
|-------------|-------|---------|---------|---------|
| **Linux** |||||
| **Windows** || |||
Expand All @@ -382,36 +384,36 @@ where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115`
For additional but optional functionality, run

```
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.12.0+${CUDA}.html
```

#### PyTorch 1.10
#### PyTorch 1.11

To install the binaries for PyTorch 1.10.0, PyTorch 1.10.1 and 1.10.2, simply run
To install the binaries for PyTorch 1.11.0, simply run

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

where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu111` or `cu113` depending on your PyTorch installation (`torch.version.cuda`).
where `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, or `cu115` depending on your PyTorch installation (`torch.version.cuda`).

| | `cpu` | `cu102` | `cu111` | `cu113` |
| | `cpu` | `cu102` | `cu113` | `cu115` |
|-------------|-------|---------|---------|---------|
| **Linux** |||||
| **Windows** || |||
| **Windows** || |||
| **macOS** || | | |

For additional but optional functionality, run

```
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.11.0+${CUDA}.html
```

**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).
**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, and PyTorch 1.10.0/1.10.1/1.10.2 (following the same procedure).
For older versions, you might need to explicitly specify the latest supported version number 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
22 changes: 12 additions & 10 deletions docs/source/notes/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ Given that you have `PyTorch >= 1.8.0 installed <https://pytorch.org/get-started
conda install pyg -c pyg
**Note:** Conda packages are not published for PyTorch 1.12 yet.

Installation via Pip Wheels
---------------------------

We have outsourced a lot of functionality of PyG to other packages, which needs to be installed in advance.
These packages come with their own CPU and GPU kernel implementations based on the `PyTorch C++/CUDA extension interface <https://github.com/pytorch/extension-cpp/>`_.
We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinations, see `here <https://data.pyg.org/whl>`__:

#. Ensure that at least PyTorch 1.10.0 is installed:
#. Ensure that at least PyTorch 1.11.0 is installed:

.. code-block:: none
python -c "import torch; print(torch.__version__)"
>>> 1.11.0
>>> 1.12.0
#. Find the CUDA version PyTorch was installed with:

Expand All @@ -52,21 +54,21 @@ We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinati
pip install torch-sparse -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
pip install torch-geometric
where :obj:`${CUDA}` and :obj:`${TORCH}` should be replaced by the specific CUDA version (:obj:`cpu`, :obj:`cu102`, :obj:`cu113`, :obj:`cu115`) and PyTorch version (:obj:`1.10.0`, :obj:`1.11.0`), respectively.
For example, for PyTorch 1.11.* and CUDA 11.3, type:
where :obj:`${CUDA}` and :obj:`${TORCH}` should be replaced by the specific CUDA version (:obj:`cpu`, :obj:`cu102`, :obj:`cu113`, :obj:`cu115`) and PyTorch version (:obj:`1.11.0`, :obj:`1.12.0`), respectively.
For example, for PyTorch 1.12.* and CUDA 11.6, type:

.. code-block:: none
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cu116.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.12.0+cu116.html
pip install torch-geometric
For PyTorch 1.10.* and CUDA 10.2, type:
For PyTorch 1.11.* and CUDA 11.3, type:

.. code-block:: none
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cu102.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu102.html
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-geometric
#. Install additional packages *(optional)*:
Expand All @@ -80,7 +82,7 @@ We provide pip wheels for these packages for all major OS/PyTorch/CUDA combinati
following the same procedure as mentioned above.

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).
**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, and PyTorch 1.10.0/1.10.1/1.10.2 (following the same procedure).
**For older versions, you need to explicitly specify the latest supported version number** 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
19 changes: 16 additions & 3 deletions docs/source/notes/quick-start.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@

<script>
var torchList = [
['torch-1.12.0', 'PyTorch 1.12.*'],
['torch-1.11.0', 'PyTorch 1.11.*'],
['torch-1.10.0', 'PyTorch 1.10.*'],
];

var osList = [
Expand All @@ -94,6 +94,7 @@
['cu102', '10.2'],
['cu113', '11.3'],
['cu115', '11.5'],
['cu116', '11.6'],
['cpu', 'CPU'],
];

Expand All @@ -112,12 +113,24 @@
$("#command pre").text('# macOS binaries do not support CUDA');
}

else if (torch == "torch-1.12.0" && cuda == "cu102" && os == "windows") {
$("#command pre").text('# PyTorch 1.12.* Windows binaries do not support CUDA 10.2');
}

else if (torch == "torch-1.11.0" && cuda == "cu102" && os == "windows") {
$("#command pre").text('# PyTorch 1.11.* Windows binaries do not support CUDA 10.2');
}

else if (torch == "torch-1.10.0" && cuda == "cu115") {
$("#command pre").text('# PyTorch 1.10.* binaries do not support CUDA 11.5');
else if (torch == "torch-1.12.0" && cuda == "cu115") {
$("#command pre").text('# PyTorch 1.12.* binaries do not support CUDA 11.5');
}

else if (torch == "torch-1.11.0" && cuda == "cu116") {
$("#command pre").text('# PyTorch 1.11.* binaries do not support CUDA 11.6');
}

else if (package == "conda" && torch == "torch-1.12.0") {
$("#command pre").text('# Conda packages are not published for PyTorch 1.12 yet');
}

else if (package == "conda") {
Expand Down
2 changes: 0 additions & 2 deletions test/graphgym/test_config_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def test_config_store():
assert cfg.model.act_kwargs is None

# Check `cfg.optimizer`:
assert len(cfg.optimizer) in {6, 7} # Arguments changed across 1.10/1.11
assert cfg.optimizer._target_.split('.')[-1] == 'Adam'
assert cfg.optimizer.lr == 0.001
assert cfg.optimizer.betas == [0.9, 0.999]
Expand All @@ -67,7 +66,6 @@ def test_config_store():
assert not cfg.optimizer.maximize

# Check `cfg.lr_scheduler`:
assert len(cfg.lr_scheduler) == 10
assert cfg.lr_scheduler._target_.split('.')[-1] == 'ReduceLROnPlateau'
assert cfg.lr_scheduler.mode == 'min'
assert cfg.lr_scheduler.factor == 0.1
Expand Down

0 comments on commit 6522693

Please sign in to comment.