Skip to content

Commit

Permalink
Load Experiment without runners and metrics in the case where search …
Browse files Browse the repository at this point in the history
…space and optimization config are immutable

Summary: `load_experiment` was previously failing when `skip_runners_and_metrics=True` for experiments with immutable search space and optimization config. See [Lena's comment](https://www.internalfb.com/diff/D46595953?dst_version_fbid=263061986396665&transaction_fbid=639853311380999) for more detail.

Differential Revision: D46595953

fbshipit-source-id: 7591b2d968fdf53bb86f96f6cdfe455d0e094217
  • Loading branch information
Bernie Beckerman authored and facebook-github-bot committed Jun 13, 2023
1 parent e9989e2 commit 619e6d9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ax/storage/sqa_store/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ax.utils.common.constants import Keys
from ax.utils.common.typeutils import not_none
from sqlalchemy.orm import defaultload, lazyload, noload
from sqlalchemy.orm.exc import DetachedInstanceError


# ---------------------------- Loading `Experiment`. ---------------------------
Expand Down Expand Up @@ -135,10 +136,13 @@ def _load_experiment(
for sqa_metric in experiment_sqa.metrics:
sqa_metric.metric_type = 0

for sqa_trial in experiment_sqa.trials:
for sqa_generator_run in sqa_trial.generator_runs:
for sqa_metric in sqa_generator_run.metrics:
sqa_metric.metric_type = 0
try:
for sqa_trial in experiment_sqa.trials:
for sqa_generator_run in sqa_trial.generator_runs:
for sqa_metric in sqa_generator_run.metrics:
sqa_metric.metric_type = 0
except DetachedInstanceError:
pass

return decoder.experiment_from_sqa(
experiment_sqa=experiment_sqa,
Expand Down

0 comments on commit 619e6d9

Please sign in to comment.