Skip to content

ci: bump torch ceiling to <2.14.0 and fix torch-tensorrt/DeepSpeed fallout - #21891

Open
bhimrazy wants to merge 7 commits into
Lightning-AI:masterfrom
bhimrazy:ci/bump-torch-tensorrt-ceiling
Open

ci: bump torch ceiling to <2.14.0 and fix torch-tensorrt/DeepSpeed fallout#21891
bhimrazy wants to merge 7 commits into
Lightning-AI:masterfrom
bhimrazy:ci/bump-torch-tensorrt-ceiling

Conversation

@bhimrazy

@bhimrazy bhimrazy commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Raises the torch ceiling to <2.14.0 — a follow-up to #21851, which capped it at <2.13.0 only because torch-tensorrt had no build past it. That build shipped on 2026-07-28.

Moving past 2.13 surfaced two unrelated CI failures, both fixed here.

TorchScript frontend missing

  • torch-tensorrt's TS frontend lives in the compiled libtorchtrt.so.
  • The 2.13.0+cu130 wheel from the PyTorch index ships without it (608 KB, zero .so files, vs. 4 MB for 2.12.1+cu130).
  • A local version like +cu130 always outranks a plain PyPI release, so find-links kept winning that resolution — even though PyPI's 2.13.0 does bundle the libraries.
  • Fix: drop the CUDA-specific find-links for torch-tensorrt so it resolves from PyPI instead. Tests also now feature-detect via ENABLED_FEATURES.torchscript_frontend and skip gracefully on any build that lacks it.

Torch 2.13 collective deprecations

  • Torch 2.13 deprecated all_gather_into_tensor and reduce_scatter_tensor in favor of their *_single counterparts; error::FutureWarning turned that into a test failure.
  • Both calls come from DeepSpeed's ZeRO-3 checkpointing path — neither API is used in Lightning — so they're filtered by message.

PR review

Anyone in the community is free to review the PR once the tests have passed.

@codecov-commenter

codecov-commenter commented Aug 9, 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 (fcef404) to head (3b06eb6).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21891   +/-   ##
=======================================
  Coverage      87%      87%           
=======================================
  Files         270      270           
  Lines       23998    23998           
=======================================
  Hits        20838    20838           
  Misses       3160     3160           

@bhimrazy
bhimrazy force-pushed the ci/bump-torch-tensorrt-ceiling branch from a8fab23 to f6745fe Compare August 9, 2026 13:50
@bhimrazy bhimrazy changed the title ci: bump torch ceiling to <2.14.0 now that torch-tensorrt 2.13 is out ci: bump torch ceiling to <2.14.0 and fix torch 2.13 fallout Aug 9, 2026
@bhimrazy
bhimrazy force-pushed the ci/bump-torch-tensorrt-ceiling branch from f6745fe to de301ec Compare August 9, 2026 13:52
Follow-up to Lightning-AI#21851, which capped torch at <2.13.0 because torch-tensorrt
had no stable build past it yet. torch-tensorrt 2.13.0 (released 2026-07-28)
now requires torch>=2.13.0,<2.14.0, so the cap can move up.
CI on torch-tensorrt 2.13 failed:
  ValueError: Requested using the TS frontend but the TS frontend is not
  available in this build of Torch-TensorRT

The TorchScript frontend has been deprecated since torch-tensorrt 2.6 and is
no longer bundled in some prebuilt wheels (e.g. 2.13+), independent of the
torch version. The existing torch==2.9 skip only covered a different failure
mode (a crash), so add a runtime check against
torch_tensorrt.ENABLED_FEATURES.torchscript_frontend and skip ir="ts" cases
whenever the installed build doesn't have it.
Corrects the previous commit's rationale. The TorchScript frontend is not
removed in torch-tensorrt 2.13 -- the PyPI wheel still ships libtorchtrt.so
and the release notes even include TS bug fixes. What changed is packaging:
the 2.13.0+cu130 wheel on download.pytorch.org is pure Python (608 KB, zero
.so files), while 2.12.1+cu130 bundled libtorchtrt.so. GPU CI installs from
that index via --find-links, so it gets a build without the frontend.

Feature detection via ENABLED_FEATURES.torchscript_frontend stays (it is the
portable check -- has_torchscript_frontend() only exists in newer releases),
but the two skip conditions are now separate marks so the report names the
one that actually applies instead of a misleading combined message.
…peed

The call comes from DeepSpeed's ZeRO-3 checkpointing; the API appears nowhere
in Lightning's source or tests, so there is nothing to migrate on our side.
The 2.13.0+cu130 wheel on download.pytorch.org is pure Python (608 KB, zero
.so files); 2.12.1+cu130 bundled libtorchtrt.so. Since a local version sorts
above the plain release, the find-links entry always won and the TorchScript
frontend went missing. PyPI's 2.13.0 ships the libraries and is likewise a
CUDA 13 build.
@bhimrazy
bhimrazy force-pushed the ci/bump-torch-tensorrt-ceiling branch from de301ec to ae297fe Compare August 9, 2026 13:52
torch 2.13 renamed the `*_tensor` collectives to `*_single`, and DeepSpeed's
backend calls both `all_gather_into_tensor` and `reduce_scatter_tensor` from
deepspeed/comm/torch.py, so filtering one message at a time is whack-a-mole.
Filter on the module instead, matching the existing ddp_comm_hooks entry.

Bumping DeepSpeed would not help: 0.19.4 still binds
torch.distributed.reduce_scatter_tensor via hasattr and has no migration to
the new names.
The earlier module-based filter (`deepspeed.comm.torch`) never matched:
`typing_extensions.deprecated()` uses stacklevel=2, which attributes the
warning to whoever called the deprecated function, and every collective is
wrapped by torch's own `c10d_logger`, so that's always the immediate caller
- not DeepSpeed. A module filter scoped to `torch.distributed.c10d_logger`
would work but also swallow any *other* collective deprecation raised through
that same wrapper, which is broader than intended.

Match the two known messages instead, same as the other entries in this list.
Verified locally against torch 2.13 (CPU-only) with a fake DeepSpeed-shaped
caller.
@bhimrazy bhimrazy changed the title ci: bump torch ceiling to <2.14.0 and fix torch 2.13 fallout ci: bump torch ceiling to <2.14.0 and fix torch-tensorrt/DeepSpeed fallout Aug 11, 2026
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.

2 participants