Skip to content

Python 3.13 support for PyTorch #130249

@rgommers

Description

@rgommers

Update Jan 13 2025:

Now that enablement in trunk has been done and 3.13/3.13t are officially released, revamping this to be a support matrix for what works today and what we plan on adding:

Source build

OS 3.13 3.13t
Linux
MacOS
Windows

Nightlies (As of Jan 13 2025):

OS 3.13 3.13t
Linux
Linux Aarch64
MacOS
Windows

Release 2.5.0

OS 3.13 3.13t
Linux
Linux Aarch64
MacOS
Windows

Release 2.5.1

OS 3.13 3.13t
Linux
Linux Aarch64
MacOS
Windows

Release 2.6

OS 3.13 3.13t
Linux
Linux Aarch64
MacOS
Windows

Release 2.7 (tentative)

OS 3.13 3.13t
Linux
Linux Aarch64
MacOS
Windows

Original post

Python 3.13 is coming out in the near future - RC1 is planned for July 30 (first point at which the ABI is stable and packages can start releasing wheels for 3.13), and the fina release is planned for 1 Oct 2024 (see PEP 719).

I see that work on supporting 3.13 has started (gh-121979, gh-130030; Cc @atalman), but I couldn't find a tracking issue for the current status of it, so I thought it'd be useful to have one. The other motivation to open an issue now: we're working on implementing support for free-threaded CPython (a.k.a. "no-GIL", PEP 703) and are interested to start work on a first package that depends on PyTorch. Support for the default CPython 3.13 is a pre-requisite for starting that work though.

Here is a hopefully useful breakdown in steps to support Python 3.13:

Python 3.13 CD:

Python 3.13 CI & torch.compile:

torch.compile is broken out separately based on the history for Python 3.12 (see gh-110436 for general support, and gh-120233 for torch.compile).

The status of dependencies should be fine AFAIK. E.g. Pybind11 2.13.1 has full support, and SymPy 1.13.0rc4 has too (xref sympy#26692).

For free-threaded support we should probably open a separate tracking issue once regular 3.13 support is in good shape. I'll note here that Pybind11 and NumPy already have mostly-complete support for it, and NumPy should release (experimental) wheels shortly after Python 3.13.0rc1).

cc @malfet @seemethere @pytorch/pytorch-dev-infra @albanD

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: ciRelated to continuous integrationmodule: python frontendFor issues relating to PyTorch's Python frontendtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions