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
58a3de6c
Unverified
Commit
58a3de6c
authored
Jun 28, 2019
by
Toby Boyd
Committed by
GitHub
Jun 28, 2019
Browse files
Add FP16 end-to-end tests (#7122)
parent
44ff121d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
2 deletions
+54
-2
official/transformer/v2/transformer_benchmark.py
official/transformer/v2/transformer_benchmark.py
+54
-2
No files found.
official/transformer/v2/transformer_benchmark.py
View file @
58a3de6c
...
...
@@ -284,14 +284,66 @@ class TransformerBigKerasAccuracy(TransformerBenchmark):
FLAGS
.
batch_size
=
3072
*
8
FLAGS
.
static_batch
=
True
FLAGS
.
max_length
=
64
FLAGS
.
train_steps
=
1
00000
FLAGS
.
steps_between_evals
=
5
000
FLAGS
.
train_steps
=
4
00000
FLAGS
.
steps_between_evals
=
20
000
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_static_batch'
)
self
.
_run_and_report_benchmark
(
total_batch_size
=
FLAGS
.
batch_size
,
log_steps
=
FLAGS
.
log_steps
,
bleu_min
=
28
,
bleu_max
=
29
)
def
benchmark_8_gpu_static_batch_fp16
(
self
):
"""Benchmark 8 gpu with static batch and fp16.
Should converge to 28.4 BLEU (uncased). This has not be verified yet."
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
data_dir
=
self
.
train_data_dir
FLAGS
.
vocab_file
=
self
.
vocab_file
# Sets values directly to avoid validation check.
FLAGS
[
'bleu_source'
].
value
=
self
.
bleu_source
FLAGS
[
'bleu_ref'
].
value
=
self
.
bleu_ref
FLAGS
.
param_set
=
'big'
FLAGS
.
batch_size
=
3072
*
8
FLAGS
.
static_batch
=
True
FLAGS
.
max_length
=
64
FLAGS
.
train_steps
=
400000
FLAGS
.
steps_between_evals
=
20000
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_8_gpu_static_batch_fp16'
)
self
.
_run_and_report_benchmark
(
total_batch_size
=
FLAGS
.
batch_size
,
log_steps
=
FLAGS
.
log_steps
,
bleu_min
=
28
,
bleu_max
=
29
)
def
benchmark_xla_8_gpu_static_batch_fp16
(
self
):
"""Benchmark 8 gpu with static batch, XLA, and FP16.
Should converge to 28.4 BLEU (uncased). This has not be verified yet."
"""
self
.
_setup
()
FLAGS
.
num_gpus
=
8
FLAGS
.
dtype
=
'fp16'
FLAGS
.
enable_xla
=
True
FLAGS
.
data_dir
=
self
.
train_data_dir
FLAGS
.
vocab_file
=
self
.
vocab_file
# Sets values directly to avoid validation check.
FLAGS
[
'bleu_source'
].
value
=
self
.
bleu_source
FLAGS
[
'bleu_ref'
].
value
=
self
.
bleu_ref
FLAGS
.
param_set
=
'big'
FLAGS
.
batch_size
=
3072
*
8
FLAGS
.
static_batch
=
True
FLAGS
.
max_length
=
64
FLAGS
.
train_steps
=
400000
FLAGS
.
steps_between_evals
=
20000
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_xla_8_gpu_static_batch_fp16'
)
self
.
_run_and_report_benchmark
(
total_batch_size
=
FLAGS
.
batch_size
,
log_steps
=
FLAGS
.
log_steps
,
bleu_min
=
28
,
bleu_max
=
29
)
class
TransformerKerasBenchmark
(
TransformerBenchmark
):
"""Benchmarks for Transformer (Base and Big) using Keras."""
...
...
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