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

[wip] limited api wheels #2051

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

[wip] limited api wheels #2051

wants to merge 9 commits into from

Conversation

minrk
Copy link
Member

@minrk minrk commented Dec 3, 2024

try building wheels with limited API

requires Cython 3.1, currently in prerelease

see #2010 for more about which wheels we could/should build

  • I think we should definitely drop CPython 3.8-3.10, leaving those to the Stable ABI 3.7 wheel
  • The most we could drop is everything but 3.7 and 3.12 (and 3.13t)

closes #2010

@minrk
Copy link
Member Author

minrk commented Dec 3, 2024

Actually can't drop any wheels before 3.11 because 3.11 introduces Py_buffer to the ABI, which we need. So we still need to build wheels for each supported Python <=3.10.

So we can't drop most wheels, but we could drop CPython >= 3.13 or 3.12 in favor of a limited API wheel. It's unclear if the vectorcall improvement in 3.12 is worth it or not.

CMakeLists.txt Outdated Show resolved Hide resolved
temporarily, for testing
abi3audit needs to be installed, use pipx
@minrk
Copy link
Member Author

minrk commented Dec 13, 2024

cibuildwheel doesn't build wheels if there's already a compatible one, so if we want to build both a 3.11 abi3 wheel and a 3.13 native wheel, we need to do something special with ci (i.e. build abi3 wheels in their own jobs).

Running with Python 3.13, I saw a ~20% performance penalty of about 1µs per send (baseline 4.5µs) in the throughput benchmarks with the 3.11 abi (basically just measuring the overhead of Socket.send). the penalty was reduced to about 0.7µs for the 3.12 abi with vectorcall.

So I can either:

  1. publish a stable abi wheel for 3.11, stop building newer wheels (~1µs penalty)
  2. publish standard wheel for 3.11, stable for 3.12+ (~0.7µs penalty)
  3. keep publishing all 'current' wheels, but publish just the 3.12 stable abi, so that future Pythons can have a wheel before PyPI allows uploads (more wheels, not fewer)

I'm not sure which I'll pick when the time comes, but perhaps option 2.

I really hope freethreading gets a stable ABI in 3.14, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adopt limited API for wheels
2 participants