chore: bump/enable PyTorch 2.11 in req. and CI#21609
Conversation
⛈️ Required checks status: Has failure 🔴
Groups summary🔴 pytorch_lightning: Tests workflow
These checks are required after the changes to 🔴 pytorch_lightning: lit GPU
These checks are required after the changes to 🟢 Benchmarks
These checks are required after the changes to 🟢 fabric: Docs
These checks are required after the changes to 🔴 pytorch_lightning: Docs
These checks are required after the changes to 🟢 lightning_fabric: CPU workflow
These checks are required after the changes to 🔴 lightning_fabric: lit GPU
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 install
These checks are required after the changes to Thank you for your contribution! 💜
|
There was a problem hiding this comment.
Pull request overview
This PR updates dependency constraints and CI matrices to enable testing and compatibility with newer PyTorch versions (through 2.11) and moves Linux CI jobs to Ubuntu 24.04, alongside small internal import/version-check housekeeping.
Changes:
- Expand
torchupper bounds inrequirements/fabric/base.txtandrequirements/pytorch/base.txtto allow PyTorch 2.11. - Update Fabric/PyTorch CI workflows to run on
ubuntu-24.04and add PyTorch2.11to the test matrices (plus update the “test” torch index toggle to key off2.11). - Minor cleanup/refinement of PyTorch/Fabric import/version flags.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/lightning/pytorch/utilities/imports.py |
Adds new torch 2.10 version flags and removes an older one. |
src/lightning/fabric/utilities/imports.py |
Removes a duplicate torch version flag definition. |
requirements/pytorch/base.txt |
Bumps allowed PyTorch upper bound to <2.12.0. |
requirements/fabric/base.txt |
Bumps allowed PyTorch upper bound to <2.12.0. |
.github/workflows/ci-tests-pytorch.yml |
Runs CI on Ubuntu 24.04 and adds PyTorch 2.11 to the matrix; updates torch index selection logic. |
.github/workflows/ci-tests-fabric.yml |
Runs CI on Ubuntu 24.04 and adds PyTorch 2.11 to the matrix; updates torch index selection logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21609 +/- ##
=======================================
- Coverage 87% 87% -0%
=======================================
Files 270 270
Lines 23895 23894 -1
=======================================
- Hits 20675 20674 -1
Misses 3220 3220 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Raise onnxscript to >=0.6.0,<0.7.0: PyTorch 2.11 imports onnxscript._framework_apis.torch_2_11 which only exists in 0.6.0+ - Raise onnx-ir to >=0.1.16,<0.3.0: ir.schemas (OpSignature, Parameter, etc.) was added in 0.1.16 and is accessed by torch.onnx._internal.exporter at 30 call-sites; the earlier <0.1.16 pin was overly conservative since onnx-ir itself never used pkg_resources - Bump torchvision upper bound to <0.27.0 to include 0.26.0 (the torchvision release paired with PyTorch 2.11) --- Co-authored-by: Claude Code <noreply@anthropic.com>
- Replace Sphinx cross-refs (:class:/:func:/:mod: torch.jit.*) with code literals in to_torchscript and model_summary docstrings; torch.jit no longer appears in PyTorch 2.11 intersphinx inventory (TorchScript is deprecated upstream)
- Add torch.jit.{ScriptModule,script,trace} + torch.jit module to nitpick_ignore to suppress type-annotation-generated references in Sphinx autodoc
- Add _TORCH_GREATER_EQUAL_2_11 version flag to pytorch imports
- Narrow _xfail_gloo_windows to PT 2.8–2.10 only (gloo makeDeviceForHostname error was fixed in PT 2.11 on Windows)
---
Co-authored-by: Claude Code <noreply@anthropic.com>
Removed references to torch.jit classes and functions.
What does this PR do?
This pull request updates the CI configuration and package requirements to support newer versions of PyTorch (up to 2.11) and Ubuntu (24.04), and makes minor improvements to version checks in the codebase. The changes ensure that both the "fabric" and "pytorch" packages are tested and compatible with the latest PyTorch releases, and that CI runs on a more recent Ubuntu version.
CI configuration and testing updates:
ci-tests-fabric.ymlandci-tests-pytorch.yml) to test on Ubuntu 24.04 instead of 22.04, and to include PyTorch 2.11 in the test matrix for both "fabric" and "pytorch" packages. [1] [2] [3] [4]Dependency version range updates:
torchinrequirements/fabric/base.txtandrequirements/pytorch/base.txtfrom<2.10.0to<2.12.0, allowing compatibility with PyTorch 2.11. [1] [2]Internal version check improvements:
src/lightning/pytorch/utilities/imports.pyto handle PyTorch 2.10 and above, and removed unused version checks.src/lightning/fabric/utilities/imports.py.Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--21609.org.readthedocs.build/en/21609/