Skip to content

Commit

Permalink
tools: AutoTuner: Add smoke tests for optimization with Vizier
Browse files Browse the repository at this point in the history
Signed-off-by: Eryk Szpotanski <[email protected]>
  • Loading branch information
eszpotanski committed Oct 16, 2024
1 parent a40a908 commit 0810a82
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flow/test/test_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ if [ $RUN_AUTOTUNER -eq 1 ]; then
echo "Running Autotuner smoke sweep test"
python3 -m unittest tools.AutoTuner.test.smoke_test_sweep.${PLATFORM}SweepSmokeTest.test_sweep

echo "Running Autotuner smoke Vizier test"
python3 -m unittest tools.AutoTuner.test.smoke_test_vizier.${PLATFORM}VizierSmokeTest.test_vizier

echo "Running Autotuner ref file test (only once)"
if [ "$PLATFORM" == "asap7" ] && [ "$DESIGN" == "gcd" ]; then
python3 -m unittest tools.AutoTuner.test.ref_file_check.RefFileCheck.test_files
Expand Down
50 changes: 50 additions & 0 deletions tools/AutoTuner/test/smoke_test_vizier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import unittest
import subprocess
import os
from datetime import datetime

cur_dir = os.path.dirname(os.path.abspath(__file__))


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

def setUp(self):
self.config = os.path.join(
cur_dir,
f"../../../flow/designs/{self.platform}/{self.design}/autotuner.json",
)
self.experiment = f"smoke-test-tune-{self.platform}-{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}"
self.command = (
"python3 -m autotuner.vizier"
f" --design {self.design}"
f" --platform {self.platform}"
f" --experiment {self.experiment}"
f" --config {self.config}"
f" --iteration 1 --suggestions 1"
)

def test_vizier(self):
out = subprocess.run(self.command, shell=True, check=True)
successful = out.returncode == 0
self.assertTrue(successful)


class ASAP7VizierSmokeTest(BaseVizierSmokeTest):
platform = "asap7"
design = "gcd"


class SKY130HDVizierSmokeTest(BaseVizierSmokeTest):
platform = "sky130hd"
design = "gcd"


class IHPSG13G2VizierSmokeTest(BaseVizierSmokeTest):
platform = "ihp-sg13g2"
design = "gcd"


if __name__ == "__main__":
unittest.main()

0 comments on commit 0810a82

Please sign in to comment.