-
Notifications
You must be signed in to change notification settings - Fork 756
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
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. ⏳ 160 Pending, 2 Unrelated FailuresAs of commit 56002a2 with merge base 31aa8d3 ( 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
a551285 to
c1adb09
Compare
c1adb09 to
c4f39c7
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 22 out of 22 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Compile-time switch to control how assertions are logged inside CUDA kernels. | ||
| // If C10_CUDA_VERBOSE_ASSERT is defined, CUDA_KERNEL_ASSERT_VERBOSE will | ||
| // take addition information passed to the macro and forward them to |
Copilot
AI
Dec 11, 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.
Corrected spelling of 'addition' to 'additional'.
| // take addition information passed to the macro and forward them to | |
| // take additional information passed to the macro and forward them to |
|
Do you need specifically torch 11-22 nightly? I am trying to upgrade to 11-20 in this PR |
@mergennachin Nope, that's also fine. Happy to wait for that to go in first? |
Upgrading the torch pin, that would be useful for #16004 Also incorporating issues found by @PetarTerziev-UL
c4f39c7 to
1d52f89
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.
1d52f89 to
56002a2
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.
|
To add the ciflow label This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
Seems to cause windows issue https://github.com/pytorch/executorch/actions/runs/20177557359/job/57929443045 |
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.