Libtorch_cuda.so is too large (>2GB)

The additional compute capabilities might be displayed, since I assume you are linking the CUDA runtime as well as cudnn statically into the wheel. Without removing these architectures in e.g. libcudnn.a via nvprune, these archs should be displayed in the wheel.

Note that I posted the command to build PyTorch locally and dynamically linking to CUDA and cudnn, while you are trying to build wheels.

Youā€™re right!!

I ran nvprune on all the static libraries inside cuda and cudnn and it shrunk the size down to 1.9GB. Too bad nvprune doesnā€™t work on already created shared objects. Anyway, I think we can close this issue. Iā€™m hoping we can leverage pytorch/builder in the future to build wheels with our specific architectures without managing any of our own hand-grown build scripts.

Is there any official/community support for installing torch without GPU/CUDA support from PyPI? I maintain a Snapcraft application that depends on torch but runs on the CPU. The CUDA shared object file in torch takes up the majority of my distribution size which has caused problems in the past. Now with torch increasing in size Iā€™m over the ~1.5GB limit for Snapcraft and canā€™t upload updates. It seems that there is a pytorch-cpu package for conda but not PyPI.

The install instructions show the command to install the CPU-only pip wheels via:

pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

Thanks! I missed that. Are there any plans to make the CPU version available on PyPI? Iā€™m able to install the CPU version fine locally but since version 19 pip doesnā€™t support following links to packages not on PyPI. Thereā€™s always the option of bubbling up the need to follow links up to users but thatā€™s not ideal.

Iā€™m not sure, if that would be possible due to the size of the wheel.
Did you see how large the current wheel is and if itā€™s below the 700MB(?) limit?

CC @seemethere

It appears itā€™s ~153MB.

python3 -m pip install torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
...
Collecting torch==1.7.1+cpu
  Using cached https://download.pytorch.org/whl/cpu/torch-1.7.1%2Bcpu-cp38-cp38-linux_x86_64.whl (159.4 MB)
...
wget https://download.pytorch.org/whl/cpu/torch-1.7.1%2Bcpu-cp38-cp38-linux_x86_64.whl
du -h torch-1.7.1+cpu-cp38-cp38-linux_x86_64.whl 
153M	torch-1.7.1+cpu-cp38-cp38-linux_x86_64.whl