Skip to content

Commit bba7b81

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

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
@@ -508,14 +508,6 @@ def parse_arguments():
508508
else:
509509
args.experiment += f"-{args.mode}"
510510

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

690682
LOCAL_DIR, ORFS_FLOW_DIR, INSTALL_PATH = prepare_ray_server(args)
691683

684+
# Check: Experiment name must be unique.
685+
if os.path.exists(f"./{LOCAL_DIR}/{args.experiment}"):
686+
print(
687+
f"[ERROR TUN-0032] Experiment {args.experiment} already exists."
688+
" Please choose a different name."
689+
)
690+
sys.exit(1)
691+
692692
if args.mode == "tune":
693693
best_params = set_best_params(args.platform, args.design)
694694
search_algo = set_algorithm(args.experiment, config_dict)
@@ -712,7 +712,6 @@ def sweep():
712712
trial_name_creator=lambda x: f"variant-{x.trainable_name}-{x.trial_id}-ray",
713713
trial_dirname_creator=lambda x: f"variant-{x.trainable_name}-{x.trial_id}-ray",
714714
)
715-
exit()
716715
if args.algorithm == "pbt":
717716
os.environ["TUNE_MAX_PENDING_TRIALS_PG"] = str(args.jobs)
718717
tune_args["scheduler"] = search_algo

0 commit comments

Comments
 (0)