Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions docs/guides/integration/pytorch.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,34 @@ Next, update the `pyproject.toml` to point `torch` and `torchvision` to the desi

As a complete example, the following project would use PyTorch's CPU-only builds on all platforms:

!!! note

The CPU index provides wheels with different local version suffixes depending on the platform:
`+cpu` for x86_64 (Linux) and AMD64 (Windows), but no suffix for aarch64 (Linux) and arm64 (macOS).
As such, `torchvision` requires platform-specific version specifiers to match the available wheels.

Comment on lines +247 to +252
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CC @atalman just to confirm that this is intentional

Copy link
Copy Markdown
Member

@konstin konstin Jan 12, 2026

Choose a reason for hiding this comment

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

For context, that is the list of wheels for torch 2.9.1 on Python 3.14:

torch-2.9.1+cpu-cp314-cp314-manylinux_2_28_aarch64.whl
torch-2.9.1+cpu-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+cpu-cp314-cp314-win_amd64.whl
torch-2.9.1+cpu-cp314-cp314t-manylinux_2_28_aarch64.whl
torch-2.9.1+cpu-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+cpu-cp314-cp314t-win_amd64.whl
torch-2.9.1+cu126-cp314-cp314-manylinux_2_28_aarch64.whl
torch-2.9.1+cu126-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+cu126-cp314-cp314-win_amd64.whl
torch-2.9.1+cu126-cp314-cp314t-manylinux_2_28_aarch64.whl
torch-2.9.1+cu126-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+cu126-cp314-cp314t-win_amd64.whl
torch-2.9.1+cu128-cp314-cp314-manylinux_2_28_aarch64.whl
torch-2.9.1+cu128-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+cu128-cp314-cp314-win_amd64.whl
torch-2.9.1+cu128-cp314-cp314t-manylinux_2_28_aarch64.whl
torch-2.9.1+cu128-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+cu128-cp314-cp314t-win_amd64.whl
torch-2.9.1+cu129-cp314-cp314-manylinux_2_28_aarch64.whl
torch-2.9.1+cu129-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+cu129-cp314-cp314t-manylinux_2_28_aarch64.whl
torch-2.9.1+cu129-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+cu130-cp314-cp314-manylinux_2_28_aarch64.whl
torch-2.9.1+cu130-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+cu130-cp314-cp314-win_amd64.whl
torch-2.9.1+cu130-cp314-cp314t-manylinux_2_28_aarch64.whl
torch-2.9.1+cu130-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+cu130-cp314-cp314t-win_amd64.whl
torch-2.9.1+rocm6.3-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+rocm6.3-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+rocm6.4-cp314-cp314-manylinux_2_28_x86_64.whl
torch-2.9.1+rocm6.4-cp314-cp314t-manylinux_2_28_x86_64.whl
torch-2.9.1+xpu-cp314-cp314-linux_x86_64.whl
torch-2.9.1+xpu-cp314-cp314-win_amd64.whl
torch-2.9.1+xpu-cp314-cp314t-linux_x86_64.whl
torch-2.9.1+xpu-cp314-cp314t-win_amd64.whl
torch-2.9.1-cp314-cp314-macosx_11_0_arm64.whl
torch-2.9.1-cp314-cp314t-macosx_11_0_arm64.whl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought this was fixed in pytorch/test-infra#7589, but perhaps there hasn't been a release since then?

Copy link
Copy Markdown
Author

@appleparan appleparan Jan 12, 2026

Choose a reason for hiding this comment

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

Agreed. I'm looking for build log for that.

Note: This should be closed also if this PR is closed

Copy link
Copy Markdown
Author

@appleparan appleparan Jan 12, 2026

Choose a reason for hiding this comment

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

@atalman said in here,

This is the same issue as: pytorch/vision#9249 and its fix for the release 0.25.0 of torchvision.

It's a temporary issue in 0.24.x, so I should close this PR.

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.14.0"
dependencies = [
"torch>=2.9.1",
"torchvision>=0.24.1",
# Linux x86_64
"torchvision==0.24.1+cpu; sys_platform == 'linux' and platform_machine == 'x86_64'",
# Windows x86_64 (AMD64)
"torchvision==0.24.1+cpu; sys_platform == 'win32' and platform_machine == 'AMD64'",
# Linux aarch64, macOS arm64: PyPI default wheel
"torchvision==0.24.1; (sys_platform == 'linux' and platform_machine == 'aarch64') or (sys_platform == 'darwin' and platform_machine == 'arm64')",
]

[tool.uv]
# Add environments constraint to avoid resolution conflicts between dependencies and sources markers.
environments = [
"sys_platform == 'linux' and platform_machine == 'x86_64'",
"sys_platform == 'linux' and platform_machine == 'aarch64'",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
"sys_platform == 'win32' and platform_machine == 'AMD64'",
]

[tool.uv.sources]
Expand Down Expand Up @@ -389,7 +409,12 @@ dependencies = []
[project.optional-dependencies]
cpu = [
"torch>=2.9.1",
"torchvision>=0.24.1",
# Linux x86_64
"torchvision==0.24.1+cpu; sys_platform == 'linux' and platform_machine == 'x86_64'",
# Windows x86_64 (AMD64)
"torchvision==0.24.1+cpu; sys_platform == 'win32' and platform_machine == 'AMD64'",
# Linux aarch64, macOS arm64: PyPI default wheel
"torchvision==0.24.1; (sys_platform == 'linux' and platform_machine == 'aarch64') or (sys_platform == 'darwin' and platform_machine == 'arm64')",
]
cu128 = [
"torch>=2.9.1",
Expand Down
Loading