Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPI dynamic dependencies #92085

Closed
atalman opened this issue Jan 12, 2023 · 9 comments
Closed

PyPI dynamic dependencies #92085

atalman opened this issue Jan 12, 2023 · 9 comments
Assignees
Labels
oncall: releng In support of CI and Release Engineering triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Milestone

Comments

@atalman
Copy link
Contributor

atalman commented Jan 12, 2023

馃悰 Describe the bug

Pytorch should not embed any libraries that are otherwise available on pypi.

Acceptance criteria:

  • Evaluate current size of pypi package.
  • Add it to smoke testing
  • Remove extra packages
  • Check binary size differences between 11.7 and 11.8

Versions

nightly

@atalman atalman added this to the 2.0.0 milestone Jan 12, 2023
@atalman atalman added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module oncall: releng In support of CI and Release Engineering labels Jan 12, 2023
@malfet malfet changed the title Pypi dynamic dependencies PyPI dynamic dependencies Jan 17, 2023
@atalman
Copy link
Contributor Author

atalman commented Jan 30, 2023

Here are the ldd trace of current dynamic dependencies

(py38cudnn) atalman@ip-10-200-93-49:/home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib$ ldd libtorch.so
	linux-vdso.so.1 (0x00007ffdb8d93000)
	libtorch_cpu.so => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./libtorch_cpu.so (0x00007f42e8106000)
	libtorch_cuda.so => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./libtorch_cuda.so (0x00007f42c3731000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42c3519000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f42c3128000)
	libgomp-a34b3233.so.1 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./libgomp-a34b3233.so.1 (0x00007f42c2efe000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42c2cdf000)
	libc10.so => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./libc10.so (0x00007f4300e94000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f42c2ad7000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f42c28d3000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42c2535000)
	libcupti.so.11.7 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cuda_cupti/lib/libcupti.so.11.7 (0x00007f42c1c3a000)
	libcudart.so.11.0 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cuda_runtime/lib/libcudart.so.11.0 (0x00007f42c1995000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42c1588000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4300d9f000)
	libc10_cuda.so => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./libc10_cuda.so (0x00007f4300e1a000)
	libcusparse.so.11 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cusparse/lib/libcusparse.so.11 (0x00007f42b2eea000)
	libcurand.so.10 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/curand/lib/libcurand.so.10 (0x00007f42ad2f0000)
	libnvToolsExt.so.1 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/nvtx/lib/libnvToolsExt.so.1 (0x00007f42ad0e6000)
	libnccl.so.2 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/nccl/lib/libnccl.so.2 (0x00007f429f26d000)
	libcufft.so.10 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cufft/lib/libcufft.so.10 (0x00007f428e392000)
	libcublas.so.11 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cublas/lib/libcublas.so.11 (0x00007f4285134000)
	libcudnn.so.8 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cudnn/lib/libcudnn.so.8 (0x00007f4284f0e000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f4284d0b000)
	libcublasLt.so.11 => /home/atalman/miniconda3/envs/py38cudnn/lib/python3.8/site-packages/torch/lib/./../../nvidia/cublas/lib/libcublasLt.so.11 (0x00007f4270d6a000)

@malfet
Copy link
Contributor

malfet commented Jan 30, 2023

What about cusolve? Also, are you sure we are not linking statically with cudart?

@malfet
Copy link
Contributor

malfet commented Jan 30, 2023

Litmus test for the effort success: size difference between pytorch cpu and pytorch-pypi should be the equal to size difference between pytorch+CUDA and pytorch-CPU build in CI (multiplied by number of architectures we compile for)

@atalman
Copy link
Contributor Author

atalman commented Jan 30, 2023

What about cusolve? Also, are you sure we are not linking statically with cudart?

@malfet Here is our build for reference https://github.com/pytorch/pytorch/actions/runs/4041748764/jobs/6948643860#step:14:1263

This PR reworks statically linked cuda libraries:
fb9b965
From this code we statically link with cuda libs if ATEN_STATIC_CUDA is set however for this particular build this flag is off: https://github.com/pytorch/pytorch/actions/runs/4041748764/jobs/6948643860#step:14:252
This is where this flag is set: https://github.com/pytorch/builder/blob/main/manywheel/build_cuda.sh#L223

@atalman
Copy link
Contributor Author

atalman commented Jan 30, 2023

Size differences for pypi-cudnn package:

Release 1.13.1 - 869mb for manywheel-py3_x-cuda11_7-with-pypi-cudnn
https://github.com/pytorch/pytorch/actions/runs/3651169542

Nightly 1.30.2023 - 576mb or manywheel-py3_x-cuda11_7-with-pypi-cudnn
https://github.com/pytorch/pytorch/actions/runs/4041748764

Nightly 1.30.2023 CPU build manywheel-py3_x-cpu 186 MB

@atalman
Copy link
Contributor Author

atalman commented Jan 30, 2023

Litmus test for the effort success: size difference between pytorch cpu and pytorch-pypi should be the equal to size difference between pytorch+CUDA and pytorch-CPU build in CI (multiplied by number of architectures we compile for)

@malfet Not sure I fully understand the response, which pytorch+CUDA CI build exactly do you have in mind ?

@atalman
Copy link
Contributor Author

atalman commented Feb 2, 2023

Added smoke test: pytorch/builder#1289

@atalman
Copy link
Contributor Author

atalman commented Feb 2, 2023

Closing this, since all critical tasks are resolved

@atalman atalman closed this as completed Feb 2, 2023
@soumith
Copy link
Member

soumith commented Feb 3, 2023

very excited about this. finally our wheel is getting to sane sizes! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oncall: releng In support of CI and Release Engineering triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants