Skip to content

chore: bump/enable PyTorch 2.11 in req. and CI#21609

Open
Borda wants to merge 6 commits intomasterfrom
bump/pt-2.11
Open

chore: bump/enable PyTorch 2.11 in req. and CI#21609
Borda wants to merge 6 commits intomasterfrom
bump/pt-2.11

Conversation

@Borda
Copy link
Copy Markdown
Collaborator

@Borda Borda commented Mar 24, 2026

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:

  • Updated CI workflows (ci-tests-fabric.yml and ci-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]
  • Modified environment variable logic in CI to use the test PyTorch URL specifically for version 2.11, instead of 2.7. [1] [2]

Dependency version range updates:

  • Increased the upper bound for torch in requirements/fabric/base.txt and requirements/pytorch/base.txt from <2.10.0 to <2.12.0, allowing compatibility with PyTorch 2.11. [1] [2]

Internal version check improvements:

  • Added and updated version comparison variables and requirement caches in src/lightning/pytorch/utilities/imports.py to handle PyTorch 2.10 and above, and removed unused version checks.
  • Removed a duplicate version check in src/lightning/fabric/utilities/imports.py.
Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

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
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--21609.org.readthedocs.build/en/21609/

Copilot AI review requested due to automatic review settings March 24, 2026 09:48
@github-actions github-actions bot added ci Continuous Integration fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package dependencies Pull requests that update a dependency file labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

⛈️ Required checks status: Has failure 🔴

Warning
This job will need to be re-run to merge your PR. If you do not have write access to the repository, you can ask Lightning-AI/lai-frameworks to re-run it. If you push a new commit, all of CI will re-trigger.

Groups summary

🔴 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu-guardian failure

These checks are required after the changes to .github/workflows/ci-tests-pytorch.yml, requirements/fabric/base.txt, src/lightning/fabric/utilities/imports.py, requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt, src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py, tests/tests_pytorch/helpers/runif.py.

🔴 pytorch_lightning: lit GPU
Check ID Status
pytorch.yml / Lit Job (nvidia/cuda:12.1.1-devel-ubuntu22.04, pytorch, 3.10) success
pytorch.yml / Lit Job (lightning, 3.12) failure
pytorch.yml / Lit Job (pytorch, 3.12) failure

These checks are required after the changes to requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt, src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py, tests/tests_pytorch/helpers/runif.py, requirements/fabric/base.txt, src/lightning/fabric/utilities/imports.py.

🟢 Benchmarks
Check ID Status
benchmark.yml / Lit Job (fabric) success
benchmark.yml / Lit Job (pytorch) success

These checks are required after the changes to requirements/fabric/base.txt, requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt, src/lightning/fabric/utilities/imports.py, src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py.

🟢 fabric: Docs
Check ID Status
docs-make (fabric, doctest) success
docs-make (fabric, html) success

These checks are required after the changes to src/lightning/fabric/utilities/imports.py, requirements/fabric/base.txt.

🔴 pytorch_lightning: Docs
Check ID Status
docs-make (pytorch, doctest) success
docs-make (pytorch, html) failure

These checks are required after the changes to src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py, requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt.

🟢 lightning_fabric: CPU workflow
Check ID Status
fabric-cpu-guardian success

These checks are required after the changes to requirements/fabric/base.txt, src/lightning/fabric/utilities/imports.py, .github/workflows/ci-tests-fabric.yml.

🔴 lightning_fabric: lit GPU
Check ID Status
fabric.yml / Lit Job (nvidia/cuda:12.1.1-devel-ubuntu22.04, fabric, 3.10) failure
fabric.yml / Lit Job (fabric, 3.12) success
fabric.yml / Lit Job (lightning, 3.12) failure

These checks are required after the changes to requirements/fabric/base.txt, src/lightning/fabric/utilities/imports.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to requirements/fabric/base.txt, requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt, src/lightning/fabric/utilities/imports.py, src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py.

🟢 install
Check ID Status
install-pkg-guardian success

These checks are required after the changes to src/lightning/fabric/utilities/imports.py, src/lightning/pytorch/core/module.py, src/lightning/pytorch/utilities/imports.py, src/lightning/pytorch/utilities/model_summary/model_summary.py, requirements/fabric/base.txt, requirements/pytorch/base.txt, requirements/pytorch/examples.txt, requirements/pytorch/test.txt.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 70 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 torch upper bounds in requirements/fabric/base.txt and requirements/pytorch/base.txt to allow PyTorch 2.11.
  • Update Fabric/PyTorch CI workflows to run on ubuntu-24.04 and add PyTorch 2.11 to the test matrices (plus update the “test” torch index toggle to key off 2.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
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87%. Comparing base (6805188) to head (055180b).
✅ All tests successful. No failed tests found.

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           

Borda and others added 4 commits March 24, 2026 11:03
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>
@github-actions github-actions bot added the docs Documentation related label Mar 26, 2026
Removed references to torch.jit classes and functions.
@Borda Borda enabled auto-merge (squash) March 26, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration dependencies Pull requests that update a dependency file docs Documentation related fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants