Skip to content
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

Add PyTorch 2.3 support #322

Merged
merged 4 commits into from
Apr 28, 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
2 changes: 1 addition & 1 deletion .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.2.0'
default: '2.3.0'
cuda-version:
required: false
default: cpu
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/building.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-14, 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]
# torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0]
torch-version: [2.3.0]
cuda-version: ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121']
exclude:
- torch-version: 1.12.0
Expand Down Expand Up @@ -57,6 +58,12 @@ jobs:
cuda-version: 'cu116'
- torch-version: 2.2.0
cuda-version: 'cu117'
- torch-version: 2.3.0
cuda-version: 'cu113'
- torch-version: 2.3.0
cuda-version: 'cu116'
- torch-version: 2.3.0
cuda-version: 'cu117'
- os: macos-14
cuda-version: 'cu113'
- os: macos-14
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cpp_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Configure
run: |
export MKL_VERSION=`python -c 'from tools.mkl_ver import compatible_mkl_ver;print(compatible_mkl_ver())'`
pip install mkl-include==${MKL_VERSION} mkl-static==${MKL_VERSION}
pip install --no-cache-dir mkl-include==${MKL_VERSION} mkl-static==${MKL_VERSION}

export _BLAS_INCLUDE_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}include")'`
export MKL_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}lib{os.sep}cmake{os.sep}mkl")'`
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-14, 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]
torch-version: [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0]
cuda-version: ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121']
exclude:
- torch-version: 1.12.0
Expand Down Expand Up @@ -61,6 +61,12 @@ jobs:
cuda-version: 'cu116'
- torch-version: 2.2.0
cuda-version: 'cu117'
- torch-version: 2.3.0
cuda-version: 'cu113'
- torch-version: 2.3.0
cuda-version: 'cu116'
- torch-version: 2.3.0
cuda-version: 'cu117'
- os: macos-14
cuda-version: 'cu113'
- os: macos-14
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.5.0] - 2023-MM-DD
### Added
- Added PyTorch 2.3 support ([#322](https://github.com/pyg-team/pyg-lib/pull/322))
- Added Windows support ([#315](https://github.com/pyg-team/pyg-lib/pull/315))
- Added macOS Apple Silicon support ([#310](https://github.com/pyg-team/pyg-lib/pull/310))
### Changed
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`, `2.1.0`, or `2.2.0`
* `${TORCH}` should be replaced by either `1.12.0`, `1.13.0`, `2.0.0`, `2.1.0`, `2.2.0`, or `2.3.0`
* `${CUDA}` should be replaced by either `cpu`, `cu102`, `cu113`, `cu116`, `cu117`, `cu118`, or `cu121`

The following combinations are supported:

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

| PyTorch 2.2 | `cpu` | `cu102` | `cu113` | `cu116` | `cu117` | `cu118` | `cu121` |
|--------------|-------|---------|---------|---------|---------|---------|---------|
| **Linux** | ✅ | | | | | ✅ | ✅ |
Expand Down
4 changes: 2 additions & 2 deletions benchmark/sampler/subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def test_subgraph(dataset, **kwargs):
t = time.perf_counter()
for _ in range(10):
pyg_lib.sampler.subgraph(rowptr, col, nodes)
print(f'time={time.perf_counter()-t:.6f} seconds')
print(f'time={time.perf_counter() - t:.6f} seconds')

edge_index = to_edge_index(rowptr, col)
from torch_geometric.utils import subgraph

t = time.perf_counter()
for _ in range(10):
subgraph(nodes, edge_index, num_nodes=num_nodes, relabel_nodes=True)
print(f'time={time.perf_counter()-t:.6f} seconds')
print(f'time={time.perf_counter() - t:.6f} seconds')


if __name__ == '__main__':
Expand Down
Loading