Skip to content

Conversation

@PetarTerziev-UL
Copy link

@PetarTerziev-UL PetarTerziev-UL commented Nov 27, 2025

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.

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 27, 2025

🔗 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 Failures

As of commit c1adb09 with merge base 488d761 (image):

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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 27, 2025
@PetarTerziev-UL
Copy link
Author

I need to add a "release notes: misc" label, but I don't seem to have the ability to.

@PetarTerziev-UL
Copy link
Author

the tests under examples/models/llama3_2_vision/preprocess hang on a call into AOTInductor when torch nightly is installed.

Need to look into this further.

@PetarTerziev-UL
Copy link
Author

the tests under examples/models/llama3_2_vision/preprocess hang on a call into AOTInductor when torch nightly is installed.

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.

@PetarTerziev-UL PetarTerziev-UL marked this pull request as ready for review December 1, 2025 15:10
@mergennachin mergennachin added ciflow/trunk ciflow/binaries ciflow/binaries/all Release PRs with this label will build wheels for all python versions labels Dec 1, 2025
@mergennachin mergennachin added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Dec 1, 2025
Copy link
Contributor

Copilot AI left a 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.13 to <3.14 in 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
Copy link

Copilot AI Dec 1, 2025

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').

Suggested change
# 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

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
]

# Python dependencies required for use.
# coremltools has issue with python 3.13, see https://github.com/apple/coremltools/issues/2487
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this comment?

@larryliu0820 larryliu0820 added the release notes: misc Miscellaneous label Dec 1, 2025
@larryliu0820
Copy link
Contributor

@PetarTerziev-UL can you please bump the nightly version of pytorch to 1122 instead? I think the nightly job failed to build 1124 nightly.

@pytorch-bot pytorch-bot bot removed ciflow/trunk ciflow/binaries ciflow/binaries/all Release PRs with this label will build wheels for all python versions labels Dec 2, 2025
@PetarTerziev-UL
Copy link
Author

@PetarTerziev-UL can you please bump the nightly version of pytorch to 1122 instead? I think the nightly job failed to build 1124 nightly.

Done! Is there a way to check nightly job statuses? I was looking at wheels available at download.pytorch.org and drawing assumptions.

Copilot AI review requested due to automatic review settings December 3, 2025 07:59
Copy link
Contributor

Copilot AI left a 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"]
Copy link

Copilot AI Dec 3, 2025

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.

Suggested change
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
target-version = ["py310", "py311", "py312", "py313"]

Copilot uses AI. Check for mistakes.
@PetarTerziev-UL
Copy link
Author

PetarTerziev-UL commented Dec 3, 2025

@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 torch_pin.py version.

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.

Copilot AI review requested due to automatic review settings December 3, 2025 12:27
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 4, 2025 13:16
Copy link
Contributor

Copilot AI left a 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.

@PetarTerziev-UL
Copy link
Author

PetarTerziev-UL commented Dec 4, 2025

@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 --no-use-pep517 option for install. Please see relevant changelogs. I fear this means that next time the container needs updating, it will require a full migration to a pyproject.toml based build. Though I guess everywhere a new conda env is created will suffer the same problem.

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 setup-py instead of python-build-pacakge based builds. And as the projects are quite intertwined, migrating is quite an undertaking. I guess as a workaround we could force conda to install pip 25.2.

Copy link
Contributor

Copilot AI left a 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. release notes: misc Miscellaneous

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Python 3.13

3 participants