Skip to content

Commit 2b8c23c

Browse files
avoid scheduler failure due to missing metric value (#1061)
Summary: Pull Request resolved: #1061 wrap results-fetching in try catch so as not to fail the scheduler when a single metric fails to fetch; instead mark the trial as "abandoned" and log a warning. if this works we can maybe do something similar for EarlyStopping metric fetching as well. Reviewed By: lena-kashtelyan Differential Revision: D38160234 fbshipit-source-id: 2609b40e07964675cb3a5f64a8d2f7bd696dd0a3
1 parent 5a09b22 commit 2b8c23c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ax/service/scheduler.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def poll_and_process_results(self, poll_all_trial_statuses: bool = False) -> boo
10551055
f"Fetching data for trials: {idcs} because some metrics "
10561056
"on experiment are available while trials are running."
10571057
)
1058-
self.experiment.fetch_trials_data(
1058+
self._fetch_trials_data(
10591059
trial_indices=running_trial_indices,
10601060
overwrite_existing_data=True,
10611061
)
@@ -1101,7 +1101,7 @@ def poll_and_process_results(self, poll_all_trial_statuses: bool = False) -> boo
11011101
# fetch it during candidate generation.
11021102
idcs = make_indices_str(indices=newly_completed)
11031103
self.logger.info(f"Fetching data for trials: {idcs}.")
1104-
self.experiment.fetch_trials_data(trial_indices=newly_completed)
1104+
self._fetch_trials_data(trial_indices=newly_completed)
11051105

11061106
updated_trials.extend(trials)
11071107

@@ -1524,3 +1524,11 @@ def _append_to_experiment_properties(self, to_append: Dict[str, Any]) -> None:
15241524
self._update_experiment_properties_in_db(
15251525
experiment_with_updated_properties=self.experiment
15261526
)
1527+
1528+
def _fetch_trials_data(
1529+
self, trial_indices: Iterable[int], overwrite_existing_data: bool = False
1530+
) -> None:
1531+
"""Fetches data from experiment."""
1532+
self.experiment.fetch_trials_data(
1533+
trial_indices=trial_indices, overwrite_existing_data=overwrite_existing_data
1534+
)

0 commit comments

Comments
 (0)