Skip to content

Commit

Permalink
tools: AutoTuner: Update smoke tests
Browse files Browse the repository at this point in the history
Signed-off-by: Eryk Szpotanski <eszpotanski@antmicro.com>
  • Loading branch information
eszpotanski committed Oct 7, 2024
1 parent 808372d commit 45708c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 5 additions & 4 deletions tools/AutoTuner/test/smoke_test_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import json

cur_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(cur_dir, "../src/autotuner")
os.chdir(src_dir)


class BaseSweepSmokeTest(unittest.TestCase):
platform = ""
design = ""

def setUp(self):
self.config = "distributed-sweep-example.json"
self.config = os.path.abspath(
os.path.join(cur_dir, "../src/autotuner/distributed-sweep-example.json")
)
# make sure this json only has 1 key called "CTS_CLUSTER_SIZE" and 4 possible values
with open(self.config) as f:
contents = json.load(f)
Expand All @@ -31,7 +31,7 @@ def setUp(self):
self.jobs = 4 if core >= 4 else core
self.experiment = f"smoke-test-sweep-{self.platform}"
self.command = (
"python3 distributed.py"
"python3 -m autotuner.distributed"
f" --design {self.design}"
f" --platform {self.platform}"
f" --experiment {self.experiment}"
Expand All @@ -40,6 +40,7 @@ def setUp(self):
f" sweep"
)

@unittest.skip("abstract_method")
def test_sweep(self):
raise NotImplementedError(
"This method needs to be implemented in the derivative classes."
Expand Down
5 changes: 2 additions & 3 deletions tools/AutoTuner/test/smoke_test_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(cur_dir, "../src/autotuner")
os.chdir(src_dir)


class BaseTuneSmokeTest(unittest.TestCase):
Expand All @@ -18,14 +16,15 @@ def setUp(self):
)
self.experiment = f"smoke-test-tune-{self.platform}"
self.command = (
"python3 distributed.py"
"python3 -m autotuner.distributed"
f" --design {self.design}"
f" --platform {self.platform}"
f" --experiment {self.experiment}"
f" --config {self.config}"
f" tune --samples 1"
)

@unittest.skip("abstract_method")
def test_tune(self):
raise NotImplementedError(
"This method needs to be implemented in the derivative classes."
Expand Down

0 comments on commit 45708c4

Please sign in to comment.