-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
ENH: Reduce size of distributed wheels #25737
Comments
If you build a wheel without vendored libopenblas (through
It looks like separating out the tests could be the easiest and most significant win after separating out |
Would we make the tests optionally installable, or how would users validate that their NumPy installation is working correctly? |
We could publish a |
So the idea would be that most "only CI testing" people would get a non-optimized NumPy without tests, and "normal users" would download OpenBLAS? |
Another alternative for the test suite, if we want it to be included by default, is to compress it. |
I think I've figured out how to remove the tests for pandas, if you're interested. pandas-dev/pandas#53007 is my attempt. Basically my strategy is use |
Interesting, thanks for sharing @lithomas1. I'd be more inclined to keep tests in the sdist (distros need it after all) and use a build flag to allow removing tests from wheels. But I'm certainly not sure that that's the way to go before trying.
That could help a bit, but probably not all that much compared to not shipping them - wheels are already compressed after all (they're zip archives). |
Yeap, sorry for the noise. Compression advantage of something like zstd over gz is only a few 100k. I wish wheels supported better compression. Looks like they considered it but never got zstd or similar into the standard lib. |
@lithomas1 I think we (@czgdp1807 and I) have just figured out a much cleaner way of doing this, using install tags, which are specifically meant for this kind of thing. I think the diff will end up being quite small, and it retains the flexibility to install tests yes/no with a single CLI flag. It should also allow producing two wheels (separate |
gh-26274 allows removing the tests, and looks quite clean. Reduction in wheel sizes will be 1.6 MB. |
A very brief summary of the benefits of binary size reductions:
Reducing the size of the vendored OpenBLAS wheel (xref MacPython/openblas-libs#144) will help more, and succeeding in splitting it off completely even more. The macOS Accelerate wheels show what is possible: they are now (for |
For packages that make pyinstaller bundles it's a big win making scipy and numpy smaller. Two lots of openblas that dont have to be bundled, tests that don't have to be shipped, etc. I think some of the binaries I was releasing were on the 100Mb level and higher. |
I'm not a huge fan of the extra complexity re: separate test suite "package" FWIW, but looks like I'll be outvoted, fair enough. |
Thanks to @Mousius I just realized that this is a test-only file, so we can remove it from the installed package as well if |
Proposed new feature or change:
Reduction: %
Related issue:
Reduction: %
Related issue:
Reduction: %
Related issue:
The text was updated successfully, but these errors were encountered: