-
Notifications
You must be signed in to change notification settings - Fork 13
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
Provide a proper wheel instead of a tarball #86
Comments
Here is my understanding: the key part is the install prefix. Everything is relative to that. In your example above, the prefix is
Python controls that through "install schemes". See https://docs.python.org/3/library/sysconfig.html#installation-paths What I am not sure about is the whether |
If we keep with the
Then Additionally, there would be two build-time functions:
|
We don't need to, but it simply seems like the right place? Looking a bit closer, the
That should be all AFAICT. |
This I don't understand, it should not be needed (and sounds fragile). The build system already does discovery with |
We can leave the discussion of hooks for later, and keep the current build system in place. It will mean that for NumPy's CI, we will need to copy the relevant libraries to Why do you think Another complication: the typical auditwheel/delocate workflow to "fix" wheels is:
This all changes since step 2 is not relevant. How do we tell auditwheel/delocate to avoid step 2? The other packages, besides numba, do not depend on a secondary package with a shared object. I wonder how numba does this. |
I looked at https://github.com/python/cpython/blob/main/Lib/sysconfig.py#L26-L38, which has the relevant locations.
These are all Python packages with Python code inside, in addition to shared libraries.
I don't know if they have this feature. Worth asking about this (and the topic in general) in the packaging Discourse perhaps? |
I think the current direction from the auditwheel discussion is to make the openblas wheel pre-load the supplied shared object when importing openblas. So the mechanism looks like:
Other distributors (debian, conda, fedora) do what they have always been doing. |
There should be no issue on Windows I think. If |
This is a ad-hoc version of pynativelib? https://mail.python.org/pipermail/wheel-builders/2016-April/000090.html |
@isuruf kinda, I'd say it's a subset, and only aimed at de-duplicating a vendored library from numpy/scipy wheels. Besides the space saving, it avoids known issues with having two copies of openblas loaded at the same time. The pynativelib proposal is much more ambitious, dealing with library renaming, ABI compatibility/versioning, and build system integration. No one seems to have the energy to push that forward. More importantly, I'm not convinced that implementing pynativelib is a good idea from a social perspective. Giving how poorly suited the author-led PyPI model is to dealing with native code/libraries, I think that putting non-Python libraries in wheels is a last resort - it should only be done reluctantly when there's no better alternative. |
Coming late to the party: if we were to also set a similar openmp runtime wheel for the scipy stack, then we could make openblas depend on that (instead of using it's own internal threadpool) and as a result, libraries such as scikit-learn with code that iteratively call into openmp parallel section and openblas parallel sections would no longer suffer from the bad performance degradation caused by the spinwaiting threads (working hypothesis) as documented here: OpenMathLib/OpenBLAS#3187 |
@ogrisel that seems very much reasonable - if we can use an OpenBLAS wheel we can also use an OpenMP wheel. However, we identified one blocker to actually using this wheel from released NumPy/SciPy packages, due to PyPI's metadata model - see numpy/numpy#24857. |
This repo generates and uploads a tarball to be used by NumPy and Scipy. It would be nice to generate a proper wheel instead. I am not sure where the wheel would install the shared object. As far as I know there is no agreed-upon place that can be used for shared objects. For instance, when installing a wheel with
pip install --user
on linux, the python modules are put into~/.local/lib/site-packages/pythonX.Y
and scripts into~/.local/bin
. There is no equivalent to/usr/local/libs
for shared objects that the runtimeld
loader will probe.One option would be that the shared object would be put into
site-packages/openblas
. NumPy/SciPy wheels could then have a dependency on this new package, and would load the shared object via anRPATH
directive which would be part of the build scripts.The text was updated successfully, but these errors were encountered: