Skip to content

Commit 27e3cbd

Browse files
committed
Update scoring scripts
1 parent e3099b2 commit 27e3cbd

3 files changed

Lines changed: 8 additions & 45 deletions

File tree

scoring/performance_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# workloads and rules for the scoring to be correct.
6060
# We do not use the workload registry since it contains test and development
6161
# workloads as well.
62-
NUM_BASE_WORKLOADS = 8
62+
NUM_BASE_WORKLOADS = 9
6363
NUM_VARIANT_WORKLOADS = 0
6464
NUM_TRIALS = 5
6565
NUM_STUDIES = 3

scoring/score_submissions.py

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
FLAGS = flags.FLAGS
7676

7777

78-
def get_summary_df(workload, workload_df, include_test_split=False):
78+
def get_summary_df(workload, workload_df):
7979
print(f' WORKLOAD: {workload}')
8080
validation_metric, validation_target = (
81-
scoring_utils.get_workload_metrics_and_targets(workload, split='validation')
81+
scoring_utils.get_workload_metrics_and_targets(workload)
8282
)
8383

8484
is_minimized = performance_profile.check_if_minimized(validation_metric)
@@ -145,51 +145,18 @@ def delta(series):
145145

146146
summary_df['step_hint'] = scoring_utils.get_workload_stephint(workload)
147147

148-
# test metrics
149-
if include_test_split:
150-
test_metric, test_target = scoring_utils.get_workload_metrics_and_targets(
151-
workload, split='test'
152-
)
153-
154-
summary_df['test target metric name'] = test_metric
155-
summary_df['test target metric value'] = test_target
156-
157-
summary_df['test target reached'] = (
158-
workload_df[test_metric]
159-
.apply(lambda x: target_op(x, test_target))
160-
.apply(np.any)
161-
)
162-
summary_df['best metric value on test'] = workload_df[test_metric].apply(
163-
lambda x: best_op(x)
164-
)
165-
workload_df['index best eval on test'] = workload_df[test_metric].apply(
166-
lambda x: idx_op(x)
167-
)
168-
summary_df['time to best eval on test (s)'] = workload_df.apply(
169-
lambda x: x['accumulated_submission_time'][x['index best eval on test']],
170-
axis=1,
171-
)
172-
summary_df['time to target on test (s)'] = summary_df.apply(
173-
lambda x: x['time to best eval on test (s)']
174-
if x['test target reached']
175-
else np.inf,
176-
axis=1,
177-
)
178-
179148
return summary_df
180149

181150

182-
def get_submission_summary(df, include_test_split=False):
151+
def get_submission_summary(df):
183152
"""Summarizes the submission results into metric and time tables
184153
organized by workload.
185154
"""
186155

187156
dfs = []
188157
print(df)
189158
for workload, group in df.groupby('workload'):
190-
summary_df = get_summary_df(
191-
workload, group, include_test_split=include_test_split
192-
)
159+
summary_df = get_summary_df(workload, group)
193160
dfs.append(summary_df)
194161

195162
df = pd.concat(dfs)

scoring/scoring_utils.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def get_experiment_df(experiment_dir):
214214

215215

216216
## Get workload properties
217-
def get_workload_metrics_and_targets(workload, split='validation'):
217+
def get_workload_metrics_and_targets(workload):
218218
"""Returns workload target metric name and value."""
219219
workload_name = re.match(WORKLOAD_NAME_PATTERN, workload).group(1)
220220
framework = re.match(WORKLOAD_NAME_PATTERN, workload).group(2)
@@ -233,12 +233,8 @@ def get_workload_metrics_and_targets(workload, split='validation'):
233233
workload_init_kwargs=workload_init_kwargs,
234234
)
235235
metric_name = workload_obj.target_metric_name
236-
if split == 'validation':
237-
metric = f'validation/{metric_name}'
238-
target = workload_obj.validation_target_value
239-
elif split == 'test':
240-
metric = f'test/{metric_name}'
241-
target = workload_obj.test_target_value
236+
metric = f'validation/{metric_name}'
237+
target = workload_obj.validation_target_value
242238
return metric, target
243239

244240

0 commit comments

Comments
 (0)