Skip to content

Upgrade torchax so PyTorch 2.13 can import in CI - #77

Merged
kasper0406 merged 2 commits into
mainfrom
kn/pin-torchax
Aug 15, 2026
Merged

Upgrade torchax so PyTorch 2.13 can import in CI#77
kasper0406 merged 2 commits into
mainfrom
kn/pin-torchax

Conversation

@kasper0406

@kasper0406 kasper0406 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

test-pytorch jobs fail at collection, not during conversion:

torchax/amp.py:118: torch.ops.aten.prod.dim_Dimname
AttributeError: The underlying op of 'aten.prod' has no overload name 'dim_Dimname'

That is the only failure. Collection never reaches the 15 pytorch tests.

Root cause: PyTorch 2.13 removed named-tensor Dimname overloads. Unpinned torch>=2.12.0 + unpinned torchvision resolve to torch 2.13.0 / torchvision 0.28.0. Stable torchax 0.0.13 still indexes aten.prod.dim_Dimname at import time.

Fix: keep current torch/torchvision and pin torchax to the post-fix PyPI nightly 0.0.14.dev20260814 (google/torchax#102, merged 2026-08-07). There is still no stable 0.0.14. An exact pre-release pin is required so hatch/pip will install it without --pre.

This replaces the earlier torch<2.13 cap on this branch.

Test plan

  • hatch run +py=3.12 test-pytorch:python -c "import torch; import torchax; print(torch.__version__)" → torch 2.13.0, torchax 0.0.14.dev20260814
  • hatch run +py=3.12 test-pytorch:pytest tests/pytorch/test_pytorch.py → 15 passed
  • hatch run lint:check
  • CI test-pytorch jobs on this PR

kasper0406 and others added 2 commits August 15, 2026 10:56
PyTorch 2.13 removed named-tensor Dimname overloads such as
aten.prod.dim_Dimname. Unpinned torch>=2.12.0 plus unpinned
torchvision now resolve to torch 2.13.0 / torchvision 0.28.0,
which crash torchax 0.0.13 at import time and fail test-pytorch
collection. Cap both packages at the last compatible pair until
a stable torchax release ships google/torchax#102.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
torchax 0.0.13 still indexes aten.prod.dim_Dimname at import time,
which PyTorch 2.13 removed. Pin torchax to the 0.0.14.dev nightly
that includes google/torchax#102 instead of capping torch<2.13.

Verified locally with torch 2.13.0 / torchvision 0.28.0 / torchax
0.0.14.dev20260814: import succeeds and all 15 pytorch tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kasper0406 kasper0406 changed the title Pin torch<2.13 so torchax can import in CI Upgrade torchax so PyTorch 2.13 can import in CI Aug 15, 2026
@kasper0406
kasper0406 merged commit 7f0e643 into main Aug 15, 2026
4 checks passed
@kasper0406
kasper0406 deleted the kn/pin-torchax branch August 21, 2026 09:47
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