Route against-direction objective constraints to outcome constraints in MOO#5239
Open
saitcakmak wants to merge 1 commit into
Open
Route against-direction objective constraints to outcome constraints in MOO#5239saitcakmak wants to merge 1 commit into
saitcakmak wants to merge 1 commit into
Conversation
…in MOO Summary: D109061377 relaxed `MultiObjectiveOptimizationConfig` validation so that, in multi-objective optimization, an outcome constraint can be placed on an objective metric (e.g. `flops >= 42` while minimizing `flops`) to bound the objective against its optimization direction. `Objective.get_unconstrainable_metric_names()` now returns `[]` for MOO. However, `optimization_config_from_string` (used by `Client.configure_optimization`) was never updated. It unconditionally converted any single-metric constraint on an objective metric into an *objective threshold*. Objective thresholds can only bound in the direction of optimization, so a constraint like `flops >= 42.50` while minimizing `flops` was turned into an invalid threshold and tripped `check_objective_thresholds_match_objectives`: UserInputError: Objective threshold on flops bounds from below but flops is being minimized. This diff fixes the conversion so a single-metric constraint on an objective metric becomes an objective threshold only when it bounds the objective in its optimization direction (upper bound on a minimized objective, lower bound on a maximized one). A constraint that bounds against the optimization direction is kept as a true outcome constraint, which MOO now supports. For `objective="-flops, -train_ne"` with `["flops >= 42.50", "flops <= 94.38", "train_ne <= 0.62938"]`: - `flops >= 42.50` -> outcome constraint (against the minimize direction) - `flops <= 94.38` -> objective threshold (aligned with minimize) - `train_ne <= 0.62938` -> objective threshold (aligned with minimize) Differential Revision: D109856433
|
@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109856433. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5239 +/- ##
=======================================
Coverage 96.56% 96.57%
=======================================
Files 619 619
Lines 70273 70282 +9
=======================================
+ Hits 67861 67875 +14
+ Misses 2412 2407 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
D109061377 relaxed
MultiObjectiveOptimizationConfigvalidation so that, in multi-objective optimization, an outcome constraint can be placed on an objective metric (e.g.flops >= 42while minimizingflops) to bound the objective against its optimization direction.Objective.get_unconstrainable_metric_names()now returns[]for MOO.However,
optimization_config_from_string(used byClient.configure_optimization) was never updated. It unconditionally converted any single-metric constraint on an objective metric into an objective threshold. Objective thresholds can only bound in the direction of optimization, so a constraint likeflops >= 42.50while minimizingflopswas turned into an invalid threshold and trippedcheck_objective_thresholds_match_objectives:UserInputError: Objective threshold on flops bounds from below but flops is being minimized.
This diff fixes the conversion so a single-metric constraint on an objective metric becomes an objective threshold only when it bounds the objective in its optimization direction (upper bound on a minimized objective, lower bound on a maximized one). A constraint that bounds against the optimization direction is kept as a true outcome constraint, which MOO now supports.
For
objective="-flops, -train_ne"with["flops >= 42.50", "flops <= 94.38", "train_ne <= 0.62938"]:flops >= 42.50-> outcome constraint (against the minimize direction)flops <= 94.38-> objective threshold (aligned with minimize)train_ne <= 0.62938-> objective threshold (aligned with minimize)Differential Revision: D109856433