Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scoring bug, properly handeling nan values #780

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

fsschneider
Copy link
Contributor

When computing our benchmark scores, we want to "ignore" runs on a base workload, if the submission doesn't hit the target on the held-out workload. This is implemented here:

# For each held-out workload if variant target was not hit set submission to inf
for workload in df.keys():
if workload not in BASE_WORKLOADS:
# If variants do not have finite score set base_workload score to inf
base_workload = get_base_workload_name(workload)
df[base_workload] = df.apply(
variant_criteria_filter(base_workload, workload), axis=1)

However, the variant_criteria_filter() only checks for np.inf values (
def variant_criteria_filter(base_workload, variant_workload):
def filter(x):
try:
if x[variant_workload] == np.inf:
return np.inf
else:
return x[base_workload]
except KeyError as e:
print(x.keys())
raise e
return filter
).
But another invalid score that can occur is a nan. This happens, e.g. when running OOM. In this case, the base workload score should also be ignored.

This PR fixes this issue. To properly do so, it also needs to load the list of held-out workloads (to drop all other workload variants that have only been computed for the baseline).

@fsschneider fsschneider requested a review from a team as a code owner August 29, 2024 11:34
@fsschneider fsschneider changed the base branch from main to dev August 29, 2024 11:34
Copy link

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@priyakasimbeg priyakasimbeg merged commit 3b832f4 into mlcommons:dev Aug 29, 2024
16 of 19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants