Skip to content

Commit 380c10a

Browse files
committed
fix test_tune_resume
Signed-off-by: Jack Luar <[email protected]>
1 parent c11de4f commit 380c10a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ def parse_arguments():
509509
args.experiment = f"{args.mode}-{id}"
510510
else:
511511
args.experiment += f"-{args.mode}"
512-
args.experiment += f"-{args.mode}-{DATE}"
512+
513+
# Append a date for non-resume mode to ensure unique experiment dirs.
514+
if not args.resume:
515+
args.experiment += f"-{DATE}"
513516

514517
# Convert time to seconds
515518
if args.timeout_per_trial is not None:

tools/AutoTuner/test/resume_check.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ResumeCheck(unittest.TestCase):
3030
design = "gcd"
3131
samples = 5
3232
iterations = 2
33+
timeout = 120
3334

3435
def setUp(self):
3536
self.config = os.path.join(
@@ -38,7 +39,7 @@ def setUp(self):
3839
self.jobs = self.samples
3940
self.num_cpus = os.cpu_count()
4041

41-
# How it works: Say we have 5 samples and 5 iterations.
42+
# How it works: Say we have 5 samples and 5 iterations and 16 cores.
4243
# If we want to limit to only 5 trials (and avoid any parallelism magic by Ray)
4344
# We can set resources_per_trial = NUM_CORES/5 = 3.2 (fractional resources_per_trial are allowed!)
4445

@@ -66,7 +67,7 @@ def test_tune_resume(self):
6667
# Run the first config asynchronously.
6768
print("Running the first config")
6869
with managed_process(self.commands[0], shell=True) as proc:
69-
time.sleep(120)
70+
time.sleep(self.timeout)
7071

7172
# Keep trying to stop the ray cluster until it is stopped
7273
while 1:

0 commit comments

Comments
 (0)