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
4b06a97a
Commit
4b06a97a
authored
Dec 14, 2019
by
Zongwei Zhou
Committed by
A. Unique TensorFlower
Dec 14, 2019
Browse files
Add Resnet-50 CTL FP16 benchmarks
PiperOrigin-RevId: 285568490
parent
0788a23c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
official/benchmark/resnet_ctl_imagenet_benchmark.py
official/benchmark/resnet_ctl_imagenet_benchmark.py
+35
-0
No files found.
official/benchmark/resnet_ctl_imagenet_benchmark.py
View file @
4b06a97a
...
...
@@ -236,6 +236,17 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
FLAGS
.
batch_size
=
128
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_fp16
(
self
):
"""Test Keras model with 1 GPU with tf.keras mixed precision."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
distribution_strategy
=
'one_device'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_fp16'
)
FLAGS
.
batch_size
=
256
FLAGS
.
dtype
=
'fp16'
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_amp
(
self
):
"""Test Keras model with 1 GPU with automatic mixed precision."""
self
.
_setup
()
...
...
@@ -273,6 +284,19 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
FLAGS
.
single_l2_loss_op
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_fp16_eager
(
self
):
"""Test Keras model with 1 GPU with fp16 and pure eager mode."""
self
.
_setup
()
FLAGS
.
num_gpus
=
1
FLAGS
.
distribution_strategy
=
'one_device'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_fp16_eager'
)
FLAGS
.
batch_size
=
128
FLAGS
.
dtype
=
'fp16'
FLAGS
.
use_tf_function
=
False
FLAGS
.
single_l2_loss_op
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu
(
self
):
"""Test Keras model with 8 GPUs."""
self
.
_setup
()
...
...
@@ -283,6 +307,17 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
FLAGS
.
batch_size
=
128
*
8
# 8 GPUs
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu_fp16
(
self
):
"""Test Keras model with 8 GPUs with tf.keras mixed precision."""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
distribution_strategy
=
'mirrored'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_fp16'
)
FLAGS
.
batch_size
=
256
*
8
# 8 GPUs
FLAGS
.
dtype
=
'fp16'
self
.
_run_and_report_benchmark
()
def
benchmark_8_gpu_amp
(
self
):
"""Test Keras model with 8 GPUs with automatic mixed precision."""
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