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.11 support #4490
Add Python 3.11 support #4490
Conversation
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Building on 3.11 fails with: (from https://github.com/onnx/onnx/actions/runs/3002313403/jobs/4819386269)
Looks like the issue is in third_party/pybind11, and it is fixed with pybind11 2.10.0: pybind/pybind11@42a8e31. |
Thanks for the update! Builds and tests now pass on Mac. The only remaining issue on Mac is missing 3.11 support for onnxruntime (microsoft/onnxruntime#13482) (From https://github.com/onnx/onnx/actions/runs/3415387401/jobs/5684459897)
On the other hand, builds on Linux fails as the pip path is incorrect (From https://github.com/onnx/onnx/actions/runs/3415387398/jobs/5684459657)
The cause seems a mismatch between the Python version (3.11-dev) and the shell variable |
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Hi @yan12125, thank you for the pointers! I think now all Python 3.11 related CIs have passed. That is to say, at least now the latest main branch of ONNX should work with Python 3.11. |
Two questions:
|
Python 3.7's EOL is (27 Jun 2023) so ONNX won't deprecate 3.7 in the near future (at least upcoming 1.13 release will still support it).
|
Glad to help, and it's great to see ONNX works on 3.11! Will the pybind11 update (#4635) be part of 1.13? We build python-onnx from sources, and it will be great if the new version can be built on Python 3.11 out of box. |
Yes it will! |
FYI, it is possible to depend on different NumPy version on Python3.7 and 3.11: In requirements.txt, we can write
which is called "requirement specifiers" |
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Thank you @daquexian for letting me know. Previously I was worried that using inconsistent dependency might be a potential issue, but in fact ONNX itself does not have strong NumPy version requirement. In addition, we do see there are quite a few issues related to Python 3.11 support. Adding Python 3.11 support early can prevent a lot of similar issues coming up in the future. After discussion with the ONNX infra team, we think we can add Python 3.11 support in the upcoming ONNX 1.13 release. |
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
… jcw/add-py3.11 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> # Conflicts: # .github/workflows/manylinux/entrypoint.sh
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
* add Python 3.11 support Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * install higher version of numpy for 3.11 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * typo Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * use 3.11 instead of 3.11-dev Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * cp311-cp311 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * specify requirement for 3.11 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * different mini numpy requirement Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * only keep Windows Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * typo Signed-off-by: jcwchen <jacky82226@gmail.com> * add 3.7m back Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * remove comma Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: jcwchen <jacky82226@gmail.com>
* add Python 3.11 support Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * install higher version of numpy for 3.11 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * typo Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * use 3.11 instead of 3.11-dev Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * cp311-cp311 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * specify requirement for 3.11 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * different mini numpy requirement Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * only keep Windows Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * typo Signed-off-by: jcwchen <jacky82226@gmail.com> * add 3.7m back Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * remove comma Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: jcwchen <jacky82226@gmail.com>
Description
Add Python 3.11 support in the future. For now, verify Python 3.11 support first.
Motivation and Context
Closes #4387.