From 2f2bd884a3b99c5400f19b228d33aa6f2ac9509a Mon Sep 17 00:00:00 2001 From: Richard Liaw Date: Sat, 12 Dec 2020 10:35:33 -0800 Subject: [PATCH] [tune] upgrade gpytorch, bump default pytorch to 1.7.0 (#12776) * upgrade gpytorch Signed-off-by: Richard Liaw * pin Signed-off-by: Richard Liaw * version-torch Signed-off-by: Richard Liaw * fix-build Signed-off-by: Richard Liaw --- .travis.yml | 8 ++++---- ci/travis/install-dependencies.sh | 7 ++++--- python/ray/util/sgd/torch/examples/dcgan.py | 4 ++-- python/requirements_tune.txt | 1 - 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 64ca59411..e07a724c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -401,7 +401,7 @@ matrix: - PYTHON=3.6 - TF_VERSION=2.2.0 - TFP_VERSION=0.8 - - TORCH_VERSION=1.6 + - TORCH_VERSION=1.7 - PYTHONWARNINGS=ignore install: - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED @@ -421,7 +421,7 @@ matrix: - PYTHON=3.6 - TF_VERSION=2.1.0 - TFP_VERSION=0.8 - - TORCH_VERSION=1.5 + - TORCH_VERSION=1.7 - PYTHONWARNINGS=ignore install: - . ./ci/travis/ci.sh init RAY_CI_SGD_AFFECTED @@ -441,7 +441,7 @@ matrix: - PYTHON=3.6 - TF_VERSION=2.1.0 - TFP_VERSION=0.8 - - TORCH_VERSION=1.5 + - TORCH_VERSION=1.7 - PYTHONWARNINGS=ignore install: - . ./ci/travis/ci.sh init RAY_CI_PYTHON_AFFECTED,RAY_CI_TUNE_AFFECTED,RAY_CI_DOC_AFFECTED @@ -459,7 +459,7 @@ matrix: - INSTALL_HOROVOD=1 - TF_VERSION=2.1.0 - TFP_VERSION=0.8 - - TORCH_VERSION=1.5 + - TORCH_VERSION=1.7 - PYTHONWARNINGS=ignore install: - . ./ci/travis/ci.sh init RAY_CI_TUNE_AFFECTED,RAY_CI_SGD_AFFECTED diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index d11ba5867..7bc73e967 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -254,7 +254,7 @@ install_dependencies() { local torch_url="https://download.pytorch.org/whl/torch_stable.html" case "${OSTYPE}" in darwin*) pip install torch torchvision;; - *) pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f "${torch_url}";; + *) pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f "${torch_url}";; esac # Try n times; we often encounter OpenSSL.SSL.WantReadError (or others) @@ -312,12 +312,13 @@ install_dependencies() { # If CI has deemed that a different version of Tensorflow or Torch # should be installed, then upgrade/downgrade to that specific version. if [ -n "${TORCH_VERSION-}" ] || [ -n "${TFP_VERSION-}" ] || [ -n "${TF_VERSION-}" ]; then - case "${TORCH_VERSION-1.6}" in + case "${TORCH_VERSION-1.7}" in + 1.7) TORCHVISION_VERSION=0.8.1;; 1.5) TORCHVISION_VERSION=0.6.0;; *) TORCHVISION_VERSION=0.5.0;; esac pip install --use-deprecated=legacy-resolver --upgrade tensorflow-probability=="${TFP_VERSION-0.8}" \ - torch=="${TORCH_VERSION-1.6}" torchvision=="${TORCHVISION_VERSION}" \ + torch=="${TORCH_VERSION-1.7}" torchvision=="${TORCHVISION_VERSION}" \ tensorflow=="${TF_VERSION-2.2.0}" gym fi diff --git a/python/ray/util/sgd/torch/examples/dcgan.py b/python/ray/util/sgd/torch/examples/dcgan.py index 9bbf34f41..936272be2 100644 --- a/python/ray/util/sgd/torch/examples/dcgan.py +++ b/python/ray/util/sgd/torch/examples/dcgan.py @@ -182,8 +182,8 @@ class GANOperator(TrainingOperator): @override(TrainingOperator) def train_batch(self, batch, batch_info): """Trains on one batch of data from the data creator.""" - real_label = 1 - fake_label = 0 + real_label = 1.0 + fake_label = 0. discriminator, generator = self.models optimD, optimG = self.optimizers diff --git a/python/requirements_tune.txt b/python/requirements_tune.txt index 1c75eb888..d68d3b3d3 100644 --- a/python/requirements_tune.txt +++ b/python/requirements_tune.txt @@ -1,5 +1,4 @@ ax-platform -gpytorch==1.2 bayesian-optimization ConfigSpace==0.4.10 dragonfly-opt