Skip to content

build: lock torch 2.12 and cap <2.13#1

Merged
rbavery merged 2 commits into
mainfrom
ryan/torch-2.12-support
Jun 27, 2026
Merged

build: lock torch 2.12 and cap <2.13#1
rbavery merged 2 commits into
mainfrom
ryan/torch-2.12-support

Conversation

@rbavery

@rbavery rbavery commented Jun 27, 2026

Copy link
Copy Markdown
Member

Locks wherobots-export against the latest released torch (2.12.1) and caps it at <2.13 so an untested torch 2.13 can't be pulled in automatically — letting downstream projects (usda-firecon's FireCon pipeline) move off torch 2.8.

  • Constrain torch>=2.8,<2.13; add uv.lock resolving torch 2.12.1 from the pytorch-cpu index (wiring up the previously-declared index via [tool.uv.sources]).
  • Add tests/test_export.py covering the .pt2 export path (savetorch.exportpackage_pt2) with a load_pt2 round-trip and dynamic shapes, plus a dev group (pytest, numpy).
  • Add a test workflow running the suite against the locked torch (uv run --frozen).

The torch.export / package_pt2 / load_pt2 API is unchanged across 2.8–2.12, so no library code changed. The floor stays torch>=2.8 so consumers on older torch (e.g. usda-firecon's onboarding at torch 2.8) still resolve; the lock pins the latest.

Downstream follow-up (separate usda-firecon PR): usda-firecon tracks this repo's main; once this lands, uv lock --upgrade-package wherobots-export there picks up the new commit, but its onboarding sub-package pins torchvision==0.23 (→ torch 2.8) and needs its own bump to a torchvision paired with the torch it targets (0.25 for 2.10, 0.27 for 2.12).

Agent details
  • Verified end-to-end on torch 2.12.1: save().pt2, then load_pt2()ExportedProgram.module() reproduces eager output (including a dynamic batch dim that differs from the export-time example).
  • Test suite passes locally on both 2.8.0 (floor) and 2.12.1 (locked); CI runs against the locked 2.12.1.
  • No changes under src/ — the export API surface is stable across the range.
  • requires-python unchanged (==3.12.*).

@rbavery rbavery marked this pull request as ready for review June 27, 2026 00:34

@salty-hambot salty-hambot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by Salty Hambot 🤖🧂

Two real traps in a CI-versioning PR: the --upgrade-package "torch<2.9" flag doesn't pin anything (so your 'floor' leg quietly tests whatever's locked), and the whole suite hangs off a private _package import that's liable to vanish mid-range. Fix those and the green checkmark will actually mean something.

2 finding(s) posted.
💬 To request a re-review, comment @salty-hambot review

Comment thread .github/workflows/test.yml
Comment thread tests/test_export.py
torch.export / package_pt2 / load_pt2 API is unchanged across 2.8-2.12,
so no library changes were needed. Floor stays torch>=2.8 to keep older
consumers (e.g. usda-firecon at torch 2.8) resolvable; uv.lock pins the
latest released torch (2.12.1) from the pytorch-cpu index.
@rbavery rbavery force-pushed the ryan/torch-2.12-support branch from 85555ea to 5be0501 Compare June 27, 2026 00:47
@rbavery rbavery changed the title build: lock torch 2.12 and add test CI build: lock torch 2.12 and cap <2.13 Jun 27, 2026
@rbavery rbavery marked this pull request as draft June 27, 2026 00:49
@rbavery rbavery force-pushed the ryan/torch-2.12-support branch from 5be0501 to 64c1d17 Compare June 27, 2026 01:20
@rbavery rbavery marked this pull request as ready for review June 27, 2026 02:15
@rbavery rbavery merged commit 18673fc into main Jun 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant