Skip to content

Commit

Permalink
Bump up TensorFlow version to 2.7 in tests (NVIDIA#3475)
Browse files Browse the repository at this point in the history
- removes out of the box support for TensorFlow 2.5.x in DALI
  (it is not tested and no prebuild plugin is provided but it still
  can be compiled during the installation and may work)
- adjust TL1_tensorflow-dali_test test

Signed-off-by: Janusz Lisiecki <[email protected]>
  • Loading branch information
JanuszL authored Nov 10, 2021
1 parent e51aa17 commit 04d7b00
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def create_piecewise_constant_decay_with_warmup(batch_size, epoch_size,
lr_values, warmup_steps,
compute_lr_on_cpu, name)

@tf.keras.utils.register_keras_serializable(package='Custom')
class PiecewiseConstantDecayWithWarmup(
tf.keras.optimizers.schedules.LearningRateSchedule):
"""Piecewise constant decay with warmup schedule."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from builtins import range
from nvutils import image_processing
from nvutils import common
from nvutils import hvd_patch

import tensorflow as tf
import tensorflow.keras as keras
Expand Down Expand Up @@ -163,7 +162,7 @@ def train(model_func, params):
opt = keras.optimizers.SGD(learning_rate=lr_schedule, momentum=momentum)
# Horovod: add Horovod DistributedOptimizer. We use a modified version to
# support the custom learning rate schedule.
opt = hvd_patch.DistributedOptimizer(opt)
opt = hvd.DistributedOptimizer(opt)
if tf.__version__ >= "2.4.0" and precision == 'fp16':
opt = keras.mixed_precision.LossScaleOptimizer(opt, dynamic=False,
initial_scale=loss_scale)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from builtins import range
from nvutils import image_processing
from nvutils import common
from nvutils import hvd_patch

import tensorflow as tf
import tensorflow.keras as keras
Expand Down
6 changes: 3 additions & 3 deletions qa/TL1_tensorflow-dali_test/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e
pip_packages="horovod==0.21.3"
pip_packages="horovod==0.23.0"
target_dir=./docs/examples/use_cases/tensorflow/resnet-n

do_once() {
Expand All @@ -14,7 +14,7 @@ do_once() {

# check if CUDA version is at least 11.x
if [ "${CUDA_VERSION:0:2}" == "11" ]; then
# install TF 2.5.x for CUDA 11.x test
# install TF 2.6.x for CUDA 11.x test
install_pip_pkg "pip install $($topdir/qa/setup_packages.py -i 0 -u tensorflow-gpu --cuda ${CUDA_VERSION}) -f /pip-packages"
else
# install TF 2.3.x for CUDA 10.x test
Expand Down Expand Up @@ -58,7 +58,7 @@ do_once() {
export HOROVOD_WITHOUT_PYTORCH=1
# horovod is added to `pip_packages` so it can be preloaded, but install it here when
# TF is already available and we can set env variables
install_pip_pkg "pip install --force-reinstall horovod==0.21.3 -f /pip-packages"
install_pip_pkg "pip install --force-reinstall horovod==0.23.0 -f /pip-packages"

for file in $(ls /data/imagenet/train-val-tfrecord-480-subset);
do
Expand Down
8 changes: 4 additions & 4 deletions qa/setup_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ def get_pyvers_name(self, url, cuda_version):
"mxnet-cu{cuda_v}"),
CudaPackage("tensorflow-gpu",
{ "100" : [
PckgVer("1.15.5", python_max_ver="3.7"),
PckgVer("1.15.5", python_max_ver="3.7"),
"2.3.3"],
"110" : [
PckgVer("1.15.5", python_max_ver="3.7"),
"2.5.1",
PckgVer("2.6.0", dependencies=["tensorflow-estimator==2.6.0", "keras==2.6.0"]),
PckgVer("1.15.5", python_max_ver="3.7"),
PckgVer("2.6.2", dependencies=["tensorflow-estimator==2.6.0"]),
PckgVer("2.7.0"),
PckgVer("1.15.5+nv21.09", python_min_ver="3.8", python_max_ver="3.8", alias="nvidia-tensorflow")]
}),
CudaPackageExtraIndex("torch",
Expand Down

0 comments on commit 04d7b00

Please sign in to comment.