[wip] ci: drop PyTorch 2.0-2.5 and raise minimum to 2.6 - #3449
Open
bhimrazy wants to merge 4 commits into
Open
Conversation
…t device
`Metric.__init__` gated the use of `torch.get_default_device()` on torch >= 2.3.
However, until torch 2.8 that function only reflected `set_default_device()` and
ignored an active `with torch.device(...)` context manager, so metrics created
inside such a block were assigned the CPU instead of the context device.
torch 2.8 (pytorch/pytorch v2.8.0) added the `DeviceContext` lookup to
`get_default_device`, so gate on 2.8 and keep the `torch.empty(0).device` probe
for older versions, which does respect the context manager.
Verified on torch 2.6.0: inside `with torch.device("meta")`,
`get_default_device()` returns cpu while `torch.empty(0).device` returns meta.
Adds a CPU-runnable regression test using the meta device; the existing coverage
for this path was GPU-only.
Drops the end-of-life PyTorch minors and raises the floor to 2.6, keeping the latest five supported minors (2.6-2.10), matching what Lightning did in #21851. - CPU matrix: drop the 2.0-2.5 rows and retarget the oldest/macOS/Windows entries to 2.6.0 (23 -> 17 jobs). - Docker: drop the 2.0.1-2.5.1 CUDA images (14 -> 8 builds); 2.6.0/cu12.4.1 is the new oldest. Dockerfile ARG defaults follow it. - GPU lanes: move the oldest image to torch 2.6 (cu12.4.1 for unittests, pytorch/pytorch:2.6.0-cuda12.4 for integrations). - Requirements: torch >=2.6.0, torchaudio >=2.6.0, torchvision >=0.21.0. - pytorch-lightning floor 1.9.0 -> 2.5.1, the first release CI-tested against torch 2.6. The GPU lanes previously hardcoded `TORCH_VER == "2.0"` to decide whether to apply the oldest requirements. That silently goes stale whenever the floor moves on the CPU side, so derive it from requirements/base.txt instead and fail fast if an image is below the declared floor.
bhimrazy
requested review from
SkafteNicki,
ethanwharris and
justusschock
as code owners
August 9, 2026 15:52
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3449 +/- ##
======================================
- Coverage 37% 36% -0%
======================================
Files 349 349
Lines 19901 19910 +9
======================================
- Hits 7264 7263 -1
- Misses 12637 12647 +10 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Drops the end-of-life PyTorch minors and raises the floor to 2.6, keeping the latest five supported minors (2.6–2.10). Mirrors Lightning-AI/pytorch-lightning#21851.
torch >=2.6.0,torchaudio >=2.6.0,torchvision >=0.21.0,pytorch-lightning >=2.5.1(first release CI-tested against torch 2.6)The GPU lanes hardcoded
TORCH_VER == "2.0"to gate the oldest requirements, which silently goes stale when the floor moves on the CPU side. Now derived fromrequirements/base.txt, with a fail-fast check if an image sits below the declared floor.Note
Stacked on #3448 — that fix is required for the GPU
oldestlane to pass on torch 2.6. Review the top commit only; rebasing once #3448 lands.Follow-ups: docs/support policy, then removing the dead
_TORCH_GREATER_EQUAL_2_1..2_5paths.