diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index c9bfdf7e3..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,156 +0,0 @@ -ARG TORCH_VERSION=1.9.1 -ARG TORCHVISION_VERSION=0.10.1 -ARG CUDA_VERSION=11.1.1 -ARG VERSION -ARG DEPS="all" -ARG VENV="/venv" -ARG BRANCH - -# Setup the base image & install dependencies -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 as base -# As of 05/05/22 nvidia images are broken. Two lines below are a temporary fix. -# Source: https://github.com/NVIDIA/nvidia-docker/issues/1632 - -ARG VENV -RUN if [ -f /etc/apt/sources.list.d/cuda.list ] ; then rm /etc/apt/sources.list.d/cuda.list ; fi -RUN if [ -f /etc/apt/sources.list.d/nvidia-ml.list ] ; then rm /etc/apt/sources.list.d/nvidia-ml.list ; fi - -RUN set -Eeuxo \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - software-properties-common \ - git-all \ - && add-apt-repository -y ppa:deadsnakes \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - python3.8 python3.8-venv python3-pip\ - build-essential libssl-dev libffi-dev \ - ffmpeg libsm6 libxext6 \ - curl - -# Install virtualenv and create a virtual environment -RUN set -Eeuxo \ - && apt-get update \ - && python3.8 -m pip install --upgrade virtualenv \ - && python3.8 -m virtualenv --python=/usr/bin/python3.8 $VENV \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Add the virtual environment to the $PATH -ENV PATH="${VENV}/bin:$PATH" - -FROM base as cuda-10.2 -ARG TORCH_VERSION -ARG VENV -ARG TORCHVISION_VERSION -RUN $VENV/bin/pip install --upgrade pip torch==${TORCH_VERSION}+cu102 torchvision==${TORCHVISION_VERSION}+cu102 -f https://download.pytorch.org/whl/torch_stable.html - -FROM base as cuda-11.1.1 -ARG TORCH_VERSION -ARG VENV -ARG TORCHVISION_VERSION -RUN $VENV/bin/pip install --upgrade pip torch==${TORCH_VERSION}+cu111 torchvision==${TORCHVISION_VERSION}+cu111 -f https://download.pytorch.org/whl/torch_stable.html - -FROM cuda-$CUDA_VERSION as cuda_builder -ARG VENV -RUN $VENV/bin/pip install --upgrade setuptools wheel -ARG BRANCH -RUN \ - if [ -z "${BRANCH}"] ; then \ - echo Will install from pypi based on mode and version ; \ - else \ - echo cloning from "${BRANCH}" && \ - git clone https://github.com/neuralmagic/sparseml.git --depth 1 -b "${BRANCH}" ; \ - fi; - - -FROM cuda_builder AS container_branch_base -ARG VENV -ENV PATH="${VENV}/bin:$PATH" -ENV PIP_DEFAULT_TIMEOUT=200 -ARG VERSION -ARG MODE="" -ARG BRANCH - -RUN \ - if [ -n "$BRANCH" ] ; then \ - echo Installing from BRANCH && \ - $VENV/bin/pip install --no-cache-dir "./sparseml"; \ - elif [ "$MODE" = "nightly" ] ; then \ - echo Installing nightlies ... && \ - if [ -z "$VERSION" ] ; then \ - echo Installing latest nightlies ... && \ - $VENV/bin/pip install --no-cache-dir "sparseml-nightly"; \ - else \ - echo Installing nightlies ... with $VERSION && \ - $VENV/bin/pip install --no-cache-dir "sparseml-nightly==$VERSION"; \ - fi; \ - elif [ -z "$VERSION" ] ; then \ - echo Installing latest llmcompressor ... from pypi && \ - $VENV/bin/pip install --no-cache-dir "sparseml"; \ - else \ - echo Installing latest llmcompressor version="$VERSION" from pypi && \ - $VENV/bin/pip install --no-cache-dir "sparseml==$VERSION"; \ - fi; - -FROM cuda_builder AS container_branch_all -ARG VENV -ENV PATH="${VENV}/bin:$PATH" -ENV PIP_DEFAULT_TIMEOUT=200 -ARG VERSION -ARG MODE -ARG BRANCH - -RUN \ - if [ -n "$BRANCH" ] ; then \ - echo Installing from BRANCH && \ - $VENV/bin/pip install --no-cache-dir "./sparseml[onnxruntime,torchvision,transformers,yolov5,ultralytics]"; \ - elif [ "$MODE" = "nightly" ] ; then \ - if [ -z $VERSION] ; then \ - $VENV/bin/pip install --no-cache-dir "sparseml-nightly[onnxruntime,torchvision,transformers,yolov5,ultralytics]"; \ - else \ - $VENV/bin/pip install --no-cache-dir "sparseml-nightly[onnxruntime,torchvision,transformers,yolov5,ultralytics]==$VERSION"; \ - fi; \ - elif [ -z $VERSION] ; then \ - $VENV/bin/pip install --no-cache-dir "sparseml[onnxruntime,torchvision,transformers,yolov5,ultralytics]"; \ - else \ - $VENV/bin/pip install --no-cache-dir "sparseml[onnxruntime,torchvision,transformers,yolov5,ultralytics]==$VERSION"; \ - fi; - - -FROM cuda_builder AS container_branch_dev -ARG VENV -ENV PATH="${VENV}/bin:$PATH" -ENV PIP_DEFAULT_TIMEOUT=200 -ARG VERSION -ARG MODE -ARG BRANCH - -RUN \ - if [ -n "$BRANCH" ] ; then \ - echo Installing from BRANCH with editable mode && \ - $VENV/bin/pip install -e "./sparseml[dev]"; \ - else \ - echo Installing from main with editable mode && \ - git clone https://github.com/neuralmagic/sparseml.git --depth 1 -b main && \ - $VENV/bin/pip install -e "./sparseml[dev]"; \ - fi; - -FROM container_branch_${DEPS} AS build -RUN echo Build complete, going onto prod - -FROM base as dev -ARG VENV -COPY --from=build $VENV $VENV -COPY --from=build sparseml sparseml -ENV PATH="${VENV}/bin:$PATH" -HEALTHCHECK CMD python -c 'import sparseml' -CMD bash - -FROM base as prod -ARG VENV -COPY --from=build $VENV $VENV -ENV PATH="${VENV}/bin:$PATH" -HEALTHCHECK CMD python -c 'import sparseml' -RUN pip list | grep llmcompressor -CMD bash - diff --git a/docker/TODO.txt b/docker/TODO.txt deleted file mode 100644 index 961925c58..000000000 --- a/docker/TODO.txt +++ /dev/null @@ -1 +0,0 @@ -TODO: update for upstream push \ No newline at end of file diff --git a/docker/containers/docker_dev/Dockerfile b/docker/containers/docker_dev/Dockerfile deleted file mode 100644 index 227306b68..000000000 --- a/docker/containers/docker_dev/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -ARG SOURCE=ghcr.io/neuralmagic/cuda-python3.10 - -ARG TORCH_VERSION=2.1.2 -ARG TORCHVISION_VERSION=0.16.2 -ARG CUDA=121 -ARG BRANCH - -FROM $SOURCE - -ARG BRANCH - -RUN python3.10 -m pip install --upgrade pip \ - && python3.10 -m pip install --upgrade setuptools - -ARG CUDA -ARG TORCH_VERSION -ARG TORCHVISION_VERSION - -RUN python3.10 -m pip install torch==${TORCH_VERSION}+cu${CUDA} torchvision==${TORCHVISION_VERSION}+cu${CUDA} -f https://download.pytorch.org/whl/torch_stable.html \ - && git clone https://github.com/neuralmagic/sparseml.git --depth 1 --single-branch -b ${BRANCH} \ - && python3.10 -m pip install -e "./sparseml[dev]" - -HEALTHCHECK CMD python3.10 -c 'import sparseml' -RUN python3.10 -m pip list | grep llmcompressor -CMD bash \ No newline at end of file diff --git a/docker/containers/docker_nightly/Dockerfile b/docker/containers/docker_nightly/Dockerfile deleted file mode 100644 index 47cb6fba0..000000000 --- a/docker/containers/docker_nightly/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -ARG SOURCE=ghcr.io/neuralmagic/cuda-python3.10 - -ARG TORCH_VERSION=2.1.2 -ARG TORCHVISION_VERSION=0.16.2 -ARG CUDA=121 - -FROM $SOURCE - -RUN python3.10 -m pip install --upgrade pip \ - && python3.10 -m pip install --upgrade setuptools - -ARG CUDA -ARG TORCH_VERSION -ARG TORCHVISION_VERSION - -RUN python3.10 -m pip install torch==${TORCH_VERSION}+cu${CUDA} torchvision==${TORCHVISION_VERSION}+cu${CUDA} -f https://download.pytorch.org/whl/torch_stable.html \ - && python3.10 -m pip install --no-cache-dir "sparseml-nightly[onnxruntime,torchvision,transformers,yolov5,ultralytics]" - -HEALTHCHECK CMD python3.10 -c 'import sparseml' -RUN python3.10 -m pip list | grep llmcompressor -CMD bash \ No newline at end of file diff --git a/docker/containers/docker_release/Dockerfile b/docker/containers/docker_release/Dockerfile deleted file mode 100644 index d9f7c7731..000000000 --- a/docker/containers/docker_release/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -ARG SOURCE=ghcr.io/neuralmagic/cuda-python3.10 - -ARG TORCH_VERSION=2.1.2 -ARG TORCHVISION_VERSION=0.16.2 -ARG CUDA=121 -ARG VERSION - -FROM $SOURCE - -ARG VERSION - -ARG CUDA -ARG TORCH_VERSION -ARG TORCHVISION_VERSION - -RUN python3.10 -m pip install --upgrade pip \ - && python3.10 -m pip install --upgrade setuptools - -RUN python3.10 -m pip install torch==${TORCH_VERSION}+cu${CUDA} torchvision==${TORCHVISION_VERSION}+cu${CUDA} -f https://download.pytorch.org/whl/torch_stable.html \ - && python3.10 -m pip install --no-cache-dir "sparseml[onnxruntime,torchvision,transformers,yolov5,ultralytics]==$VERSION" - -HEALTHCHECK CMD python3.10 -c 'import sparseml' -RUN python3.10 -m pip list | grep llmcompressor -CMD bash \ No newline at end of file