@@ -236,6 +236,17 @@ def benchmark_1_gpu(self):
236
236
FLAGS .batch_size = 128
237
237
self ._run_and_report_benchmark ()
238
238
239
+ def benchmark_1_gpu_fp16 (self ):
240
+ """Test Keras model with 1 GPU with tf.keras mixed precision."""
241
+ self ._setup ()
242
+
243
+ FLAGS .num_gpus = 1
244
+ FLAGS .distribution_strategy = 'one_device'
245
+ FLAGS .model_dir = self ._get_model_dir ('benchmark_1_gpu_fp16' )
246
+ FLAGS .batch_size = 256
247
+ FLAGS .dtype = 'fp16'
248
+ self ._run_and_report_benchmark ()
249
+
239
250
def benchmark_1_gpu_amp (self ):
240
251
"""Test Keras model with 1 GPU with automatic mixed precision."""
241
252
self ._setup ()
@@ -273,6 +284,19 @@ def benchmark_1_gpu_eager(self):
273
284
FLAGS .single_l2_loss_op = True
274
285
self ._run_and_report_benchmark ()
275
286
287
+ def benchmark_1_gpu_fp16_eager (self ):
288
+ """Test Keras model with 1 GPU with fp16 and pure eager mode."""
289
+ self ._setup ()
290
+
291
+ FLAGS .num_gpus = 1
292
+ FLAGS .distribution_strategy = 'one_device'
293
+ FLAGS .model_dir = self ._get_model_dir ('benchmark_1_gpu_fp16_eager' )
294
+ FLAGS .batch_size = 128
295
+ FLAGS .dtype = 'fp16'
296
+ FLAGS .use_tf_function = False
297
+ FLAGS .single_l2_loss_op = True
298
+ self ._run_and_report_benchmark ()
299
+
276
300
def benchmark_8_gpu (self ):
277
301
"""Test Keras model with 8 GPUs."""
278
302
self ._setup ()
@@ -283,6 +307,17 @@ def benchmark_8_gpu(self):
283
307
FLAGS .batch_size = 128 * 8 # 8 GPUs
284
308
self ._run_and_report_benchmark ()
285
309
310
+ def benchmark_8_gpu_fp16 (self ):
311
+ """Test Keras model with 8 GPUs with tf.keras mixed precision."""
312
+ self ._setup ()
313
+
314
+ FLAGS .num_gpus = 8
315
+ FLAGS .distribution_strategy = 'mirrored'
316
+ FLAGS .model_dir = self ._get_model_dir ('benchmark_8_gpu_fp16' )
317
+ FLAGS .batch_size = 256 * 8 # 8 GPUs
318
+ FLAGS .dtype = 'fp16'
319
+ self ._run_and_report_benchmark ()
320
+
286
321
def benchmark_8_gpu_amp (self ):
287
322
"""Test Keras model with 8 GPUs with automatic mixed precision."""
288
323
self ._setup ()
0 commit comments