astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
12.52k stars 435 forks source link

Download CPython builds with "new" CPU features (AVX) #1064

Open Turakar opened 2 months ago

Turakar commented 2 months ago

Hi, first of all thanks for the awesome project! I really enjoy the self-managed CPython versions.

I noticed that the versions downloaded do not take advantage of CPU features like AVX (SIMD), because rye always installs the x86_64-* variants and not the x86_64_v{2,3,4}-* variants, even if applicable (doc). The new variants might give slight performance improvements. However, I have to note that the linked doc is not overly optimistic about the achieved performance gains, although slight gains are to be expected.

I would prefer if rye would detect the supported CPU features and download the corresponding Python version for me, as nowadays almost all common devices support at least v3 with AVX support. I took a short look at the code, but the way rye fetches its CPython builds seems rather complex to me.

I think that this does not affect 3rd-party libraries like NumPy which ship their own AVX-supporting binaries.

zanieb commented 2 months ago

Hi! I believe support for this would need to be added over in https://github.com/indygreg/python-build-standalone/

Turakar commented 2 months ago

Hi! I believe support for this would need to be added over in https://github.com/indygreg/python-build-standalone/

I don't think so. After all, that project already publishes corresponding builds (e.g., on this release).