Skip to content

Support torch 2.11+ and Python 3.13 and 3.14 - #40

Open
M-Colley wants to merge 1 commit into
AdaptiveMotorControlLab:mainfrom
M-Colley:support-newer-torch
Open

M-Colley wants to merge 1 commit into
AdaptiveMotorControlLab:mainfrom
M-Colley:support-newer-torch

Conversation

@M-Colley

@M-Colley M-Colley commented Nov 3, 2026

Copy link
Copy Markdown

This lifts the torch<2.11 / torchvision<0.26 caps from #38 and the <3.13 Python cap. FMPose3D gives the same results on torch 2.15 as on torch 2.10, and no code changes were needed.

Why: FMPose3D currently cannot be installed next to packages that need torch 2.11 or newer, or on Python 3.13 and 3.14. One example is MyoSuite's mjlab backend, which needs torch>=2.13; we would like to retarget FMPose3D poses onto its musculoskeletal models.

The CUDA 13 driver concern from #38

From torch 2.11 on, PyPI's default Linux wheels bring a CUDA 13 runtime, which needs an R580+ driver. On an older driver the fallback to the CPU is not silent:

  • torch turns the driver error into a warning: "CUDA initialization: The NVIDIA driver on your system is too old (found version …). Please update your GPU driver … Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver."
  • The warning comes from c10/cuda/CUDAFunctions.cpp (device_count) and is unchanged from v2.11.0 to v2.15.0.
  • FMPose3D then runs on the CPU.

The README's PyTorch/CUDA note still described the old torch<2.5 pin. It now explains this and shows how to install a CUDA 12 build first, with --index-url https://download.pytorch.org/whl/cu126; that index has torch up to 2.14.1.

Changes

  • pyproject.toml: torch>=2.4.1 and torchvision>=0.19.1, with no upper bounds. requires-python = ">=3.10", plus classifiers for Python 3.11 to 3.14.
  • README.md: the PyTorch/CUDA note above, and "Python 3.10 or newer".
  • .github/workflows/build.yaml:
    • The floor job installed torch 2.4.0, which does not satisfy torch>=2.4.1. So pip install '.[dev]' replaced it with the newest allowed torch, and the floor was never tested. It now installs 2.4.1.
    • torchvision is installed with torch from the CPU index, so the two builds match.
    • A new job runs the newest torch (2.15.0) on Python 3.14. The CPU index has Linux wheels for torch 2.15.0 and torchvision 0.29.0 there.

Testing

All runs used Windows and CPU builds.

torch 2.10.0, Py 3.12 torch 2.15.0, Py 3.12 torch 2.15.0, Py 3.13 torch 2.15.0, Py 3.14
pytest -m "not functional and not network" 116 passed, 7 skipped, 1 failed* same same same
pytest -m functional (weights from HF and Google Drive) 18 passed, 6 skipped 18 passed, 6 skipped 18 passed, 6 skipped 18 passed, 6 skipped

* test_loss_decreases_over_steps, which draws unseeded noise. It failed in 2 of 10 runs on torch 2.10 and 1 of 10 on torch 2.15. The 6 skips are the animal pipeline, which needs DeepLabCut (not installed).

Seeded outputs, torch 2.15 against torch 2.10:

  • 3D lifting of fixed 2D keypoints (8 frames, seed=0): at most 3.9e-7 m apart on Python 3.12, 3.13 and 3.14. The poses reach up to 1.5 m.
  • End to end on demo/images/running.png (YOLO, HRNet and lifting, seed=0): identical 2D keypoints and scores, and 3D poses at most 1.8e-7 m apart.

Not tested:

  • CUDA builds on a GPU;
  • Linux and macOS;
  • the animal pipeline;
  • torch 2.11 to 2.14 individually;
  • the Human3.6M evaluation (I don't have the dataset).

Seen while testing, not changed here

  • Flaky test: test_loss_decreases_over_steps fails now and then on any torch version. Seeding it would make it deterministic.
  • Unmarked network test: tests/test_demo_human.py::test_2d_pose_estimation downloads the HRNet and YOLO weights from Google Drive, and pip-installs gdown at runtime, but is not marked network. In a venv without pip, such as one made by uv, it fails with ModuleNotFoundError: gdown.
  • CI never fails on tests: the pytest step has continue-on-error: true, so test failures don't fail the job.

I can open separate PRs for any of these.

🤖 Generated with Claude Code

Lift the torch<2.11 / torchvision<0.26 caps and the <3.13 Python cap.
FMPose3D gives the same results on torch 2.15 as on 2.10: seeded 3D
lifting differs by at most 3.9e-7 m, and the end-to-end demo image gives
identical 2D keypoints and 3D poses within 1.8e-7 m. On a driver too old
for the CUDA 13 wheels of torch 2.11+, torch warns and runs on the CPU;
the README's PyTorch note now says so and shows how to install a CUDA 12
build first.

CI: the floor job installed torch 2.4.0, which does not satisfy
torch>=2.4.1, so pip replaced it with the newest allowed torch. It now
installs 2.4.1, torchvision comes from the same CPU index as torch, and
a new job runs torch 2.15.0 on Python 3.14.
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.

1 participant