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
1924dde7
Commit
1924dde7
authored
Mar 12, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Mar 12, 2020
Browse files
Internal change
PiperOrigin-RevId: 300654832
parent
7abe53af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
106 deletions
+0
-106
official/benchmark/keras_imagenet_benchmark.py
official/benchmark/keras_imagenet_benchmark.py
+0
-106
No files found.
official/benchmark/keras_imagenet_benchmark.py
View file @
1924dde7
...
@@ -61,18 +61,6 @@ class Resnet50KerasAccuracy(keras_benchmark.KerasBenchmark):
...
@@ -61,18 +61,6 @@ class Resnet50KerasAccuracy(keras_benchmark.KerasBenchmark):
super
(
Resnet50KerasAccuracy
,
self
).
__init__
(
super
(
Resnet50KerasAccuracy
,
self
).
__init__
(
output_dir
=
output_dir
,
flag_methods
=
flag_methods
)
output_dir
=
output_dir
,
flag_methods
=
flag_methods
)
def
benchmark_graph_8_gpu
(
self
):
"""Test Keras model with Keras fit/dist_strat and 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
data_dir
=
self
.
data_dir
FLAGS
.
batch_size
=
128
*
8
FLAGS
.
train_epochs
=
90
FLAGS
.
epochs_between_evals
=
10
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu'
)
FLAGS
.
dtype
=
'fp32'
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu
(
self
):
def
benchmark_8_gpu
(
self
):
"""Test Keras model with eager, dist_strat and 8 GPUs."""
"""Test Keras model with eager, dist_strat and 8 GPUs."""
self
.
_setup
()
self
.
_setup
()
...
@@ -135,30 +123,6 @@ class Resnet50KerasAccuracy(keras_benchmark.KerasBenchmark):
...
@@ -135,30 +123,6 @@ class Resnet50KerasAccuracy(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_8_gpu_mlperf_like
(
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'
)
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
self
.
_run_and_report_benchmark
(
top_1_min
=
0.736
)
def
benchmark_xla_8_gpu_fp16_dynamic
(
self
):
def
benchmark_xla_8_gpu_fp16_dynamic
(
self
):
"""Test Keras model with XLA, eager, dist_strat, 8 GPUs, dynamic fp16."""
"""Test Keras model with XLA, eager, dist_strat, 8 GPUs, dynamic fp16."""
self
.
_setup
()
self
.
_setup
()
...
@@ -976,76 +940,6 @@ class TrivialKerasBenchmarkReal(keras_benchmark.KerasBenchmark):
...
@@ -976,76 +940,6 @@ class TrivialKerasBenchmarkReal(keras_benchmark.KerasBenchmark):
FLAGS
.
train_steps
=
700
FLAGS
.
train_steps
=
700
self
.
_run_and_report_benchmark
()
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu
(
self
):
"""Test trivial Keras model (input pipeline) with 1 GPU."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu'
)
FLAGS
.
batch_size
=
256
self
.
_run_and_report_benchmark
()
def
benchmark_graph_1_gpu
(
self
):
"""Test trivial Keras model (input pipeline) with 1 GPU."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_1_gpu'
)
FLAGS
.
batch_size
=
256
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu
(
self
):
"""Test trivial Keras model (input pipeline) with 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu'
)
FLAGS
.
batch_size
=
256
*
8
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu_tweaked
(
self
):
"""Test trivial Keras model with tuning and 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
enable_eager
=
True
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_tweaked'
)
FLAGS
.
batch_size
=
256
*
8
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
datasets_num_private_threads
=
48
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu
(
self
):
"""Test trivial Keras model in legacy graph mode with 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu'
)
FLAGS
.
batch_size
=
256
*
8
self
.
_run_and_report_benchmark
()
def
benchmark_graph_8_gpu_tweaked
(
self
):
"""Test trivial Keras model in legacy graph mode with tuning and 8 GPUs."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
enable_eager
=
False
FLAGS
.
enable_xla
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_graph_8_gpu_tweaked'
)
FLAGS
.
batch_size
=
256
*
8
FLAGS
.
tf_gpu_thread_mode
=
'gpu_private'
FLAGS
.
datasets_num_private_threads
=
48
self
.
_run_and_report_benchmark
()
def
fill_report_object
(
self
,
stats
):
def
fill_report_object
(
self
,
stats
):
super
(
TrivialKerasBenchmarkReal
,
self
).
fill_report_object
(
super
(
TrivialKerasBenchmarkReal
,
self
).
fill_report_object
(
stats
,
stats
,
...
...
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