Add Python 3.14 support#20452
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20452
Note: Links to docs will display an error until the docs builds have been completed. ❌ You can merge normally! (2 Unrelated Failures), 2 Unclassified FailuresAs of commit 7d0b246 with merge base 6021a58 ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
1aa78e5 to
c6f4bf3
Compare
Raise requires-python upper bound from <3.14 to <3.15 and add 3.14 to wheel build matrices. coremltools has no cp314 wheels yet, so its dependency gets a python_version < '3.14' marker — the CoreML backend is unavailable on 3.14 until Apple ships compatible wheels. scikit-learn is loosened from ==1.7.1 to >=1.7.1 since 1.7.2+ has cp314 wheels. Bump black from 24.4.2 to 26.3.0 so the linter recognizes py314 as a valid target-version. Bridge PYTHON_EXECUTABLE to Python_EXECUTABLE in CMakeLists.txt in preparation for a future pybind11 3.0 upgrade. pybind11 is kept at v2.13.6 for now — v3.0.x causes runtime segfaults in the pybindings. Python 3.14 is not added to the QNN wheel test matrix because PyTorch's torch.export has a typing introspection bug on 3.14 (typing.Union.__module__). Both are tracked for follow-up. This PR was authored with Claude. Test Plan: - cmake configure and pybinding build succeed (--preset pybind) - lintrunner passes with updated black 26.3.0 - Full CI validation on Python 3.14 will run via the updated wheel build workflows
c6f4bf3 to
0a8fd54
Compare
Summary
Bump pybind11 from v2.13.6 to v3.0.4, which adds Python 3.14 compatibility. Bridge the legacy PYTHON_EXECUTABLE cmake variable to Python_EXECUTABLE so pybind11 3.0's FindPython module picks up the correct interpreter.
Raise requires-python upper bound from <3.14 to <3.15 and add 3.14 to wheel build matrices and the pull request test matrix.
coremltools has no cp314 wheels yet, so its dependency gets a python_version < '3.14' marker — the CoreML backend is unavailable on 3.14 until Apple ships compatible wheels. scikit-learn is loosened from ==1.7.1 to >=1.7.1 since 1.7.2+ has cp314 wheels.
Bump black from 24.4.2 to 26.3.0 so the linter recognizes py314 as a valid target-version in pyproject.toml.
py::enum_ usage in two pybinding files is deprecated in pybind11 3.0 but still functional; migration to py::native_enum can follow separately.
Fixes #16750
This PR was authored with Claude.
Test Plan