Skip to content

Commit da50d19

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

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
@@ -308,6 +308,9 @@ def parse_arguments():
308308
default=None,
309309
help="Time limit (in hours) for the whole Autotuning process.",
310310
)
311+
parser.add_argument(
312+
"-y", "--yes", action="store_true", help="Skip confirmation prompt."
313+
)
311314
tune_parser.add_argument(
312315
"--resume",
313316
action="store_true",
@@ -516,9 +519,11 @@ def parse_arguments():
516519
args.timeout = args.cpu_budget / os.cpu_count()
517520
template = calculate_expected_numbers(args.timeout, args.samples)
518521
print(template)
519-
ans = input("Do you want to continue? [Y/n]")
520-
if ans.lower() != "y":
521-
sys.exit(0)
522+
if not args.yes:
523+
ans = input("Are you sure you want to proceed? (y/n): ")
524+
if ans.lower() != "y":
525+
print("Exiting AutoTuner.")
526+
sys.exit(0)
522527

523528
return args
524529

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)