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
f4147e22
Commit
f4147e22
authored
Jan 31, 2020
by
Zongwei Zhou
Committed by
A. Unique TensorFlower
Jan 31, 2020
Browse files
Enable Resnet50 and BERT 1GPU pure eager throughput test
PiperOrigin-RevId: 292671694
parent
c7ad20a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
official/benchmark/bert_squad_benchmark.py
official/benchmark/bert_squad_benchmark.py
+24
-0
official/benchmark/resnet_ctl_imagenet_benchmark.py
official/benchmark/resnet_ctl_imagenet_benchmark.py
+2
-2
No files found.
official/benchmark/bert_squad_benchmark.py
View file @
f4147e22
...
...
@@ -185,6 +185,17 @@ class BertSquadBenchmarkReal(BertSquadBenchmarkBase):
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_eager
(
self
):
"""Tests BERT SQuAD model performance with 1 GPU."""
self
.
_setup
()
self
.
num_gpus
=
1
FLAGS
.
run_eagerly
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_squad_eager'
)
FLAGS
.
train_batch_size
=
2
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_xla
(
self
):
"""Tests BERT SQuAD model performance with 1 GPU with XLA."""
...
...
@@ -249,6 +260,19 @@ class BertSquadBenchmarkReal(BertSquadBenchmarkBase):
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_fp16_eager
(
self
):
"""Tests BERT SQuAD model performance with 1 GPU and FP16."""
self
.
_setup
()
self
.
num_gpus
=
1
FLAGS
.
run_eagerly
=
True
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_squad_fp16_eager'
)
FLAGS
.
train_batch_size
=
4
FLAGS
.
dtype
=
'fp16'
FLAGS
.
loss_scale
=
'dynamic'
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_fp16
(
self
):
"""Tests BERT SQuAD model performance with 1 GPU and FP16."""
...
...
official/benchmark/resnet_ctl_imagenet_benchmark.py
View file @
f4147e22
...
...
@@ -279,7 +279,7 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
FLAGS
.
num_gpus
=
1
FLAGS
.
distribution_strategy
=
'one_device'
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_1_gpu_eager'
)
FLAGS
.
batch_size
=
64
FLAGS
.
batch_size
=
108
FLAGS
.
use_tf_function
=
False
FLAGS
.
single_l2_loss_op
=
True
self
.
_run_and_report_benchmark
()
...
...
@@ -291,7 +291,7 @@ class Resnet50CtlBenchmarkBase(CtlBenchmark):
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
.
batch_size
=
216
FLAGS
.
dtype
=
'fp16'
FLAGS
.
use_tf_function
=
False
FLAGS
.
single_l2_loss_op
=
True
...
...
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