Skip to content
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

Python 3.12 Wheels #15856

Closed
theoparis opened this issue Dec 8, 2023 · 9 comments · Fixed by #16424
Closed

Python 3.12 Wheels #15856

theoparis opened this issue Dec 8, 2023 · 9 comments · Fixed by #16424
Assignees
Labels
enhancement ➕ New feature or request

Comments

@theoparis
Copy link

theoparis commented Dec 8, 2023

Request description

Add pre-built python 3.12 wheels

What component(s) does this issue relate to?

Python

Additional context

I couldn't find an existing issue that mentions python 3.12 since it was released in october.

> python3.12 -m pip install \
  --find-links https://iree.dev/pip-release-links.html \
  --upgrade iree-compiler
Looking in links: https://iree.dev/pip-release-links.html
ERROR: Could not find a version that satisfies the requirement iree-compiler (from versions: none)
ERROR: No matching distribution found for iree-compiler
@theoparis theoparis added the enhancement ➕ New feature or request label Dec 8, 2023
@stellaraccident stellaraccident self-assigned this Feb 15, 2024
@stellaraccident
Copy link
Collaborator

Looks like our minimal deps are available on pypi (still missing some optional, non-nightly testing deps), so I'm trying to enable the 3.12 wheels.

@stellaraccident
Copy link
Collaborator

We're going to need a better Python version testing story soon. Currently we test the oldest version in regular CI and leave later versions to release. This has been practical for much of the 3.x series, but we're entering a period of high/feature changes with 3.12/3.13. I expect we are going to need to more aggressively test newer versions as part of the regular build before too much longer.

@ScottTodd
Copy link
Member

We're going to need a better Python version testing story soon. Currently we test the oldest version in regular CI and leave later versions to release. This has been practical for much of the 3.x series, but we're entering a period of high/feature changes with 3.12/3.13. I expect we are going to need to more aggressively test newer versions as part of the regular build before too much longer.

Are the bindings/python tests (compiler and runtime) representative enough for that, or would integration / full-model tests be needed too? BTW, I had #15878 open to run some of the Python tests in more jobs.

@stellaraccident
Copy link
Collaborator

We're going to need a better Python version testing story soon. Currently we test the oldest version in regular CI and leave later versions to release. This has been practical for much of the 3.x series, but we're entering a period of high/feature changes with 3.12/3.13. I expect we are going to need to more aggressively test newer versions as part of the regular build before too much longer.

Are the bindings/python tests (compiler and runtime) representative enough for that, or would integration / full-model tests be needed too? BTW, I had #15878 open to run some of the Python tests in more jobs.

They are representative enough to push wheels for newer versions, but we should be running more framework level tests on the more recent versions. There's chicken and egg, though: for example, PyTorch for 3.12 is only in nightly right now, and onnx won't publish wheels until their next release.

Mainly just jotting down thoughts.

I also want to better modularize the Python build. There is no reason that we need to build the full C++ codebase to build Python wheels. Both the compiler and runtime wheels should be able to be built against our dev packages, as they just depend on public C headers (although the runtime is small enough and we get value from a more exotic setup because we build different variants and can LTO).

Would make the testing story easier...

stellaraccident added a commit that referenced this issue Feb 15, 2024
I've manually built and tested on 3.12. Included a small test change to
not use a long deprecated and now removed method.

Fixes #15856
@stellaraccident
Copy link
Collaborator

Leaving this open until we verify they built.

@stellaraccident
Copy link
Collaborator

If we better modularized the python build, we could re-arrange the PkgCI into a step to build the native dev packages sans Python on big CPU runners. Then we could have N={python versions} to build and run unit tests for each Python version. We could have a flag in the matrix that would control which ones actually got published as artifacts (i.e. maybe just publish one version for presubmit) for downstream jobs to consume. These python build/testers could run on standard GH action runners. Downstream integration tests could depend on the built wheels.

@ScottTodd
Copy link
Member

If we better modularized the python build, we could re-arrange the PkgCI into a step to build the native dev packages sans Python on big CPU runners.

Not sure if this is quite what you had in mind, but I had started forking build_linux_packages.sh into build_linux_dist.sh on main...ScottTodd:iree:infra-linux-dist. I was hoping that reusing the same toolchain files (e.g. https://github.com/openxla/iree/blob/main/build_tools/pkgci/linux_toolchain_release.cmake) would help with cache hits and compatibility between the 'native' build and the 'python package' builds.

@stellaraccident
Copy link
Collaborator

I think we can actually completely forgo most of the gunk in build_linux_packages.sh (all of the docker stuff). For other projects, I'm either using GHA action runners that are already the right OS or telling GHA to run in the context of the manylinux docker image. Makes it really, really simple.

But +1 on re-using the toolchain and hard fought for flags.

Anyway, might give it some more thought.

@ScottTodd
Copy link
Member

Python 3.12 wheels seem to be working well. I'll open a new issue for Python 3.13.

There are some good points to rediscover in here about refactoring the scripts and workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ➕ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants