Skip to content

Commit c787974

Browse files
committed
Fix experiment name checks
Signed-off-by: Jack Luar <[email protected]>
1 parent 55bfa95 commit c787974

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,14 +510,6 @@ def parse_arguments():
510510
else:
511511
args.experiment += f"-{args.mode}"
512512

513-
# Experiment name must be unique. TODO: Have a single source of truth for EXPERIMENT_DIR.
514-
if os.path.exists(f"{LOCAL_DIR}/{args.platform}/{args.design}/{args.experiment}"):
515-
print(
516-
f"[ERROR TUN-0032] Experiment {args.experiment} already exists."
517-
" Please choose a different name."
518-
)
519-
sys.exit(1)
520-
521513
# Convert time to seconds
522514
if args.timeout_per_trial is not None:
523515
args.timeout_per_trial = round(args.timeout_per_trial * 3600)
@@ -691,6 +683,14 @@ def main():
691683

692684
LOCAL_DIR, ORFS_FLOW_DIR, INSTALL_PATH = prepare_ray_server(args)
693685

686+
# Check: Experiment name must be unique.
687+
if os.path.exists(f"./{LOCAL_DIR}/{args.experiment}"):
688+
print(
689+
f"[ERROR TUN-0032] Experiment {args.experiment} already exists."
690+
" Please choose a different name."
691+
)
692+
sys.exit(1)
693+
694694
if args.mode == "tune":
695695
best_params = set_best_params(args.platform, args.design)
696696
search_algo = set_algorithm(args.experiment, config_dict)
@@ -714,7 +714,6 @@ def main():
714714
trial_name_creator=lambda x: f"variant-{x.trainable_name}-{x.trial_id}-ray",
715715
trial_dirname_creator=lambda x: f"variant-{x.trainable_name}-{x.trial_id}-ray",
716716
)
717-
exit()
718717
if args.algorithm == "pbt":
719718
os.environ["TUNE_MAX_PENDING_TRIALS_PG"] = str(args.jobs)
720719
tune_args["scheduler"] = search_algo

0 commit comments

Comments
 (0)