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

Build wheels using the abi3 tag for sphericart-jax and sphericart-torch #107

Closed
wants to merge 3 commits into from

Conversation

Luthaf
Copy link
Contributor

@Luthaf Luthaf commented Feb 15, 2024

Python offers a stable ABI since version 3.2, which can be used to build wheels targetting some minimal Python version, and use it with all future Python versions, instead of building one wheel per Python version.

This should be the right thing to do for sphericart-jax where we are linking to Python.h ourself. I'll check that the wheel work and that we don't need to pass other flags to the compiler.

I'm not sure about sphericart-torch: since we are not actually linking to Python.h, we should be able to build a wheel compatible with any Python version (but a single PyTorch version).

@Luthaf
Copy link
Contributor Author

Luthaf commented Feb 15, 2024

This should reduce the number of wheels we need to build in #106

Copy link

github-actions bot commented Feb 15, 2024

Here is a pre-built version of the code in this pull request: wheels.zip, you can install it locally by unzipping wheels.zip and using pip to install the file matching your system

@Luthaf Luthaf force-pushed the abi3-wheels branch 2 times, most recently from e7f21c8 to 93bcd70 Compare February 16, 2024 13:08
@frostedoyster
Copy link
Collaborator

Is this working?

@Luthaf
Copy link
Contributor Author

Luthaf commented Feb 26, 2024

Not really: https://github.com/lab-cosmo/sphericart/actions/runs/7931040669/job/21654454335?pr=107

I think we need to pass a flag to pybind11 to use ABI3.

The torch wheels I'm pretty confident are not directly linking to libpython, so they should be fine with just a py3 tag instead of a cp38/cp310/... tag.

@Luthaf Luthaf force-pushed the abi3-wheels branch 2 times, most recently from 99e3921 to 5935419 Compare March 26, 2024 14:26
3.29.0 does not work with Python 3.8
@Luthaf
Copy link
Contributor Author

Luthaf commented Jul 15, 2024

So this is not required for sphericart-torch (since we don't link to libpython directly) and is not supported by pybind11 for sphericart-jax. We'll have to find another way.

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.

2 participants