-
Notifications
You must be signed in to change notification settings - Fork 752
Add Python 3.13 support #16004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Python 3.13 support #16004
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16004
Note: Links to docs will display an error until the docs builds have been completed. ❌ 14 New Failures, 5 Cancelled Jobs, 2 Unrelated FailuresAs of commit c1adb09 with merge base 488d761 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOBS - The following jobs were cancelled. Please retry:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
I need to add a "release notes: misc" label, but I don't seem to have the ability to. |
|
the tests under Need to look into this further. |
Things are better in with a newer nightly build of torch, so I've bumped the pinned version as part of this PR too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Python 3.13 support to ExecuTorch now that coremltools 9.0 (which supports Python 3.13) is available. The changes update version constraints, documentation, and CI/CD workflows to enable building wheels for Python 3.13.
Key changes:
- Update Python version constraint from
<3.13to<3.14in pyproject.toml - Add Python 3.13 to wheel building workflows and documentation
- Remove Python 3.13 warning from CoreML troubleshooting documentation
- Update nightly version pin (unrelated maintenance update)
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Add Python 3.13 classifier, update requires-python constraint to <3.14, add py313 to ruff target-version |
| torch_pin.py | Update nightly version from dev20251025 to dev20251124 |
| docs/source/*.md | Update Python version requirements from 3.10-3.12 to 3.10-3.13 across multiple documentation files |
| docs/source/backends/coreml/coreml-troubleshooting.md | Remove outdated Python 3.13 compatibility warning |
| README-wheel.md | Add Python 3.13 to list of supported versions |
| .github/workflows/*.yml | Add "3.13" to Python version matrices for wheel building workflows |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pyproject.toml
Outdated
| ] | ||
|
|
||
| # Python dependencies required for use. | ||
| # coremltools has issue with python 3.13, see https://github.com/apple/coremltools/issues/2487 |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is now outdated since Python 3.13 is being supported. Either remove the comment entirely or update it to reflect that the issue was resolved in coremltools 9.0 (e.g., '# coremltools 9.0+ supports python 3.13, see apple/coremltools#2487').
| # coremltools has issue with python 3.13, see https://github.com/apple/coremltools/issues/2487 | |
| # coremltools 9.0+ supports python 3.13, see https://github.com/apple/coremltools/issues/2487 |
pyproject.toml
Outdated
| ] | ||
|
|
||
| # Python dependencies required for use. | ||
| # coremltools has issue with python 3.13, see https://github.com/apple/coremltools/issues/2487 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this comment?
|
@PetarTerziev-UL can you please bump the nightly version of pytorch to 1122 instead? I think the nightly job failed to build 1124 nightly. |
7fbf70d to
6bf40e1
Compare
Done! Is there a way to check nightly job statuses? I was looking at wheels available at download.pytorch.org and drawing assumptions. |
6bf40e1 to
85b5a4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # specified by `requires-python`. TODO: Remove this once we support these older | ||
| # versions of python and can expand the `requires-python` range. | ||
| target-version = ["py38", "py39", "py310", "py311", "py312"] | ||
| target-version = ["py38", "py39", "py310", "py311", "py312", "py313"] |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target-version includes py38 and py39, but requires-python specifies >=3.10. This mismatch means Ruff is configured to support Python versions below the project's minimum requirement. Either remove py38 and py39 from target-version to align with requires-python, or update the comment on line 132-133 to explain why these older versions are still targeted.
| target-version = ["py38", "py39", "py310", "py311", "py312", "py313"] | |
| target-version = ["py310", "py311", "py312", "py313"] |
85b5a4f to
78aaa50
Compare
|
@larryliu0820 I've rolled back to an earlier nightly version still. Looks like the failing CI job ends up with a versions of torch and torchaudio which are incompatible with each other down to an API change in C10 Logging. However, after looking at the test script itself, it seems like moshi requires torch <2.8,>=2.2.0 which is in conflict with building executorch agaist a nightly build of torch. I'm looking further into this... EDIT: Actually, I just found out that the Linux docker container also has a git hash that pins a torch version. Will can/will update that too to match the It'd also be good to try dropping the nightly bump commit and running the CI, to see whether the hang that prompted me to update that was unique to my local system. Then the nightly bump can go into a separate PR as it is turning out to be a bit of a can of worms 😁 EDIT 2: I've changed the version of torch the Docker container to match the nightly I bumped to originally. |
78aaa50 to
cb0ecb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ee54d95 to
2e7195f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2e7195f to
9f1a282
Compare
|
@larryliu0820 (and anyone else interested) I've dropped the nightly update commit. It triggers a new docker container build, which then installs the latest pip (25.3) which removes the I'll raise an issue in the repo and update this comment with it. In the mean time, I hope that the problem which prompted me to bump the nightly version was unique to me, and this can get merged. EDIT: I see that torch, audio, and vision (probably others too) use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a58a23c to
a551285
Compare
coremltools versions prior to 9.0 did not support Python 3.13. Now executorch uses 9.0, we can finally enable building wheels with Python 3.13.
The Python tests in examples/models/lama3_2_vision/preprocess/test_preprocess was hanging on MacOS with the previous nightly pinned here when installed with Python 3.13.
25.3 removes the --no-use-pep517 argument, and this breaks the Docker builds as torchaudio and torchvision cannot build without it.
a551285 to
c1adb09
Compare
Summary
coremltools versions prior to 9.0 did not support Python 3.13. Now executorch uses 9.0, we can finally enable building wheels with Python 3.13.
Fixes #8292
Test plan
Python test suite ran and compared against a dev install of the target branchh in a 3.12 virtual environment.