"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "cc983cd9cd6d662a7f6eae16d7af24e5d92fbc15"
Unverified Commit 83dba10b authored by Sam Shleifer's avatar Sam Shleifer Committed by GitHub
Browse files

[s2s] distributed_eval.py saves better speed info (#7242)

parent af2322c7
...@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment