I’ve been working on distroless containers for HPC users at the University of Virginia, notably achieving 99.5% reduction in image size for LightGBM and 18% reduction for TensorFlow without loss of performance. I’m wondering if distroless is of interest to the PyTorch community.
Our distroless Dockerfile can be found here and the corresponding image is hosted on Docker Hub uvarc/pytorch:1.6.0-distroless.
The distroless image size is 771 MB which is about half the size of the 1.55 GB official runtime image. I tested that the distroless container with pip installation has the same performance (MNIST benchmark) on our GPU node as the official container with conda installation. I’m aware that the official one has many other conda packages, but I wonder if they are necessary for a minimal (and functional) container.
I’ve read this thread on conda vs pip for pytorch, but is there a specific example that can demonstrate better performance of conda over pip? (MNIST benchmark shows equal performance.)
Thanks for your reply. I tested the distroless image on our GPU with the MNIST benchmark and it has the same performance as the official image.
As you can see from the link to our Dockerfile in my original message that it is essentially just a “pip install torch”. This already (magically) enables compatibility with GPU at runtime.
(Side note: This was not the case for TensorFlow where I had to copy a bunch of CUDA libraries from nvidia/cuda:cudnn-devel.)
This wouldn’t allow you to either rebuild PyTorch with GPU support or any custom CUDA extension, would it?
If I understand your use case correctly, you are installing the binaries with the CUDA runtime libs.