From 6e6f3cc7d901b94c192fb0555109b90b2eb054fc Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Wed, 7 Jun 2023 15:24:08 +0200 Subject: [PATCH 1/7] new docker image --- .../docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 new file mode 100644 index 00000000..1916d0e5 --- /dev/null +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -0,0 +1,109 @@ +# Ubuntu 22.04 Python3 with CUDA 12 and the following: +# - Installs tf-nightly (this is TF 2.14) +# - Installs requirements.txt for tensorflow/models + +FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 as base +ARG tensorflow_pip_spec="tf-nightly" +ARG local_tensorflow_pip_spec="" +ARG extra_pip_specs="" +ENV PIP_CMD="python3.10 -m pip" + +# setup.py passes the base path of local .whl file is chosen for the docker image. +# Otherwise passes an empty existing file from the context. +COPY ${local_tensorflow_pip_spec} /${local_tensorflow_pip_spec} + +# Pick up some TF dependencies +# cublas-dev and libcudnn7-dev only needed because of libnvinfer-dev which may not +# really be needed. +# In the future, add the following lines in a shell script running on the +# benchmark vm to get the available dependent versions when updating cuda +# version (e.g to 10.2 or something later): +# sudo apt-cache search cuda-command-line-tool +# sudo apt-cache search cuda-cublas +# sudo apt-cache search cuda-cufft +# sudo apt-cache search cuda-curand +# sudo apt-cache search cuda-cusolver +# sudo apt-cache search cuda-cusparse + +# Needed to disable prompts during installation. +ENV DEBIAN_FRONTEND noninteractive + + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libfreetype6-dev \ + libhdf5-serial-dev \ + libzmq3-dev \ + libpng-dev \ + pkg-config \ + software-properties-common \ + unzip \ + lsb-core \ + curl + +# Python 3.10 related deps in this ppa. +RUN add-apt-repository ppa:deadsnakes/ppa + + +# Install / update Python and Python3 +RUN apt-get install -y --no-install-recommends \ + python3.10 \ + python3-pip \ + python3.10-dev \ + python3-setuptools \ + python3.10-venv \ + python3.10-distutils \ + python3.10-lib2to3 + +# Upgrade pip, need to use pip3 and then pip after this or an error +# is thrown for no main found. +RUN ${PIP_CMD} install --upgrade pip +RUN ${PIP_CMD} install --upgrade distlib +# setuptools upgraded to fix install requirements from model garden. +RUN ${PIP_CMD} install --upgrade setuptools + +# For CUDA profiling, TensorFlow requires CUPTI. +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH + +# See http://bugs.python.org/issue19846 +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 + +# Add google-cloud-sdk to the source list +RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk-$(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list +RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - + +# Install extras needed by most models +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + ca-certificates \ + wget \ + htop \ + zip \ + google-cloud-sdk + +RUN ${PIP_CMD} install --upgrade pyyaml +RUN ${PIP_CMD} install --upgrade google-api-python-client==2.88.0 +RUN ${PIP_CMD} install --upgrade google-cloud google-cloud-bigquery google-cloud-datastore mock + + +RUN ${PIP_CMD} install wheel +RUN ${PIP_CMD} install absl-py +RUN ${PIP_CMD} install --upgrade --force-reinstall ${tensorflow_pip_spec} ${extra_pip_specs} + +RUN ${PIP_CMD} install tfds-nightly +RUN ${PIP_CMD} install -U scikit-learn + +# Install dependnecies needed for tf.distribute test utils +RUN ${PIP_CMD} install dill tblib portpicker + +RUN curl https://raw.githubusercontent.com/tensorflow/models/master/official/nightly_requirements.txt > /tmp/requirements.txt +RUN ${PIP_CMD} install -r /tmp/requirements.txt + +RUN ${PIP_CMD} install tf-estimator-nightly +RUN ${PIP_CMD} install tensorflow-text-nightly + +# RUN nvidia-smi + +RUN nvcc --version + + +RUN pip freeze \ No newline at end of file From 015002b79c22a2bf6e45e434726ab3af981cb987 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Wed, 7 Jun 2023 15:46:22 +0200 Subject: [PATCH 2/7] fix google --- perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 index 1916d0e5..18142847 100644 --- a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -29,7 +29,7 @@ COPY ${local_tensorflow_pip_spec} /${local_tensorflow_pip_spec} ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get -y update && apt-get install -y --no-install-recommends \ libfreetype6-dev \ libhdf5-serial-dev \ libzmq3-dev \ @@ -45,7 +45,7 @@ RUN add-apt-repository ppa:deadsnakes/ppa # Install / update Python and Python3 -RUN apt-get install -y --no-install-recommends \ +RUN apt-get -y update && apt-get install -y --no-install-recommends \ python3.10 \ python3-pip \ python3.10-dev \ @@ -68,17 +68,16 @@ ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-12.1/lib6 ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 # Add google-cloud-sdk to the source list -RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk-$(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list -RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - +RUN curl -sSL https://sdk.cloud.google.com | bash +ENV PATH $PATH:/root/google-cloud-sdk/bin # Install extras needed by most models -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get -y update && apt-get install -y --no-install-recommends \ git \ ca-certificates \ wget \ htop \ - zip \ - google-cloud-sdk + zip RUN ${PIP_CMD} install --upgrade pyyaml RUN ${PIP_CMD} install --upgrade google-api-python-client==2.88.0 @@ -106,4 +105,4 @@ RUN ${PIP_CMD} install tensorflow-text-nightly RUN nvcc --version -RUN pip freeze \ No newline at end of file +RUN pip freeze From 68412d358fbeabadddfb14c03bc7f189573334e8 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Wed, 7 Jun 2023 16:19:51 +0200 Subject: [PATCH 3/7] new docker image --- perfzero/dockertest/requirements_temp.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/perfzero/dockertest/requirements_temp.txt b/perfzero/dockertest/requirements_temp.txt index a4249c32..993d47f2 100644 --- a/perfzero/dockertest/requirements_temp.txt +++ b/perfzero/dockertest/requirements_temp.txt @@ -1,22 +1,22 @@ six -google-api-python-client>=1.6.7 -kaggle>=1.3.9 -numpy>=1.15.4 +google-api-python-client>=2.88.0 +kaggle>=1.5.13 +numpy>=1.24.3 oauth2client -pandas>=0.22.0 -psutil>=5.4.3 -py-cpuinfo>=3.3.0 -scipy>=0.19.1 +pandas>=2.0.2 +psutil>=5.9.5 +py-cpuinfo>=9.0.0 +scipy>=1.10.1 tensorflow-hub>=0.6.0 -tensorflow-model-optimization>=0.4.1 +tensorflow-model-optimization>=0.7.5 tensorflow-datasets tensorflow-addons -dataclasses;python_version<"3.7" +dataclasses;python_version<"3.12" gin-config tf_slim>=1.1.0 Cython matplotlib -pyyaml>=5.1 +pyyaml>=6.0 # CV related dependencies opencv-python-headless Pillow From 872c263ef9c40c1c5840e8696891d5df5eae6e7f Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 7 Jun 2023 16:29:43 +0200 Subject: [PATCH 4/7] Update Dockerfile_ubuntu_2204_tf_cuda_12 --- perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 index 18142847..e99f36d5 100644 --- a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -94,7 +94,7 @@ RUN ${PIP_CMD} install -U scikit-learn # Install dependnecies needed for tf.distribute test utils RUN ${PIP_CMD} install dill tblib portpicker -RUN curl https://raw.githubusercontent.com/tensorflow/models/master/official/nightly_requirements.txt > /tmp/requirements.txt +RUN curl https://raw.githubusercontent.com/johnnynunez/models/master/official/nightly_requirements.txt > /tmp/requirements.txt RUN ${PIP_CMD} install -r /tmp/requirements.txt RUN ${PIP_CMD} install tf-estimator-nightly From 50aec0b5cec435f4c62c319e699f9df36fb004be Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 7 Jun 2023 16:49:09 +0200 Subject: [PATCH 5/7] Update Dockerfile_ubuntu_2204_tf_cuda_12 --- perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 index e99f36d5..cce13351 100644 --- a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -2,7 +2,7 @@ # - Installs tf-nightly (this is TF 2.14) # - Installs requirements.txt for tensorflow/models -FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 as base +FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04 as base ARG tensorflow_pip_spec="tf-nightly" ARG local_tensorflow_pip_spec="" ARG extra_pip_specs="" From 839b40056cce1ff0e8daeece162fe0c74a2873e8 Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 7 Jun 2023 17:02:45 +0200 Subject: [PATCH 6/7] Update Dockerfile_ubuntu_2204_tf_cuda_12 --- perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 index cce13351..7e2d0162 100644 --- a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -38,7 +38,8 @@ RUN apt-get -y update && apt-get install -y --no-install-recommends \ software-properties-common \ unzip \ lsb-core \ - curl + curl \ + vim # Python 3.10 related deps in this ppa. RUN add-apt-repository ppa:deadsnakes/ppa From ec6e0b59cd290a2fb0652af48aeacd5194ef89f1 Mon Sep 17 00:00:00 2001 From: Johnny Date: Tue, 13 Jun 2023 01:02:09 +0200 Subject: [PATCH 7/7] fix name --- perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 index 7e2d0162..e7f8bd67 100644 --- a/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 +++ b/perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12 @@ -95,7 +95,7 @@ RUN ${PIP_CMD} install -U scikit-learn # Install dependnecies needed for tf.distribute test utils RUN ${PIP_CMD} install dill tblib portpicker -RUN curl https://raw.githubusercontent.com/johnnynunez/models/master/official/nightly_requirements.txt > /tmp/requirements.txt +RUN curl https://raw.githubusercontent.com/tensorflow/models/master/official/nightly_requirements.txt > /tmp/requirements.txt RUN ${PIP_CMD} install -r /tmp/requirements.txt RUN ${PIP_CMD} install tf-estimator-nightly