From f4c8b14c3312dc1648f0c7ef5d08d505eb0e0932 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 09:31:24 +0100 Subject: [PATCH 01/14] Unpin tensorflow --- python/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements.txt b/python/requirements.txt index 7f772288ff9b..1d0869fb7150 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -85,7 +85,7 @@ pytest-lazy-fixture pytest-timeout pytest-virtualenv scikit-learn==0.22.2 -tensorflow==2.5.1 +tensorflow testfixtures werkzeug xlrd From 164eed51300ea76c7a44e4e12640ae2d2587a663 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:12:12 +0100 Subject: [PATCH 02/14] Clean up requirements_ml_docker --- python/requirements_ml_docker.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/python/requirements_ml_docker.txt b/python/requirements_ml_docker.txt index 166d2bab9e32..1647c81bc76b 100644 --- a/python/requirements_ml_docker.txt +++ b/python/requirements_ml_docker.txt @@ -5,13 +5,6 @@ tblib # If you make changes to anything below this line, please also change `requirements_dl.txt`! -# TODO(amogkam): Remove after https://github.com/tensorflow/tensorflow/issues/52922 is fixed. -keras==2.6.0 -# In TF >v2, GPU support is included in the base package. -tensorflow==2.6.0 -tensorflow-probability==0.14.0 - -f https://download.pytorch.org/whl/torch_stable.html torch==1.9.0+cu111 --f https://download.pytorch.org/whl/torch_stable.html torchvision==0.10.0+cu111 From 10474d28393a32c8b44b04e5fa8f34a82c06fd41 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:13:51 +0100 Subject: [PATCH 03/14] Bump 2.6.2<=tensorflow<2.6.* --- python/requirements/ml/requirements_dl.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/requirements/ml/requirements_dl.txt b/python/requirements/ml/requirements_dl.txt index 3970fa10a975..a30f3feaf2db 100644 --- a/python/requirements/ml/requirements_dl.txt +++ b/python/requirements/ml/requirements_dl.txt @@ -5,9 +5,7 @@ # If you make changes to this file, please also change `requirements_ml_docker.txt`! -# TODO(amogkam): Remove after https://github.com/tensorflow/tensorflow/issues/52922 is fixed. -keras==2.6.0 -tensorflow==2.6.0 +tensorflow~=2.6.2 tensorflow-probability==0.14.0 torch==1.9.0;sys_platform=="darwin" @@ -16,5 +14,4 @@ torchvision==0.10.0;sys_platform=="darwin" # On non-OSX machines only install CPU version of torch and torchvision -f https://download.pytorch.org/whl/torch_stable.html torch==1.9.0+cpu;sys_platform!="darwin" --f https://download.pytorch.org/whl/torch_stable.html -torchvision==0.10.0+cpu;sys_platform!="darwin" \ No newline at end of file +torchvision==0.10.0+cpu;sys_platform!="darwin" From 29ae8550d6629acde3818227d69e5ebdb523c7bf Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:20:02 +0100 Subject: [PATCH 04/14] One big pip install command --- docker/ray-ml/Dockerfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index 197adbe4ffbe..787a3a488517 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -19,13 +19,16 @@ RUN sudo apt-get update \ libgl1-mesa-dev \ unzip \ unrar \ - && $HOME/anaconda3/bin/pip install -U pip \ - && $HOME/anaconda3/bin/pip --use-deprecated=legacy-resolver --no-cache-dir install -r requirements.txt \ - && $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_rllib.txt \ - && $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_train.txt \ - && $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_tune.txt \ - && $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_ml_docker.txt \ - && $HOME/anaconda3/bin/pip --no-cache-dir install -U -r requirements_upstream.txt \ + && $HOME/anaconda3/bin/pip --no-cache-dir install -U pip \ + && $HOME/anaconda3/bin/pip --no-cache-dir install + -r requirements.txt \ + -r requirements_rllib.txt \ + -r requirements_train.txt \ + -r requirements_tune.txt \ + -r requirements_upstream.txt + # explicitly install (overwrite) pytorch with CUDA support + && $HOME/anaconda3/bin/pip --no-cache-dir install -U \ + -r requirements_ml_docker.txt # Remove dataclasses & typing because they are included in Python > 3.6 && if [ $(python -c 'import sys; print(sys.version_info.minor)') != "6" ]; then \ $HOME/anaconda3/bin/pip uninstall dataclasses typing -y; fi \ From 40cf14bf8dd0bbc08c3cb3917ff24c123ea5701f Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:26:45 +0100 Subject: [PATCH 05/14] Typo --- docker/ray-ml/Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index 787a3a488517..74a30a09a3e6 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -25,17 +25,20 @@ RUN sudo apt-get update \ -r requirements_rllib.txt \ -r requirements_train.txt \ -r requirements_tune.txt \ - -r requirements_upstream.txt + -r requirements_upstream.txt \ # explicitly install (overwrite) pytorch with CUDA support && $HOME/anaconda3/bin/pip --no-cache-dir install -U \ - -r requirements_ml_docker.txt + -r requirements_ml_docker.txt \ # Remove dataclasses & typing because they are included in Python > 3.6 && if [ $(python -c 'import sys; print(sys.version_info.minor)') != "6" ]; then \ $HOME/anaconda3/bin/pip uninstall dataclasses typing -y; fi \ - && sudo rm requirements.txt && sudo rm requirements_ml_docker.txt \ - && sudo rm requirements_tune.txt && sudo rm requirements_rllib.txt \ - && sudo rm requirements_train.txt \ - && sudo rm requirements_upstream.txt \ + && sudo rm \ + requirements.txt \ + requirements_ml_docker.txt \ + requirements_tune.txt \ + requirements_rllib.txt \ + requirements_train.txt \ + requirements_upstream.txt \ && sudo apt-get clean # Make sure tfp is installed correctly and matches tf version. From 4d2cde8dc38345c5180869eac26ddac45449e69e Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:28:48 +0100 Subject: [PATCH 06/14] Typo --- docker/ray-ml/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index 74a30a09a3e6..c98244fbe879 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -20,7 +20,7 @@ RUN sudo apt-get update \ unzip \ unrar \ && $HOME/anaconda3/bin/pip --no-cache-dir install -U pip \ - && $HOME/anaconda3/bin/pip --no-cache-dir install + && $HOME/anaconda3/bin/pip --no-cache-dir install \ -r requirements.txt \ -r requirements_rllib.txt \ -r requirements_train.txt \ From a35ebc945bad3d2795e4f534ff321e61594ccd5f Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:54:22 +0100 Subject: [PATCH 07/14] Allow bugfix releases of tensorflow-probability --- python/requirements/ml/requirements_dl.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/requirements/ml/requirements_dl.txt b/python/requirements/ml/requirements_dl.txt index a30f3feaf2db..c6bdd8c0f509 100644 --- a/python/requirements/ml/requirements_dl.txt +++ b/python/requirements/ml/requirements_dl.txt @@ -1,12 +1,10 @@ # These requirements are used for the CI and CPU-only Docker images so we install CPU only versions of torch. -# For GPU Docker images, you should install requirements_ml_docker.txt instead. - - -# If you make changes to this file, please also change `requirements_ml_docker.txt`! - +# For GPU Docker images, you should install requirements_ml_docker.txt afterwards. tensorflow~=2.6.2 -tensorflow-probability==0.14.0 +tensorflow-probability~=0.14.1 + +# If you make changes below this line, please also change `requirements_ml_docker.txt`! torch==1.9.0;sys_platform=="darwin" torchvision==0.10.0;sys_platform=="darwin" From e466fb2a6ecd84fb5c308f62408de26f3c3d6765 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 14:05:10 +0100 Subject: [PATCH 08/14] Fix compatibility between rllib and train reqs --- python/requirements/ml/requirements_rllib.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 2d23f7c1e70e..d725052c86a1 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -32,7 +32,7 @@ higher==0.2.1 pyglet==1.5.15 imageio-ffmpeg==0.4.5 # For JSON reader/writer. -smart_open==5.0.0 +smart_open~=5.0 # Ray Serve example starlette==0.16.0 # ONNX From 7e807a37efc8d59c399958a98102529d348d450a Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Fri, 18 Mar 2022 16:17:34 +0100 Subject: [PATCH 09/14] Add back -U --- docker/ray-ml/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ray-ml/Dockerfile b/docker/ray-ml/Dockerfile index c98244fbe879..a8171b4ce24e 100644 --- a/docker/ray-ml/Dockerfile +++ b/docker/ray-ml/Dockerfile @@ -20,7 +20,7 @@ RUN sudo apt-get update \ unzip \ unrar \ && $HOME/anaconda3/bin/pip --no-cache-dir install -U pip \ - && $HOME/anaconda3/bin/pip --no-cache-dir install \ + && $HOME/anaconda3/bin/pip --no-cache-dir install -U \ -r requirements.txt \ -r requirements_rllib.txt \ -r requirements_train.txt \ From e57f5ec2cf651a10c8715343386e818f2823ef9e Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:02:03 +0100 Subject: [PATCH 10/14] Apply suggestions from code review Co-authored-by: Kai Fricke --- python/requirements.txt | 1 - python/requirements/ml/requirements_dl.txt | 4 ++-- python/requirements/ml/requirements_rllib.txt | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/python/requirements.txt b/python/requirements.txt index 1d0869fb7150..30fa383983dc 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -85,7 +85,6 @@ pytest-lazy-fixture pytest-timeout pytest-virtualenv scikit-learn==0.22.2 -tensorflow testfixtures werkzeug xlrd diff --git a/python/requirements/ml/requirements_dl.txt b/python/requirements/ml/requirements_dl.txt index c6bdd8c0f509..6a8377ea8d23 100644 --- a/python/requirements/ml/requirements_dl.txt +++ b/python/requirements/ml/requirements_dl.txt @@ -1,8 +1,8 @@ # These requirements are used for the CI and CPU-only Docker images so we install CPU only versions of torch. # For GPU Docker images, you should install requirements_ml_docker.txt afterwards. -tensorflow~=2.6.2 -tensorflow-probability~=0.14.1 +tensorflow==2.6.3 +tensorflow-probability==0.14.1 # If you make changes below this line, please also change `requirements_ml_docker.txt`! diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index d725052c86a1..06de3635366a 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -32,7 +32,6 @@ higher==0.2.1 pyglet==1.5.15 imageio-ffmpeg==0.4.5 # For JSON reader/writer. -smart_open~=5.0 # Ray Serve example starlette==0.16.0 # ONNX From d5e322fdcf40a06659f05cc79323fe5667e15ff0 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:02:44 +0100 Subject: [PATCH 11/14] PR Suggestion --- python/requirements/ml/requirements_tune.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/python/requirements/ml/requirements_tune.txt b/python/requirements/ml/requirements_tune.txt index 6c1336ae1c1c..fc2edf1c88d2 100644 --- a/python/requirements/ml/requirements_tune.txt +++ b/python/requirements/ml/requirements_tune.txt @@ -33,7 +33,6 @@ shortuuid==1.0.1 scikit-learn==0.24.2 scikit-optimize==0.8.1 sigopt==7.5.0 -smart_open==5.1.0 timm==0.4.5 transformers==4.10.0 wandb==0.12.5 From ac8a2fbc59c6dea1fce47b0e5e49311ce8c3c5e7 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Thu, 24 Mar 2022 06:52:44 +0100 Subject: [PATCH 12/14] Revert tensorflow to 2.6.2 --- python/requirements/ml/requirements_dl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/requirements/ml/requirements_dl.txt b/python/requirements/ml/requirements_dl.txt index 6a8377ea8d23..0d833c2b312d 100644 --- a/python/requirements/ml/requirements_dl.txt +++ b/python/requirements/ml/requirements_dl.txt @@ -1,7 +1,7 @@ # These requirements are used for the CI and CPU-only Docker images so we install CPU only versions of torch. # For GPU Docker images, you should install requirements_ml_docker.txt afterwards. -tensorflow==2.6.3 +tensorflow==2.6.2 tensorflow-probability==0.14.1 # If you make changes below this line, please also change `requirements_ml_docker.txt`! From f6b0105767a0d9f5a1e380734e0e1b58648111ff Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Thu, 24 Mar 2022 14:26:49 +0100 Subject: [PATCH 13/14] Install requirements_dl.txt in CI --- ci/travis/install-dependencies.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index 8ab2c6112ce7..d5df927e32b9 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -309,13 +309,8 @@ install_dependencies() { if [ -n "${PYTHON-}" ] && [ "${MINIMAL_INSTALL-}" != 1 ]; then # Remove this entire section once Serve dependencies are fixed. if [ "${DOC_TESTING-}" != 1 ] && [ "${SGD_TESTING-}" != 1 ] && [ "${TRAIN_TESTING-}" != 1 ] && [ "${TUNE_TESTING-}" != 1 ] && [ "${RLLIB_TESTING-}" != 1 ]; then - # PyTorch is installed first since we are using a "-f" directive to find the wheels. # We want to install the CPU version only. - local torch_url="https://download.pytorch.org/whl/torch_stable.html" - case "${OSTYPE}" in - darwin*) pip install torch torchvision;; - *) pip install torch==1.9.0+cpu torchvision==0.10.0+cpu -f "${torch_url}";; - esac + pip install -r "${WORKSPACE_DIR}"/python/requirements/ml/requirements_dl.txt fi # Try n times; we often encounter OpenSSL.SSL.WantReadError (or others) From 42767bed2167d07e7996d03722dbc3cc4a0772d0 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Thu, 24 Mar 2022 17:54:36 +0100 Subject: [PATCH 14/14] Leftover --- python/requirements/ml/requirements_rllib.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index 06de3635366a..65ab046456e2 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -31,7 +31,6 @@ higher==0.2.1 # For auto-generating an env-rendering Window. pyglet==1.5.15 imageio-ffmpeg==0.4.5 -# For JSON reader/writer. # Ray Serve example starlette==0.16.0 # ONNX