Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
83dba10b
Unverified
Commit
83dba10b
authored
Sep 18, 2020
by
Sam Shleifer
Committed by
GitHub
Sep 18, 2020
Browse files
[s2s] distributed_eval.py saves better speed info (#7242)
parent
af2322c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/seq2seq/run_distributed_eval.py
examples/seq2seq/run_distributed_eval.py
+2
-1
No files found.
examples/seq2seq/run_distributed_eval.py
View file @
83dba10b
...
@@ -176,7 +176,8 @@ def run_generate():
...
@@ -176,7 +176,8 @@ def run_generate():
metrics
:
Dict
=
score_fn
(
preds
,
labels
)
metrics
:
Dict
=
score_fn
(
preds
,
labels
)
metrics
[
"n_obs"
]
=
len
(
preds
)
metrics
[
"n_obs"
]
=
len
(
preds
)
runtime
=
time
.
time
()
-
start_time
runtime
=
time
.
time
()
-
start_time
metrics
[
"seconds_per_sample"
]
=
round
(
runtime
/
metrics
[
"n_obs"
],
2
)
metrics
[
"seconds_per_sample"
]
=
round
(
runtime
/
metrics
[
"n_obs"
],
4
)
metrics
[
"n_gpus"
]
=
num_replicas
# TODO(@stas00): add whatever metadata to metrics
# TODO(@stas00): add whatever metadata to metrics
metrics_save_path
=
save_dir
.
joinpath
(
f
"
{
args
.
type_path
}
_
{
metric_name
}
.json"
)
metrics_save_path
=
save_dir
.
joinpath
(
f
"
{
args
.
type_path
}
_
{
metric_name
}
.json"
)
save_json
(
metrics
,
metrics_save_path
,
indent
=
None
)
save_json
(
metrics
,
metrics_save_path
,
indent
=
None
)
...
...
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