Skip to content

ci: add pytorch 2.12 and 2.13 to cpu tests#21835

Merged
bhimrazy merged 3 commits into
Lightning-AI:masterfrom
bhimrazy:ci/add-pytorch-2.12-2.13
Jul 16, 2026
Merged

ci: add pytorch 2.12 and 2.13 to cpu tests#21835
bhimrazy merged 3 commits into
Lightning-AI:masterfrom
bhimrazy:ci/add-pytorch-2.12-2.13

Conversation

@bhimrazy

@bhimrazy bhimrazy commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds PyTorch 2.12 and 2.13 to the CPU test matrices for fabric and pytorch, on Python 3.12 and 3.13 — extending what #21679 did for 2.11.

One test needed fixing to pass on the new versions — test_get_default_process_group_backend_for_device:

  • Cause: it called torch.utils.rename_privateuse1_backend("pcu"), which is process-global and irreversible, leaking a dangling pcu device into every later test in the same xdist worker.
  • Why it only shows up now: on 2.12/2.13 the tensor-moving paths consult the privateuse1 backend, so unrelated CPU-only tests started failing with RuntimeError: Device 'pcu' does not have a corresponding module registered as 'torch.pcu'.
  • Fix: used monkeypatch.setitem on Backend.default_device_backend_map instead, which has no global side effects.

The other blocker here was torch.compile + self.log() crashing on 2.12/2.13; that was split out and merged separately in #21837.

Follow-up

Both matrices now carry a TODO about pruning the oldest minors (2.1–2.5), best done in its own PR.

@codecov-commenter

codecov-commenter commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87%. Comparing base (35c8970) to head (2a4b3ce).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21835   +/-   ##
=======================================
  Coverage      87%      87%           
=======================================
  Files         270      270           
  Lines       24074    24074           
=======================================
  Hits        20903    20903           
  Misses       3171     3171           

@bhimrazy bhimrazy changed the title ci: add pytorch 2.12 and 2.13 to cpu tests [wip]: ci: add pytorch 2.12 and 2.13 to cpu tests Jul 15, 2026
@bhimrazy

Copy link
Copy Markdown
Collaborator Author

requires: #21837

@bhimrazy
bhimrazy force-pushed the ci/add-pytorch-2.12-2.13 branch from b8bed65 to 2a4b3ce Compare July 16, 2026 15:38
@bhimrazy bhimrazy changed the title [wip]: ci: add pytorch 2.12 and 2.13 to cpu tests ci: add pytorch 2.12 and 2.13 to cpu tests Jul 16, 2026
@bhimrazy
bhimrazy enabled auto-merge (squash) July 16, 2026 16:55
@bhimrazy
bhimrazy merged commit fbdf042 into Lightning-AI:master Jul 16, 2026
255 of 260 checks passed
@bhimrazy
bhimrazy deleted the ci/add-pytorch-2.12-2.13 branch July 16, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants