-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assign only run in a single run experiment as best_trial_id (#9051)
- Loading branch information
1 parent
543380d
commit 4f81548
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
24 changes: 24 additions & 0 deletions
24
master/static/migrations/20240724073853_handle-single-run-experiments-best-trial.tx.up.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- backfill existing single-trial experiments without best_trial_id | ||
WITH single_run_experiments AS ( | ||
SELECT | ||
id | ||
FROM | ||
experiments e | ||
WHERE | ||
e.config->'searcher'->>'name' = 'single' | ||
), | ||
br_no_validation AS ( | ||
SELECT r.experiment_id, r.id, r.best_validation_id | ||
FROM | ||
runs r | ||
INNER JOIN single_run_experiments sre | ||
ON r.experiment_id = sre.id | ||
ORDER BY searcher_metric_value_signed) | ||
UPDATE | ||
experiments | ||
SET | ||
best_trial_id = brnv.id | ||
FROM | ||
br_no_validation brnv | ||
WHERE | ||
experiments.id = brnv.experiment_id; |