Skip to content

[Versioning] Require torch 2.11 or later and deprecate torch<2.13 - #4595

Draft
theap06 wants to merge 2 commits into
mainfrom
versioning/torch-2.11-floor
Draft

theap06 wants to merge 2 commits into
mainfrom
versioning/torch-2.11-floor

Conversation

@theap06

@theap06 theap06 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Raises the torch floor from 2.1 to 2.11 and deprecates torch 2.11 and 2.12.

  • pyproject.toml requires torch>=2.11.0a0. The tensordict range (>=0.14.2,<0.15.0) is unchanged, so pip resolves tensordict 0.14.3 on torch 2.11 and 2.12.

  • Importing torchrl on torch<2.13 raises a DeprecationWarning that names v0.17 as the release that requires torch>=2.13 (_warn_if_torch_deprecated in torchrl/_utils.py, tested in test/test_utils.py). This follows the two-release deprecation window.

  • README and docs/source/index.rst state the new floor and the deprecation.

  • test_native_auto_reset_compile_step_and_maybe_reset now requires torch 2.12: on 2.11, Dynamo cannot trace the self.__dict__.setdefault of the EnvBase key caches.

  • olddeps runs the declared minimum: torch 2.11.0 and torchvision 0.26.0 from the cu126 index on osdc-cuda:cuda12.6.3-cudnn-devel-ubuntu24.04. Moving it off torch 2.1 needed the following fixes:

    • install hoptorch, because the job installs torchrl with --no-deps;
    • drop the setuptools<82 pin, which torch 2.1 needed;
    • install tensordict<0.15 on release runs;
    • link mujoco-py from the checkout and install libglew-dev;
    • add an autouse fixture that resets the interaction type between tests, because the serial olddeps run let one leak into test_exploration.
  • CLAUDE.md 7c describes olddeps as the minimum supported versions.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Testing

Local, macOS arm64, Python 3.12:

  • torch 2.11.0 + tensordict 0.14.3:
    • test_utils, test_auto_reset, test_exploration: 334 passed.
    • test_ppo, test_sac, test_iql, test_specs, test_distributions: 5937 passed.
    • The deprecation warning fires on import, and the auto-reset compile test skips.
  • torch 2.13.0 + tensordict 0.14.3: no deprecation warning, the auto-reset compile test runs and passes, and test_import_warns_on_deprecated_torch passes.
  • uv pip compile (x86_64 manylinux, Python 3.12): tensordict 0.14.3 on torch 2.11 and 2.12, 0.15.1 on 2.13. The vla extra resolves lerobot 0.6.1 on torch 2.11.

Known limitations

  • torchrl._torchrl is built against one torch ABI. A wheel built against a newer torch loads without its C++ extension on torch 2.11, so PrioritizedReplayBuffer raises SumSegmentTreeFp32 is not available ([BUG] SumSegmentTreeFp32 not available #3508). Isaac Lab 3.0 users who need prioritized replay have to build torchrl from source until wheels are built per torch version.
  • The unittests-isaaclab job still uses the isaac-lab:2.3.0 image (Isaac Sim 5.1, torch 2.7, below this floor; torchrl is installed with --no-deps). Testing Isaac Lab 3.0 needs a follow-up job.
  • The CI tensordict pin (.github/ci_commit_pins/tensordict.txt, from before tensordict required torch 2.13) stays. Unpinning and moving to tensordict 0.15 belongs with the torch 2.13 floor in v0.17.
  • Version gates below 2.11 (implement_for("torch", ...) and TORCH_VERSION checks) are now dead code. Removing them is a follow-up.

Checklist

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

Isaac Lab v3.0.0 pins torch==2.11.0 and ships a torchrl extra, so the floor
moves from 2.1 to 2.11 rather than 2.13. torch 2.11 and 2.12 are deprecated:
importing torchrl on them raises a DeprecationWarning that names v0.17 as the
release that requires torch>=2.13. The tensordict range is unchanged, so pip
resolves tensordict 0.14.x on these versions.

The native auto-reset compile test now requires torch 2.12, the first release
where Dynamo traces the EnvBase key caches.
olddeps runs the declared minimum: torch 2.11.0 and torchvision 0.26.0 from
the cu126 index on the cuda12.6.3 image, with hoptorch installed (the job
installs with --no-deps) and the torch 2.1 setuptools<82 pin dropped. Release
runs install tensordict<0.15, since 0.15 requires torch 2.13. mujoco-py now
links from the checkout and gets libglew-dev. An autouse fixture resets the
interaction type between tests, because the serial olddeps run let one leak
into test_exploration. CLAUDE.md describes olddeps as the minimum versions.
@theap06 theap06 added versioning Versioning change (version number etc) Environments Adds or modifies an environment wrapper ci/olddeps Run the tests-olddeps suite (oldest supported torch) on this PR labels Oct 20, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4595

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Unclassified Failure

As of commit 5069dd0 with merge base e7a05a7 (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 20, 2026
@github-actions github-actions Bot added Documentation Improvements or additions to documentation CI Has to do with CI setup (e.g. wheels & builds, tests...) labels Oct 20, 2026
@theap06
theap06 requested a review from bsprenger October 20, 2026 06:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/olddeps Run the tests-olddeps suite (oldest supported torch) on this PR CI Has to do with CI setup (e.g. wheels & builds, tests...) CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Documentation Improvements or additions to documentation Environments Adds or modifies an environment wrapper versioning Versioning change (version number etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant