From b8ef64f539330f0b05a6bedca79ba0c380b97c50 Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Mon, 10 Nov 2025 12:29:34 +0545 Subject: [PATCH 1/3] ci: update test configurations for "lightning" and "pytorch" packages with new PyTorch versions --- .github/workflows/ci-tests-fabric.yml | 13 +++++-------- .github/workflows/ci-tests-pytorch.yml | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-tests-fabric.yml b/.github/workflows/ci-tests-fabric.yml index adf6ae5af1d80..e21468015d91c 100644 --- a/.github/workflows/ci-tests-fabric.yml +++ b/.github/workflows/ci-tests-fabric.yml @@ -40,23 +40,20 @@ jobs: matrix: os: [macOS-14, ubuntu-22.04, windows-2022] config: - # only run PyTorch latest + # Test unified "lightning" package with PyTorch 2.1-2.5 - { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" } - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" } - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" } - # only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues + # Test standalone "fabric" package with PyTorch 2.6-2.9 - { pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" } - - # "fabric" installs the standalone package - - { pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" } - - # adding recently cut Torch 2.7 - FUTURE + - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" } - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" } + - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.9" } - # "oldest" versions tests, only on minimum Python + # Test minimum supported versions (oldest) - { pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" } timeout-minutes: 25 # because of building grpcio on Mac env: diff --git a/.github/workflows/ci-tests-pytorch.yml b/.github/workflows/ci-tests-pytorch.yml index 49071f32757ec..395a0ff26f45a 100644 --- a/.github/workflows/ci-tests-pytorch.yml +++ b/.github/workflows/ci-tests-pytorch.yml @@ -44,23 +44,20 @@ jobs: matrix: os: [macOS-14, ubuntu-22.04, windows-2022] config: - # only run PyTorch latest + # Test unified "lightning" package with PyTorch 2.1-2.5 - { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" } - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" } - { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" } - # only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues + # Test standalone "pytorch" package with PyTorch 2.6-2.9 - { pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" } - - # "pytorch" installs the standalone package - - { pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" } - - # adding recently cut Torch 2.7 - FUTURE + - { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" } - { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" } + - { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.9" } - # "oldest" versions tests, only on minimum Python + # Test minimum supported versions (oldest) - { pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" } timeout-minutes: 50 env: From 9159903625b1394e88f0243a44d0c024417bfc7a Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Thu, 13 Nov 2025 20:48:28 +0545 Subject: [PATCH 2/3] Okay, this ` RuntimeError: makeDeviceForHostname(): unsupported gloo device` sems to be a known issue so ignoring foro 2.9 as well for windows --- src/lightning/pytorch/utilities/imports.py | 1 + tests/tests_pytorch/helpers/runif.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lightning/pytorch/utilities/imports.py b/src/lightning/pytorch/utilities/imports.py index f8277f30658c9..ab99457eee2d1 100644 --- a/src/lightning/pytorch/utilities/imports.py +++ b/src/lightning/pytorch/utilities/imports.py @@ -28,6 +28,7 @@ _TORCHMETRICS_GREATER_EQUAL_0_11 = RequirementCache("torchmetrics>=0.11.0") # using new API with task _TORCHMETRICS_GREATER_EQUAL_1_0_0 = RequirementCache("torchmetrics>=1.0.0") _TORCH_EQUAL_2_8 = RequirementCache("torch>=2.8.0,<2.9.0") +_TORCH_EQUAL_2_9 = RequirementCache("torch>=2.9.0,<2.10.0") _OMEGACONF_AVAILABLE = package_available("omegaconf") _TORCHVISION_AVAILABLE = RequirementCache("torchvision") diff --git a/tests/tests_pytorch/helpers/runif.py b/tests/tests_pytorch/helpers/runif.py index 372f493a1fb67..76204784cce0a 100644 --- a/tests/tests_pytorch/helpers/runif.py +++ b/tests/tests_pytorch/helpers/runif.py @@ -14,7 +14,7 @@ import pytest from lightning.fabric.utilities.imports import _IS_WINDOWS -from lightning.pytorch.utilities.imports import _TORCH_EQUAL_2_8 +from lightning.pytorch.utilities.imports import _TORCH_EQUAL_2_8, _TORCH_EQUAL_2_9 from lightning.pytorch.utilities.testing import _runif_reasons @@ -27,6 +27,6 @@ def RunIf(**kwargs): _xfail_gloo_windows = pytest.mark.xfail( RuntimeError, strict=True, - condition=(_IS_WINDOWS and _TORCH_EQUAL_2_8), + condition=(_IS_WINDOWS and (_TORCH_EQUAL_2_8 or _TORCH_EQUAL_2_9)), reason="makeDeviceForHostname(): unsupported gloo device", ) From a267ba502ee22e57e06fd105d5c3edf9b847124a Mon Sep 17 00:00:00 2001 From: bhimrazy Date: Fri, 14 Nov 2025 20:19:26 +0545 Subject: [PATCH 3/3] update --- .github/workflows/ci-tests-fabric.yml | 2 +- .github/workflows/ci-tests-pytorch.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-tests-fabric.yml b/.github/workflows/ci-tests-fabric.yml index e21468015d91c..ee1d28e960b07 100644 --- a/.github/workflows/ci-tests-fabric.yml +++ b/.github/workflows/ci-tests-fabric.yml @@ -47,7 +47,7 @@ jobs: - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" } - # Test standalone "fabric" package with PyTorch 2.6-2.9 + # Test "fabric" package with PyTorch 2.6-2.9 - { pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" } - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" } - { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" } diff --git a/.github/workflows/ci-tests-pytorch.yml b/.github/workflows/ci-tests-pytorch.yml index 395a0ff26f45a..21a3c331898df 100644 --- a/.github/workflows/ci-tests-pytorch.yml +++ b/.github/workflows/ci-tests-pytorch.yml @@ -51,7 +51,7 @@ jobs: - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" } - { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" } - # Test standalone "pytorch" package with PyTorch 2.6-2.9 + # Test "pytorch" package with PyTorch 2.6-2.9 - { pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" } - { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" } - { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }