Skip to content

Commit 4ff8ff7

Browse files
Bordapre-commit-ci[bot]dependabot[bot]
authored
chore: bump PyTorch version in dependencies & CI (#21043)
* bump PyTorch version in dependencies & CI build(deps): update torchvision requirement in /requirements Updates the requirements on [torchvision](https://github.com/pytorch/vision) to permit the latest version. - [Release notes](https://github.com/pytorch/vision/releases) - [Commits](pytorch/vision@v0.16.0...0.23.0) --- updated-dependencies: - dependency-name: torchvision dependency-version: 0.23.0 dependency-type: direct:production ... * RunIf(linux_only=True) * _xfail_gloo_windows * FixMe * flaky --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent a0ce930 commit 4ff8ff7

File tree

27 files changed

+118
-342
lines changed

27 files changed

+118
-342
lines changed

.azure/gpu-tests-fabric.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ jobs:
6060
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.1"
6161
PACKAGE_NAME: "fabric"
6262
"Fabric | latest":
63-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
63+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.8-cuda12.6.3"
6464
PACKAGE_NAME: "fabric"
6565
#"Fabric | future":
6666
# image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
6767
# PACKAGE_NAME: "fabric"
6868
"Lightning | latest":
69-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
69+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.8-cuda12.6.3"
7070
PACKAGE_NAME: "lightning"
7171
workspace:
7272
clean: all

.azure/gpu-tests-pytorch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.1"
5454
PACKAGE_NAME: "pytorch"
5555
"PyTorch | latest":
56-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
56+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.8-cuda12.6.3"
5757
PACKAGE_NAME: "pytorch"
5858
#"PyTorch | future":
5959
# image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
6060
# PACKAGE_NAME: "pytorch"
6161
"Lightning | latest":
62-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
62+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.8-cuda12.6.3"
6363
PACKAGE_NAME: "lightning"
6464
pool: lit-rtx-3090
6565
variables:

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ jobs:
6464
- { os: "ubuntu-22.04", pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
6565
- { os: "windows-2022", pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
6666
# "fabric" installs the standalone package
67-
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.5" }
68-
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.5" }
69-
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.5" }
67+
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
68+
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
69+
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
7070
# adding recently cut Torch 2.7 - FUTURE
71-
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" }
72-
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" }
73-
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" }
71+
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
72+
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
73+
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
7474
timeout-minutes: 25 # because of building grpcio on Mac
7575
env:
7676
PACKAGE_NAME: ${{ matrix.pkg-name }}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ jobs:
6868
- { os: "ubuntu-22.04", pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
6969
- { os: "windows-2022", pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
7070
# "pytorch" installs the standalone package
71-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.5" }
72-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.5" }
73-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.5" }
71+
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
72+
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
73+
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
7474
# adding recently cut Torch 2.7 - FUTURE
75-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" }
76-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" }
77-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" }
75+
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
76+
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
77+
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
7878
timeout-minutes: 50
7979
env:
8080
PACKAGE_NAME: ${{ matrix.pkg-name }}

requirements/fabric/examples.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package
22
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
33

4-
torchvision >=0.16.0, <0.23.0
4+
torchvision >=0.16.0, <0.24.0
55
torchmetrics >=0.10.0, <1.9.0

requirements/pytorch/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package
22
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
33

4-
torch >=2.1.0, <=2.8.0
4+
torch >=2.1.0, <2.9.0
55
tqdm >=4.57.0, <4.68.0
66
PyYAML >5.4, <6.1.0
77
fsspec[http] >=2022.5.0, <2025.8.0

requirements/pytorch/examples.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment
33

44
requests <2.33.0
5-
torchvision >=0.16.0, <0.23.0
5+
torchvision >=0.16.0, <0.24.0
66
ipython[all] <8.19.0
77
torchmetrics >=0.10.0, <1.9.0

src/lightning/fabric/utilities/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
_TORCH_GREATER_EQUAL_2_4_1 = compare_version("torch", operator.ge, "2.4.1")
3737
_TORCH_GREATER_EQUAL_2_5 = compare_version("torch", operator.ge, "2.5.0")
3838
_TORCH_LESS_EQUAL_2_6 = compare_version("torch", operator.le, "2.6.0")
39-
39+
_TORCHMETRICS_GREATER_EQUAL_1_0_0 = compare_version("torchmetrics", operator.ge, "1.0.0")
4040
_PYTHON_GREATER_EQUAL_3_10_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 10)

src/lightning/fabric/utilities/spike.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import json
2-
import operator
32
import os
43
import warnings
54
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
65

76
import torch
8-
from lightning_utilities.core.imports import compare_version
97

8+
from lightning.fabric.utilities.imports import _TORCHMETRICS_GREATER_EQUAL_1_0_0
109
from lightning.fabric.utilities.types import _PATH
1110

1211
if TYPE_CHECKING:
1312
from lightning.fabric.fabric import Fabric
1413

15-
_TORCHMETRICS_GREATER_EQUAL_1_0_0 = compare_version("torchmetrics", operator.ge, "1.0.0")
16-
1714

1815
class SpikeDetection:
1916
"""Spike Detection Callback.

src/lightning/fabric/utilities/testing/_runif.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def _runif_reasons(
4040
standalone: bool = False,
4141
deepspeed: bool = False,
4242
dynamo: bool = False,
43+
linux_only: bool = False,
4344
) -> tuple[list[str], dict[str, bool]]:
4445
"""Construct reasons for pytest skipif.
4546
@@ -121,4 +122,7 @@ def _runif_reasons(
121122
if not is_dynamo_supported():
122123
reasons.append("torch.dynamo")
123124

125+
if linux_only and sys.platform != "linux":
126+
reasons.append("only linux")
127+
124128
return reasons, kwargs

0 commit comments

Comments
 (0)