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

Resolving objectives issue introduced with introduction of pass search #1585

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

shaahji
Copy link
Contributor

@shaahji shaahji commented Jan 29, 2025

Resolving objectives issue introduced with introduction of pass search

Olive allows multiple passes under the "passes" key in config where each entry can have dictate its own evaluator config i.e. the evaluation config to use for that specific pass. However, with pass search, this becomes an issue because each pass within the group can dictate conflicting objectives and goals. Circumventing the issue by collecting all the objectives across the group with the last one in the list winning if named the same. Also, handle the case where not all objectives are generated as part of the
post evaluation signal.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to update example documentation in a follow-up PR.

(Optional) Issue link

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@shaahji shaahji force-pushed the shaahji/objectives branch from 9538e76 to 7fe2dd5 Compare January 31, 2025 23:30
}
return all((multipliers[obj] * result[obj].value) >= (multipliers[obj] * goal) for obj, goal in goals.items())
result, _ = self._results[search_point_index]
return all(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if the results is missing the value for a metric that has a goal coming from another pass' evaluator?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might need an if condition in the loop here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signal doesn't include any identification for which pass generated it so yes, that's still a problem.

Honestly, the whole concept of objectives, goals, and metrics, need a revisit with emphasis on search.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if you add if name in results check so that it doesn't hit an index error atleast. if the passes used the same metric but different objectives, then the last one taking priority already enforces that one metric name can only have one objective.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the SearchStrategy level, I can see a reason i.e. to conditionally discard search points that don't meet a goal.

Within the context of SearchResult, how does goals matter? As long as the results are sorted based on priority and the signal values, why does goals matter? SearchResult shoudn't even be accounting for any goals at all.

Copy link
Contributor

@jambayk jambayk Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this method is used for early stopping here

and state.results.meets_goals(search_point.index)
, wouldn't that cause an index error if the metric is missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the SearchStrategy level, I can see a reason i.e. to conditionally discard search points that don't meet a goal.

Within the context of SearchResult, how does goals matter? As long as the results are sorted based on priority and the signal values, why does goals matter? SearchResult shoudn't even be accounting for any goals at all.

My comment was in context to apply_goals argument in SearchResult._get_results_list.

I added the condition in prevent indexing error in the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. The apply goals option was added so that from all of the candidate output models, the user can filter out the ones that didn't meet their goal. otherwise, the ranked models can have models that do really well on a high priority metric but don't meet the minimum requirements for another metric.

Olive allows multiple passes under the "passes" key in config where each
entry can have dictate its own evaluator config i.e. the evaluation config
to use for that specific pass. However, with pass search, this becomes an
issue because each pass within the group can dictate conflicting objectives
and goals. Circumventing the issue by collecting all the objectives across
the group with the last one in the list winning if named the same.
Also, handle the case where not all objectives are generated as part of the
post evaluation signal.
@shaahji shaahji force-pushed the shaahji/objectives branch from 7fe2dd5 to e641d84 Compare February 1, 2025 00:01
@shaahji shaahji merged commit f1fe7bf into main Feb 1, 2025
24 checks passed
@shaahji shaahji deleted the shaahji/objectives branch February 1, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants