Override is_available_while_running on DerivedMetric (#5028)#5028
Closed
ItsMrLin wants to merge 2 commits into
Closed
Override is_available_while_running on DerivedMetric (#5028)#5028ItsMrLin wants to merge 2 commits into
ItsMrLin wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5028 +/- ##
==========================================
- Coverage 96.84% 96.84% -0.01%
==========================================
Files 605 605
Lines 65292 65316 +24
==========================================
+ Hits 63233 63254 +21
- Misses 2059 2062 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary: When `relativize_inputs=True`, the status quo arm was previously excluded from the output because its relativized values are trivially zero. This is incorrect for non-linear expressions: `exp(0) = 1`, not 0. Instead of skipping the SQ arm, construct a DataFrame with zero-valued inputs for all input metrics and let `_compute_derived_values` evaluate the expression on them. This produces correct SQ output for any expression (e.g., `a + b = 0`, `exp(a) = 1`). Differential Revision: D96558255
ItsMrLin
added a commit
to ItsMrLin/Ax
that referenced
this pull request
Mar 15, 2026
Summary: `DerivedMetric.is_available_while_running()` currently inherits the base `Metric` default of `False`. This causes `fetch_data_prefer_lookup` to skip derived metrics for running trials -- it returns cached data (which is empty) instead of computing from freshly-fetched base data. Override the classmethod to return `True` so derived metrics always attempt to compute. If base data isn't available, `fetch_trial_data` returns empty data which is handled gracefully downstream. Differential Revision: D96558279
9cc828b to
091a0b3
Compare
Summary: Pull Request resolved: facebook#5028 `DerivedMetric.is_available_while_running()` currently inherits the base `Metric` default of `False`. This causes `fetch_data_prefer_lookup` to skip derived metrics for running trials -- it returns cached data (which is empty) instead of computing from freshly-fetched base data. Override the classmethod to return `True` so derived metrics always attempt to compute. If base data isn't available, `fetch_trial_data` returns empty data which is handled gracefully downstream. Differential Revision: D96558279
091a0b3 to
17540a0
Compare
ItsMrLin
added a commit
to ItsMrLin/Ax
that referenced
this pull request
Mar 16, 2026
Summary: `DerivedMetric.is_available_while_running()` currently inherits the base `Metric` default of `False`. This causes `fetch_data_prefer_lookup` to skip derived metrics for running trials -- it returns cached data (which is empty) instead of computing from freshly-fetched base data. Override the classmethod to return `True` so derived metrics always attempt to compute. If base data isn't available, `fetch_trial_data` returns empty data which is handled gracefully downstream. Reviewed By: lena-kashtelyan Differential Revision: D96558279
|
This pull request has been merged in 77dd69f. |
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:
DerivedMetric.is_available_while_running()currently inherits the baseMetricdefault ofFalse. This causesfetch_data_prefer_lookuptoskip derived metrics for running trials -- it returns cached data (which
is empty) instead of computing from freshly-fetched base data.
Override the classmethod to return
Trueso derived metrics alwaysattempt to compute. If base data isn't available,
fetch_trial_datareturns empty data which is handled gracefully downstream.
Differential Revision: D96558279