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
0dfc5730
Commit
0dfc5730
authored
Aug 13, 2019
by
Toby Boyd
Browse files
Removed tests not longer closely monitored.
parent
01d28a37
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
218 deletions
+0
-218
official/resnet/keras/keras_imagenet_benchmark.py
official/resnet/keras/keras_imagenet_benchmark.py
+0
-218
No files found.
official/resnet/keras/keras_imagenet_benchmark.py
View file @
0dfc5730
...
...
@@ -112,32 +112,6 @@ class Resnet50KerasAccuracy(keras_benchmark.KerasBenchmark):
FLAGS
.
use_tensor_lr
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu_mlperf_like_tweaked
(
self
):
"""Test similar to the rules for MLPerf 0.5.
Listed below are reasons this comparison is not to the MLSpec, but this is
still a decent directional measurement:
- Eval is every 4 epochs and again at the end. ~2 extra times.
- Learning rate is not tuned to hit 75%, but we know the model is correct.
- We measure total time and MLPerf 0.5 excluded some startup time.
- Eval is not on the total set, need to set eval batch_size where
8*batch_size/50K is even. 250 is a good number.
- Not sure if we are doing any extra or too few steps due to epoch bleed.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
data_dir
=
self
.
data_dir
FLAGS
.
batch_size
=
256
*
8
FLAGS
.
train_epochs
=
61
FLAGS
.
epochs_between_evals
=
4
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_mlperf_like_tweaked'
)
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
use_tensor_lr
=
True
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
(
top_1_min
=
0.736
)
def
benchmark_8_gpu_mlperf_like
(
self
):
"""Test similar to the rules for MLPerf 0.5.
...
...
@@ -277,48 +251,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
batch_size
=
64
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_no_dist_strat_force_v1_path_run_eagerly
(
self
):
"""Forced v1 execution in tf.compile path and force eager."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
True
FLAGS
.
run_eagerly
=
True
FLAGS
.
distribution_strategy
=
'off'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_no_dist_strat_force_v1_path_run_eagerly'
)
FLAGS
.
batch_size
=
64
FLAGS
.
force_v2_in_keras_compile
=
False
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_no_dist_strat_force_v1_path_run_eagerly_tweaked
(
self
):
"""Forced v1 execution in tf.compile path and force eager."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
True
FLAGS
.
run_eagerly
=
True
FLAGS
.
explicit_gpu_placement
=
True
FLAGS
.
distribution_strategy
=
'off'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_no_dist_strat_force_v1_path_run_eagerly_tweaked'
)
FLAGS
.
batch_size
=
64
FLAGS
.
force_v2_in_keras_compile
=
False
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_no_dist_strat_force_v1_path
(
self
):
"""No dist strat but forced v1 execution tf.compile path."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
True
FLAGS
.
distribution_strategy
=
'off'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_no_dist_strat_force_v1_path'
)
FLAGS
.
batch_size
=
128
FLAGS
.
force_v2_in_keras_compile
=
False
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_no_dist_strat_run_eagerly_fp16
(
self
):
"""Test with 1 GPU, no distribution strategy, fp16, run eagerly."""
self
.
_setup
()
...
...
@@ -437,20 +369,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
def
benchmark_xla_1_gpu_fp16_slack
(
self
):
"""Test Keras model tf.data's experimental_slack functionality."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_1_gpu_fp16_slack'
)
FLAGS
.
dtype
=
'fp16'
FLAGS
.
batch_size
=
256
FLAGS
.
tf_data_experimental_slack
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_xla_1_gpu_fp16_dynamic
(
self
):
"""Test Keras model with XLA, 1 GPU, fp16, and dynamic loss scaling."""
self
.
_setup
()
...
...
@@ -529,21 +447,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_1_gpu_fp16_slack
(
self
):
"""Test model in legacy graph with tf.data's experimental_slack."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_xla_1_gpu_fp16_slack'
)
FLAGS
.
dtype
=
'fp16'
FLAGS
.
batch_size
=
256
FLAGS
.
tf_data_experimental_slack
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu
(
self
):
"""Test Keras model with 8 GPUs."""
self
.
_setup
()
...
...
@@ -568,18 +471,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
datasets_num_private_threads
=
14
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu_slack
(
self
):
"""Test Keras model with tf.data's experimental_slack and 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
enable_eager
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_slack'
)
FLAGS
.
batch_size
=
128
*
8
# 8 GPUs
FLAGS
.
tf_data_experimental_slack
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu
(
self
):
"""Test Keras model with XLA and 8 GPUs."""
self
.
_setup
()
...
...
@@ -649,24 +540,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16_optional_next
(
self
):
"""Test Keras model with XLA, 8 GPUs and fp16.
This test also enables get_next_as_optional.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_8_gpu_fp16_optional_next'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
enable_get_next_as_optional
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16
(
self
):
"""Test Keras model with XLA, 8 GPUs and fp16."""
self
.
_setup
()
...
...
@@ -716,44 +589,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
train_steps
=
310
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16_tweaked_optional_next
(
self
):
"""Test Keras model with manual config tuning, XLA, 8 GPUs, fp16.
This test also enables get_next_as_optional.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_8_gpu_fp16_tweaked_optional_next'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
use_tensor_lr
=
True
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
datasets_num_private_threads
=
48
FLAGS
.
enable_get_next_as_optional
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16_slack
(
self
):
"""Test Keras model with XLA, 8 GPUs and fp16.
This test also enable tf.data's experimental_slack functionality.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_8_gpu_fp16_slack'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
tf_data_experimental_slack
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16_dynamic_tweaked
(
self
):
"""Test Keras model with config tuning, XLA, 8 GPUs and dynamic fp16."""
self
.
_setup
()
...
...
@@ -772,24 +607,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
datasets_num_private_threads
=
48
self
.
_run_and_report_benchmark
()
def
benchmark_xla_8_gpu_fp16_tensorboard_tweaked
(
self
):
"""Test to track Tensorboard performance overhead."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_8_gpu_fp16_tensorboard_tweaked'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
use_tensor_lr
=
True
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
datasets_num_private_threads
=
48
FLAGS
.
enable_tensorboard
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu
(
self
):
"""Test Keras model in legacy graph mode with 8 GPUs."""
self
.
_setup
()
...
...
@@ -888,41 +705,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS
.
train_steps
=
310
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_8_gpu_fp16_tweaked_optional_next
(
self
):
"""Test in legacy graph mode with manual config tuning, XLA, 8 GPUs, fp16.
This test also enables get_next_as_optional.
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_xla_8_gpu_fp16_tweaked_optional_next'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
use_tensor_lr
=
True
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
enable_get_next_as_optional
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_graph_xla_8_gpu_fp16_slack
(
self
):
"""Test legacy graph mode with tf.data's experimental_slack."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
distribution_strategy
=
'default'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_xla_8_gpu_fp16_slack'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
tf_data_experimental_slack
=
True
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
()
...
...
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