Skip to content

Commit 5dcad56

Browse files
committed
add --yes to avoid prompt.
Signed-off-by: Jack Luar <[email protected]>
1 parent 2f5ebe2 commit 5dcad56

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ def parse_arguments():
306306
default=None,
307307
help="Time limit (in hours) for the whole Autotuning process.",
308308
)
309+
parser.add_argument(
310+
"-y", "--yes", action="store_true", help="Skip confirmation prompt."
311+
)
309312
tune_parser.add_argument(
310313
"--resume",
311314
action="store_true",
@@ -514,9 +517,11 @@ def parse_arguments():
514517
args.timeout = args.cpu_budget / os.cpu_count()
515518
template = calculate_expected_numbers(args.timeout, args.samples)
516519
print(template)
517-
ans = input("Do you want to continue? [Y/n]")
518-
if ans.lower() != "y":
519-
sys.exit(0)
520+
if not args.yes:
521+
ans = input("Are you sure you want to proceed? (y/n): ")
522+
if ans.lower() != "y":
523+
print("Exiting AutoTuner.")
524+
sys.exit(0)
520525

521526
return args
522527

tools/AutoTuner/test/smoke_test_sweep.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def setUp(self):
3838
f" --experiment {self.experiment}"
3939
f" --config {self.config}"
4040
f" --cpu_budget {self.cpu_budget}"
41+
f" --yes"
4142
f" sweep --resources_per_trial {self.resources_per_trial}"
4243
)
4344

tools/AutoTuner/test/smoke_test_timeout.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def setUp(self):
2626
f" --platform {self.platform}"
2727
f" --experiment {self.experiment}"
2828
f" --config {self.config}"
29+
f" --yes"
2930
f" {flag}"
3031
f" tune --samples 1"
3132
for flag in timeout_flags

tools/AutoTuner/test/smoke_test_tune.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def setUp(self):
2121
f" --platform {self.platform}"
2222
f" --experiment {self.experiment}"
2323
f" --config {self.config}"
24-
f" tune --samples 5"
24+
f" --yes"
25+
f" tune --samples 1"
2526
)
2627

2728
def test_tune(self):

0 commit comments

Comments
 (0)