Self-compiled versions get numbered the way they don't fit requirements of standard wheels

Windows 10, Python 3.11.

I compiled a 2.1.0 and a 2.0.0 (why did checking out the tag v2.0.1 get me a version 2.0.0, though?). However, the self-compiled versions are all like torch-2.0.0a0+gite9ebda2 and even torchvision 0.15.1, which should work with 2.0.0, refuses this version string. How do I manipulate the wheel (or the source before creating the wheel) so it does show a version string which is recognised as “==2.0.0”? Or where do I get a torchvision, torchaudio etc. which is a bit less strict? Compiling torch takes around 8 hours on my Alienware 13 notebook so recompiling the whole torch*-universe would be a bit much.

The conflict is caused by:
The user requested torch 2.0.0a0+gite9ebda2 (from C:\repos\stable-diffusion-webui\torch-2.0.0a0+gite9ebda2-cp311-cp311-win_amd64.whl)
torchvision 0.15.2 depends on torch==2.0.1
The user requested torch 2.0.0a0+gite9ebda2 (from C:\repos\stable-diffusion-webui\torch-2.0.0a0+gite9ebda2-cp311-cp311-win_amd64.whl)
torchvision 0.15.1 depends on torch==2.0.0

ERROR: Cannot install torch 2.0.0a0+gite9ebda2 (from C:\repos\stable-diffusion-webui\torch-2.0.0a0+gite9ebda2-cp311-cp311-win_amd64.whl), torchvision==0.15.1 and torchvision==0.15.2 because these package versions have conflicting dependencies.

P.S: I compile it since I want to use the Tesla K40c wich compute-capability 3.5. It works for games so why shouldn’t it work for ML too? :wink:

Should you want to examine the wheels or need them for one of your own projects they are available at Index of /webordner/machinelearning/pytorch-cuda-arch-3.5-cuda11.8

I found Wheel version numbers are incompatible with `torch (==1.11.0)` · Issue #3661 · pytorch/xla · GitHub which resolves to “don’t use unofficial wheels”. Does not fix my problem. Maybe tha hack-script mentioned there does, but that’s not the most elegant way I could imagine.

Cross-referencing to Wheel version numbers are incompatible with `torch (==1.11.0)` · Issue #3661 · pytorch/xla · GitHub - I’ll continue at the forum where I get the answer first :wink: (Not sure if anybody will answer to a long-closed issue at github at all)

Cross-posting the same questions usually just wastes time as multiple users will often try to help. In any case, you can use some env variables to define a custom version. Set these to 2.0.1 and it should work.

True. Well, I don’t expect any answer at github since the issue is closed for so long so it’s probably more like a reference. Actually the “patching”-was works but is tedious. I will try to find out what environment variables I have to set. Any hint where I should start looking for? I am currently searching the repository for the version string. Maybe I am lucky and there’s a set-command or $env somewhere.

EDIT: I guess I got it:


in CmakeCache.txt

EDIT: Nope, setting that in $env does not seem to impress the compiler in any way.

Final edit: Changed it in version.txt. Minimal - just removed the 0a which is breaking all dependencies. Had to re-compile anyway since the K40c does not seem to work wit CUDNN which I compiled into the other 2.0.0-wheel.

I somehow expected the checkout of a tag would actually build the version tagged. Does not seem to be the case, though.

I hid the other comment on github as resolved since the script / manual patching actually works. Just not the way I want to go.

I consider this solved since I can change the version.txt and all source code packages saying they are 2.0.1 consistently have 2.0.0a0 in version.txt. So I can safely assume they have the funcionality of 2.0.1. And if it’s only 2.0.0 it also works for me. I have it labelled 2.0.0 now and it works with stablediffusion-webui.

If there is an environment variable which can be set and actually works is not sure at this point but as far as I am concerned this is currently irrelevant. I hope in future versions version.txt will make sense again and the environment variable will be documented somewhere. If it exists.

All in all I have mixed feelings working with pytorch but I understand it’s a really complex project so I accept some minor trouble.