Skip to content

Commit bf1b5ee

Browse files
author
Swetha Mandava
committed
correcting image names, changing throughput computations
1 parent 5876314 commit bf1b5ee

12 files changed

Lines changed: 27 additions & 17 deletions

TensorFlow/LanguageModeling/BERT/data/images/trtis_base_summary.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_base_summary.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_bs_1.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_bs_1.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_bs_8.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_bs_8.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_dynamic.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_dynamic.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_ec_1.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_ec_1.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_ec_4.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_ec_4.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_large_summary.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_large_summary.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/data/images/trtis_static.png renamed to TensorFlow/LanguageModeling/BERT/data/images/triton_static.png

File renamed without changes.

TensorFlow/LanguageModeling/BERT/optimization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from horovod.tensorflow.compression import Compression
2929

3030
def create_optimizer(loss, init_lr, num_train_steps, num_warmup_steps, hvd=None, manual_fp16=False, use_fp16=False, num_accumulation_steps=1,
31-
optimizer_type="adam", allreduce_post_accumulation=False):
31+
optimizer_type="adam", allreduce_post_accumulation=False, init_loss_scale=2**32):
3232
"""Creates an optimizer training op."""
3333
global_step = tf.compat.v1.train.get_or_create_global_step()
3434

@@ -96,11 +96,11 @@ def create_optimizer(loss, init_lr, num_train_steps, num_warmup_steps, hvd=None,
9696
if hvd is not None and (num_accumulation_steps == 1 or (not allreduce_post_accumulation)):
9797
optimizer = hvd.DistributedOptimizer(optimizer, sparse_as_dense=True, compression=Compression.fp16 if use_fp16 or manual_fp16 else Compression.none)
9898
if use_fp16:
99-
loss_scaler = tf.train.experimental.DynamicLossScale(initial_loss_scale=2**32, increment_period=1000, multiplier=2.0)
99+
loss_scaler = tf.train.experimental.DynamicLossScale(initial_loss_scale=init_loss_scale, increment_period=1000, multiplier=2.0)
100100
optimizer = tf.train.experimental.enable_mixed_precision_graph_rewrite(optimizer, loss_scaler)
101101
loss_scale_value = tf.identity(loss_scaler(), name="loss_scale")
102102
if manual_fp16:
103-
loss_scale_manager = tf.contrib.mixed_precision.ExponentialUpdateLossScaleManager(init_loss_scale=2 ** 32,
103+
loss_scale_manager = tf.contrib.mixed_precision.ExponentialUpdateLossScaleManager(init_loss_scale=init_loss_scale,
104104
incr_every_n_steps=1000,
105105
decr_every_n_nan_or_inf=2,
106106
decr_ratio=0.5)
@@ -157,7 +157,7 @@ def update(accum_vars):
157157
lambda: update(accum_vars), lambda: tf.no_op())
158158

159159
new_global_step = tf.cond(tf.math.logical_and(update_step,
160-
tf.cast(hvd.allreduce(tf.cast(batch_finite, tf.int32)), tf.bool)) if hvd is not None else batch_finite,
160+
tf.cast(hvd.allreduce(tf.cast(batch_finite, tf.int32)), tf.bool) if hvd is not None else batch_finite),
161161
lambda: global_step+1,
162162
lambda: global_step)
163163
new_global_step = tf.identity(new_global_step, name='step_update')

TensorFlow/LanguageModeling/BERT/run_classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def main(_):
618618
tf.compat.v1.logging.info("Total Inference Time = %0.2f for Sentences = %d", eval_time_elapsed,
619619
eval_hooks[-1].count * FLAGS.eval_batch_size)
620620
tf.compat.v1.logging.info("Total Inference Time W/O Overhead = %0.2f for Sentences = %d", eval_time_wo_overhead,
621-
num_sentences))
621+
num_sentences)
622622
tf.compat.v1.logging.info("Summary Inference Statistics on EVAL set")
623623
tf.compat.v1.logging.info("Batch size = %d", FLAGS.eval_batch_size)
624624
tf.compat.v1.logging.info("Sequence Length = %d", FLAGS.max_seq_length)

0 commit comments

Comments
 (0)