-
Notifications
You must be signed in to change notification settings - Fork 250
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
Remove stats with NaN values #1784
Conversation
src/helm/benchmark/metrics/metric.py
Outdated
@@ -88,6 +89,19 @@ def process(self, request_state_set: RequestStateSet) -> List[Stat]: | |||
) | |||
) | |||
|
|||
# Drop any instance stats that contain NaN, because Python's stdlib json.dumps() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only question is whether this is the right place to put it. I think maybe we should at least make this a helper function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it could be better to put it closer to the point of serialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make it clear that upstream computation should not produce NaNs, and this is just a bandaid safety check? (In which case, we should fix things upstream.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I moved it to the point of serialization. I'll do the upstream fix in a different PR.
Drop any instance stats that contain
NaN
, because Python's stdlibjson.dumps()
will produce invalid JSON when serializing aNaN
.See:
Addresses #1765