Closed peebles closed 3 months ago
@peebles Impressive right - Just 6GB, and compressed around 3. Sadly, there is literally not much to improve, its mostly the drivers and the python venv with required packages. It could be smaller, e.g. for a cpu / onnx container could go below 1GB.
To be fair, pytorch + cudnn packages add up fast - I used multi-stage docker builds to compress what I could.
For reference: here are some similar projects.
https://hub.docker.com/r/anibali/pytorch/tags https://hub.docker.com/layers/winglian/axolotl-cloud/main-py3.10-cu118-2.1.2/images/sha256-9d5a353eb30494e9835a70cc9760de48ea2c95a5c9232e14beda214900440219?context=explore
Yes, but what is: /root/rerank-test/.venv/ ?
When doing Python based lambda functions in AWS, I found that striping the libraries was a big saving. Something like
find .venv -name ".so" -not -path "scipy/special/" -not -path "scipy/sparse/linalg/" -not -path "scipy/linalg/" -not -path "scipy/optimize/" -not -path "scipy/integrate/*" -exec strip {} \;
The scipy stuff in there because stripping scipy caused runtime errors. I am not saying you should do this, but something to consider. In AWS I had no choice.
Ah! Forget the /root/rerank-test ... that's my test! So sorry!! I'm lossin it man!
@peebles No worries, still interested in pruning some libraries - but slightly worried that most *.so
files might be needed by pytorch and that doing so will hurt development velocity.
Closing due to inactivity. Feel free to reopen if you found something!
The docker image michaelf34/infinity:latest is about 6.5G uncompressed. Exploring this, I noticed inside the container:
This adds up to more than 6.5 though, so I am not sure what is going on. But something might have leaked past .dockerignore when this container was built.
I may not be using the very latest image.