Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
4ad73a1c
Commit
4ad73a1c
authored
Apr 23, 2019
by
Haoyu Zhang
Committed by
Toby Boyd
Apr 23, 2019
Browse files
Add tests to track 8 GPU fp16 performance in legacy graph mode (#6653)
parent
50dfb31d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
official/resnet/keras/keras_imagenet_benchmark.py
official/resnet/keras/keras_imagenet_benchmark.py
+42
-0
No files found.
official/resnet/keras/keras_imagenet_benchmark.py
View file @
4ad73a1c
...
@@ -508,6 +508,18 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
...
@@ -508,6 +508,18 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
batch_size
=
128
*
8
# 8 GPUs
FLAGS
.
batch_size
=
128
*
8
# 8 GPUs
self
.
_run_and_report_benchmark
()
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu_fp16
(
self
):
"""Test Keras model in legacy graph mode with 8 GPUs and fp16."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
False
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu_fp16'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_8_gpu_fp16
(
self
):
def
benchmark_graph_xla_8_gpu_fp16
(
self
):
"""Test Keras model in legacy graph mode with XLA, 8 GPUs and fp16."""
"""Test Keras model in legacy graph mode with XLA, 8 GPUs and fp16."""
self
.
_setup
()
self
.
_setup
()
...
@@ -521,6 +533,21 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
...
@@ -521,6 +533,21 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
self
.
_run_and_report_benchmark
()
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu_fp16_tweaked
(
self
):
"""Test Keras model in legacy graph mode with manual config tuning, 8 GPUs
and fp16.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
False
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu_fp16_tweaked'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_8_gpu_fp16_tweaked
(
self
):
def
benchmark_graph_xla_8_gpu_fp16_tweaked
(
self
):
"""Test Keras model in legacy graph mode with manual config tuning, XLA,
"""Test Keras model in legacy graph mode with manual config tuning, XLA,
8 GPUs and fp16.
8 GPUs and fp16.
...
@@ -538,6 +565,21 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
...
@@ -538,6 +565,21 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu_fp16_dynamic_tweaked
(
self
):
"""Test graph Keras with config tuning, 8 GPUs and dynamic fp16."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
False
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu_fp16_dynamic_tweaked'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
loss_scale
=
'dynamic'
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_8_gpu_fp16_dynamic_tweaked
(
self
):
def
benchmark_graph_xla_8_gpu_fp16_dynamic_tweaked
(
self
):
"""Test graph Keras with config tuning, XLA, 8 GPUs and dynamic fp16."""
"""Test graph Keras with config tuning, XLA, 8 GPUs and dynamic fp16."""
self
.
_setup
()
self
.
_setup
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment