Skip to content

Commit

Permalink
chore (CI): start support to py312 (#2929)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Jun 18, 2024
1 parent d2adaeb commit e5155b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/pr_test_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,34 @@ jobs:
os: ['Ubuntu-latest', 'Windows-latest']
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: ${{ matrix.os }}
python-version: '["3.8", "3.11"]'
python-version: '["3.8", "3.12"]'
pytorch-version: '["1.9.1", "2.3.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}

tests-cpu-macos:
uses: kornia/workflows/.github/workflows/tests.yml@v1.6.0
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: 'MacOS-latest'
python-version: '["3.8", "3.11"]'
python-version: '["3.8", "3.12"]'
pytorch-dtype: 'float32'


coverage:
uses: kornia/workflows/.github/workflows/coverage.yml@v1.9.1
uses: kornia/workflows/.github/workflows/coverage.yml@v1.10.0

typing:
uses: kornia/workflows/.github/workflows/mypy.yml@v1.9.1
uses: kornia/workflows/.github/workflows/mypy.yml@v1.10.0

tutorials:
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.10.0

docs:
uses: kornia/workflows/.github/workflows/docs.yml@v1.9.1
uses: kornia/workflows/.github/workflows/docs.yml@v1.10.0
with:
python-version: "3.11"

collector:
needs: [coverage, tests-cpu, tutorials, typing, docs]
Expand All @@ -66,7 +68,7 @@ jobs:
os: ['Ubuntu-latest', 'Windows-latest'] #, 'MacOS-latest'] add it when https://github.com/pytorch/pytorch/pull/89262 be merged
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: ${{ matrix.os }}
pytorch-version: '["nightly"]'
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/scheduled_test_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
# os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest']
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: 'Ubuntu-latest'
python-version: '["3.8", "3.9", "3.10", "3.11"]'
python-version: '["3.8", "3.9", "3.10", "3.11", "3.12"]'
pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
pytest-extra: '--runslow'
Expand All @@ -34,10 +34,10 @@ jobs:
matrix:
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: 'Windows-latest'
python-version: '["3.11"]'
python-version: '["3.12"]'
pytorch-version: '["1.9.1", "2.3.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}

Expand All @@ -47,19 +47,21 @@ jobs:
matrix:
pytorch-dtype: ['float32', 'float64']

uses: kornia/workflows/.github/workflows/tests.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tests.yml@v1.10.0
with:
os: 'MacOS-latest'
pytorch-dtype: ${{ matrix.pytorch-dtype }}

coverage:
uses: kornia/workflows/.github/workflows/coverage.yml@v1.9.1
uses: kornia/workflows/.github/workflows/coverage.yml@v1.10.0

typing:
uses: kornia/workflows/.github/workflows/mypy.yml@v1.9.1
uses: kornia/workflows/.github/workflows/mypy.yml@v1.10.0

tutorials:
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.9.1
uses: kornia/workflows/.github/workflows/tutorials.yml@v1.10.0

docs:
uses: kornia/workflows/.github/workflows/docs.yml@v1.9.1
uses: kornia/workflows/.github/workflows/docs.yml@v1.10.0
with:
python-version: "3.11"
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_test_pypi_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout kornia
Expand Down
9 changes: 7 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def torch_optimizer(optimizer_backend):
return torch.jit.script

if hasattr(torch, "compile") and sys.platform == "linux":
if not (sys.version_info[:2] == (3, 11) and torch_version() in {"2.0.0", "2.0.1"}):
if (not (sys.version_info[:2] == (3, 11) and torch_version() in {"2.0.0", "2.0.1"})) and (
not sys.version_info[:2] == (3, 12)
):
# torch compile don't have support for python3.12 yet
torch._dynamo.reset()
# torch compile just have support for python 3.11 after torch 2.1.0
return partial(
Expand Down Expand Up @@ -182,7 +185,9 @@ def pytest_sessionstart(session):
try:
_setup_torch_compile()
except RuntimeError as ex:
if "not yet supported for torch.compile" not in str(ex):
if "not yet supported for torch.compile" not in str(
ex
) and "Dynamo is not supported on Python 3.12+" not in str(ex):
raise ex
# TODO: cache all torch.load weights/states here to not impact on test suite

Expand Down

0 comments on commit e5155b9

Please sign in to comment.