Skip to content

Commit 8bd36f5

Browse files
Setup main in compute score module
1 parent fb4f4bc commit 8bd36f5

File tree

1 file changed

+25
-9
lines changed
  • mlperf_logging/result_summarizer/compute_score

1 file changed

+25
-9
lines changed

mlperf_logging/result_summarizer/compute_score/__main__.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from .. import result_summarizer
2+
from ...rcp_checker import rcp_checker
23
from ...compliance_checker.mlp_compliance import usage_choices, rule_choices
34
import argparse
45

@@ -8,40 +9,55 @@ def get_compute_args():
89
prog="mlperf_logging.result_summarizer.compute_score",
910
description="Compute the score of a single benchmark",
1011
)
11-
parser.add_argument("benchmark", type=str, help="TODO:", required=True)
12-
parser.add_argument("system", type=str, help="System name", default=None)
12+
parser.add_argument("--benchmark", type=str, help="TODO:", required=True)
13+
parser.add_argument("--system", type=str, help="System name", default=None)
1314
parser.add_argument(
14-
"has_power", action="store_true", help="Compute power score as well"
15+
"--has_power", action="store_true", help="Compute power score as well"
1516
)
1617
parser.add_argument(
17-
"benchmark_folder", type=str, help="Folder containing all the result files", required=True
18+
"--benchmark_folder", type=str, help="Folder containing all the result files", required=True
1819
)
1920
parser.add_argument(
20-
"usage",
21+
"--usage",
2122
type=str,
2223
default="training",
2324
choices=usage_choices(),
2425
help="the usage such as training, hpc, inference_edge, inference_server",
2526
required=True,
2627
)
2728
parser.add_argument(
28-
"ruleset",
29+
"--ruleset",
2930
type=str,
3031
choices=rule_choices(),
3132
help="the ruleset such as 0.6.0, 0.7.0, or 1.0.0",
3233
required=True,
3334
)
34-
3535
parser.add_argument(
36-
"weak_scaling", action="store_true", help="Compute weak scaling score"
36+
"--is_weak_scaling", action="store_true", help="Compute weak scaling score"
37+
)
38+
parser.add_argument(
39+
"--scale", action="store_true", help="Compute the scaling factor"
3740
)
3841

3942
return parser.parse_args()
4043

4144

4245
args = get_compute_args()
4346

44-
if args.weak_scaling:
47+
if args.scale:
48+
rcp_checker.check_directory(
49+
args.benchmark_folder,
50+
args.usage,
51+
args.ruleset,
52+
False
53+
False,
54+
rcp_file=None,
55+
rcp_pass='pruned_rcps',
56+
rcp_bypass=False,
57+
set_scaling=True,
58+
)
59+
60+
if args.is_weak_scaling:
4561
scores, power_scores = result_summarizer._compute_weak_score_standalone(
4662
args.benchmark,
4763
args.system,

0 commit comments

Comments
 (0)