Skip to content

Commit

Permalink
Added PyTorch 2.2 support (pyg-team#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Feb 3, 2024
1 parent 897de03 commit 60a55f6
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
default: '3.8'
torch-version:
required: false
default: '2.1.0'
default: '2.2.0'
cuda-version:
required: false
default: cpu
Expand Down Expand Up @@ -56,5 +56,5 @@ runs:

- name: Install additional dependencies
run: |
pip install ninja wheel
pip install setuptools ninja wheel
shell: bash
3 changes: 3 additions & 0 deletions .github/workflows/aws/upload_nightly_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
wheels_dict[torch_version.replace('1.13.0', '1.13.1')].append(wheel)
if '2.0.0' in torch_version:
wheels_dict[torch_version.replace('2.0.0', '2.0.1')].append(wheel)
if '2.1.0' in torch_version:
wheels_dict[torch_version.replace('2.1.0', '2.1.1')].append(wheel)
wheels_dict[torch_version.replace('2.1.0', '2.1.2')].append(wheel)

index_html = html.format('\n'.join([
href.format(f'{version}.html'.replace('+', '%2B'), version)
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11] # windows-2019
python-version: ['3.8', '3.9', '3.10', '3.11']
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0]
os: [ubuntu-20.04, macos-11, windows-2019]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0]
cuda-version: ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121']
exclude:
- os: windows-2019 # No windows support yet :(
- torch-version: 1.12.0
python-version: '3.12'
- torch-version: 1.13.0
python-version: '3.12'
- torch-version: 2.0.0
python-version: '3.12'
- torch-version: 2.1.0
python-version: '3.12'
- torch-version: 1.12.0
python-version: '3.11'
- torch-version: 1.12.0
Expand Down Expand Up @@ -43,6 +52,12 @@ jobs:
cuda-version: 'cu116'
- torch-version: 2.1.0
cuda-version: 'cu117'
- torch-version: 2.2.0
cuda-version: 'cu113'
- torch-version: 2.2.0
cuda-version: 'cu116'
- torch-version: 2.2.0
cuda-version: 'cu117'
- os: macos-11
cuda-version: 'cu113'
- os: macos-11
Expand All @@ -53,6 +68,13 @@ jobs:
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:
- name: Checkout repository
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cpp_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,28 @@ jobs:
mkdir build
cd build
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` cmake .. -GNinja -DBUILD_TEST=ON -DWITH_COV=ON -DCMAKE_BUILD_TYPE=DEBUG -DUSE_MKL_BLAS=ON -DBLAS_INCLUDE_DIR=$_BLAS_INCLUDE_DIR -DMKL_DIR=${MKL_DIR}
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` cmake .. -GNinja -DBUILD_TEST=ON -DWITH_COV=ON -DCMAKE_BUILD_TYPE=DEBUG -DUSE_MKL_BLAS=OFF -DBLAS_INCLUDE_DIR=$_BLAS_INCLUDE_DIR -DMKL_DIR=${MKL_DIR}
unset _BLAS_INCLUDE_DIR
cd ..
- name: Build
run: |
cd build
cmake --build .
cd ..
- name: Run tests
run: |
cd build
ctest --verbose --output-on-failure
cd ..
- name: Collect coverage
run: |
sudo apt-get install lcov
lcov --directory . --capture --output-file .coverage.info
lcov --remove .coverage.info '*/test/*' --output-file .coverage.info
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ['3.8', '3.9', '3.10', '3.11']
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0]
cuda-version: ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121']
exclude:
- torch-version: 1.12.0
python-version: '3.12'
- torch-version: 1.13.0
python-version: '3.12'
- torch-version: 2.0.0
python-version: '3.12'
- torch-version: 2.1.0
python-version: '3.12'
- torch-version: 1.12.0
python-version: '3.11'
- torch-version: 1.12.0
Expand Down Expand Up @@ -47,6 +55,12 @@ jobs:
cuda-version: 'cu116'
- torch-version: 2.1.0
cuda-version: 'cu117'
- torch-version: 2.2.0
cuda-version: 'cu113'
- torch-version: 2.2.0
cuda-version: 'cu116'
- torch-version: 2.2.0
cuda-version: 'cu117'

steps:
- name: Checkout repository
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/).

## [0.4.0] - 2023-MM-DD
### Added
- Added PyTorch 2.2 support ([#294](https://github.com/pyg-team/pyg-lib/pull/294))
- Added `softmax_csr` implementation ([#264](https://github.com/pyg-team/pyg-lib/pull/264), [#282](https://github.com/pyg-team/pyg-lib/pull/282))
- Added support for edge-level sampling ([#280](https://github.com/pyg-team/pyg-lib/pull/280))
- Added support for `bfloat16` data type in `segment_matmul` and `grouped_matmul` (CPU only) ([#272](https://github.com/pyg-team/pyg-lib/pull/272))
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## Installation

We provide pre-built Python wheels for all major OS/PyTorch/CUDA combinations from Python 3.8 till 3.11, see [here](https://data.pyg.org/whl).
We provide pre-built Python wheels for all major OS/PyTorch/CUDA combinations from Python 3.8 till 3.12, see [here](https://data.pyg.org/whl).
Note that currently, Windows wheels are not supported (we are working on fixing this as soon as possible).

To install the wheels, simply run
Expand All @@ -29,11 +29,17 @@ pip install pyg-lib -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html

where

* `${TORCH}` should be replaced by either `1.12.0`, `1.13.0`, `2.0.0` or `2.1.0`
* `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, `cu116`, `cu117`, `cu118` or `cu121`
* `${TORCH}` should be replaced by either `1.12.0`, `1.13.0`, `2.0.0`, `2.1.0`, or `2.2.0`
* `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, `cu116`, `cu117`, `cu118`, or `cu121`

The following combinations are supported:

| PyTorch 2.2 | `cpu` | `cu102` | `cu113` | `cu116` | `cu117` | `cu118` | `cu121` |
|--------------|-------|---------|---------|---------|---------|---------|---------|
| **Linux** || | | | |||
| **Windows** | | | | | | | |
| **macOS** || | | | | | |

| PyTorch 2.1 | `cpu` | `cu102` | `cu113` | `cu116` | `cu117` | `cu118` | `cu121` |
|--------------|-------|---------|---------|---------|---------|---------|---------|
| **Linux** || | | | |||
Expand All @@ -60,7 +66,7 @@ The following combinations are supported:

### Form nightly

Nightly wheels are provided for Linux from Python 3.8 till 3.11:
Nightly wheels are provided for Linux from Python 3.8 till 3.12:

```
pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-${TORCH}+${CUDA}.html
Expand Down
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

0 comments on commit 60a55f6

Please sign in to comment.