xformers
xformers copied to clipboard
Making built wheels available for install
🚀 Feature
Motivation
After #523 #534, the wheels can be built, but are not available for install anywhere. But users want this #532 #473
Pitch & Alternatives
There a couple of ways that I know of to achieve this:
Upload to pypi
Probably the most obvious solution
- max file size for pypi is 60MB, or roughly 2-3 CUDA architectures per wheel
- maybe it makes sense to have per architecture? sounds like an overkill to me
- one can request more size from the pypi team, I am not sure if this solution scales
- how would
pip
find the correct wheel for a given torch & cuda version?- probably using an extra pip index just like pytorch does it, but it is not "trivial" since now we need to setup an external service to host index, and in that case:
External hosting
Upload the built wheel to an external storage / hosting service (s3 & co.)
- no size limits
- additional costs
- now it is not about python or wheels anymore, there is infrastructure management & maintenance that needs to taken care of.
- does not solve the question of: how would
pip
find the correct wheel for a given torch & cuda version?- the pip index still needs to be setup (and updated automatically by every release), extra complexity
Upload to the release page on github
Similar to the above, but using github
- max file size is 2GB (which should be enough)
- no costs
- still does not answer the pip question
- download times are slower than others, but this should not be a problem
maybe it would be easiest to dump all wheels to github releases and then the users would have to find the version they want and install it.
pip install https://github.com/..../xformers-1.14.0+torch1.12.1cu116-cp39-cp39-linux_x86_64.whl
Although this would make it really annoying for libraries that use xformers and want to build for different python /cuda versions, you cannot just add xformers
to your requirements.txt
.
Additional info & Resources
https://peps.python.org/pep-0503/
https://packaging.python.org/en/latest/guides/hosting-your-own-index/
I am willing to contribute if I know how.