Skip to content

Commit 126fa6f

Browse files
authored
test(ci): add pytorch version 2.9 for CPU tests (#21352)
* ci: update test configurations for "lightning" and "pytorch" packages with new PyTorch versions * Okay, this ` RuntimeError: makeDeviceForHostname(): unsupported gloo device` sems to be a known issue so ignoring foro 2.9 as well for windows * update
1 parent b15d394 commit 126fa6f

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

.github/workflows/ci-tests-fabric.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,20 @@ jobs:
4040
matrix:
4141
os: [macOS-14, ubuntu-22.04, windows-2022]
4242
config:
43-
# only run PyTorch latest
43+
# Test unified "lightning" package with PyTorch 2.1-2.5
4444
- { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
4545
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
4646
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
4747
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
4848
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
4949

50-
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
50+
# Test "fabric" package with PyTorch 2.6-2.9
5151
- { pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
52-
53-
# "fabric" installs the standalone package
54-
- { pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
55-
56-
# adding recently cut Torch 2.7 - FUTURE
52+
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" }
5753
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
54+
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.9" }
5855

59-
# "oldest" versions tests, only on minimum Python
56+
# Test minimum supported versions (oldest)
6057
- { pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
6158
timeout-minutes: 25 # because of building grpcio on Mac
6259
env:

.github/workflows/ci-tests-pytorch.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,20 @@ jobs:
4444
matrix:
4545
os: [macOS-14, ubuntu-22.04, windows-2022]
4646
config:
47-
# only run PyTorch latest
47+
# Test unified "lightning" package with PyTorch 2.1-2.5
4848
- { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
4949
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
5050
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5151
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
5252
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
5353

54-
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
54+
# Test "pytorch" package with PyTorch 2.6-2.9
5555
- { pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
56-
57-
# "pytorch" installs the standalone package
58-
- { pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
59-
60-
# adding recently cut Torch 2.7 - FUTURE
56+
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" }
6157
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
58+
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.9" }
6259

63-
# "oldest" versions tests, only on minimum Python
60+
# Test minimum supported versions (oldest)
6461
- { pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
6562
timeout-minutes: 50
6663
env:

src/lightning/pytorch/utilities/imports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
_TORCHMETRICS_GREATER_EQUAL_0_11 = RequirementCache("torchmetrics>=0.11.0") # using new API with task
2929
_TORCHMETRICS_GREATER_EQUAL_1_0_0 = RequirementCache("torchmetrics>=1.0.0")
3030
_TORCH_EQUAL_2_8 = RequirementCache("torch>=2.8.0,<2.9.0")
31+
_TORCH_EQUAL_2_9 = RequirementCache("torch>=2.9.0,<2.10.0")
3132

3233
_OMEGACONF_AVAILABLE = package_available("omegaconf")
3334
_TORCHVISION_AVAILABLE = RequirementCache("torchvision")

tests/tests_pytorch/helpers/runif.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import pytest
1515

1616
from lightning.fabric.utilities.imports import _IS_WINDOWS
17-
from lightning.pytorch.utilities.imports import _TORCH_EQUAL_2_8
17+
from lightning.pytorch.utilities.imports import _TORCH_EQUAL_2_8, _TORCH_EQUAL_2_9
1818
from lightning.pytorch.utilities.testing import _runif_reasons
1919

2020

@@ -27,6 +27,6 @@ def RunIf(**kwargs):
2727
_xfail_gloo_windows = pytest.mark.xfail(
2828
RuntimeError,
2929
strict=True,
30-
condition=(_IS_WINDOWS and _TORCH_EQUAL_2_8),
30+
condition=(_IS_WINDOWS and (_TORCH_EQUAL_2_8 or _TORCH_EQUAL_2_9)),
3131
reason="makeDeviceForHostname(): unsupported gloo device",
3232
)

0 commit comments

Comments
 (0)