Skip to content

Commit

Permalink
improve reliability of gcd test for asap7
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Luar <[email protected]>
  • Loading branch information
luarss committed Aug 25, 2024
1 parent acf85b2 commit b2cea5f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion flow/designs/asap7/gcd/autotuner.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "float",
"minmax": [
50,
1000
500
],
"step": 0
},
Expand Down
36 changes: 26 additions & 10 deletions tools/AutoTuner/test/regression_tune_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BaseTuneRegressionBaseTest(unittest.TestCase):
platform = ""
design = ""
qor = 0
THRESHOLD = 0.05 # qor mean is within +- 5% of the expected value
THRESHOLD = 0.25 # qor median is within +- 25% of the expected value

def setUp(self):
self.config = os.path.join(
Expand All @@ -56,7 +56,7 @@ def setUp(self):
)


class ASAP7TuneRegressionBaseTest(BaseTuneRegressionBaseTest):
class ASAP7TuneRegressionGCDTest(BaseTuneRegressionBaseTest):
platform = "asap7"
design = "gcd"
qor = 37668.290
Expand All @@ -68,11 +68,11 @@ def test_tune(self):

# check if final mean QoR is within confidence interval of expected value
df = get_latest_data(f"../../../../flow/logs/{self.platform}/{self.design}")
mean_qor = df["minimum"].mean()
self.assertLess(abs(mean_qor - self.qor) / self.qor, (1-self.THRESHOLD))
median_qor = df["minimum"].median()
self.assertLess(abs(median_qor - self.qor) / self.qor, self.THRESHOLD)


class SKY130HDTuneRegressionBaseTest(BaseTuneRegressionBaseTest):
class SKY130HDTuneRegressionGCDTest(BaseTuneRegressionBaseTest):
platform = "sky130hd"
design = "gcd"
qor = 327.023
Expand All @@ -84,11 +84,11 @@ def test_tune(self):

# check if final mean QoR is within confidence interval of expected value
df = get_latest_data(f"../../../../flow/logs/{self.platform}/{self.design}")
mean_qor = df["minimum"].mean()
self.assertLess(abs(mean_qor - self.qor) / self.qor, (1-self.THRESHOLD))
median_qor = df["minimum"].median()
self.assertLess(abs(median_qor - self.qor) / self.qor, self.THRESHOLD)


class IHPSG13G2TuneRegressionBaseTest(BaseTuneRegressionBaseTest):
class IHPSG13G2TuneRegressionGCDTest(BaseTuneRegressionBaseTest):
platform = "ihp-sg13g2"
design = "gcd"
qor = 251.102
Expand All @@ -100,8 +100,24 @@ def test_tune(self):

# check if final mean QoR is within confidence interval of expected value
df = get_latest_data(f"../../../../flow/logs/{self.platform}/{self.design}")
mean_qor = df["minimum"].mean()
self.assertLess(abs(mean_qor - self.qor) / self.qor, (1-self.THRESHOLD))
median_qor = df["minimum"].median()
self.assertLess(abs(median_qor - self.qor) / self.qor, self.THRESHOLD)


# class ASAP7TuneRegressionAESTest(BaseTuneRegressionBaseTest):
# platform = "asap7"
# design = "aes"
# qor = 70934.140

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

# # check if final mean QoR is within confidence interval of expected value
# df = get_latest_data(f"../../../../flow/logs/{self.platform}/{self.design}")
# mean_qor = df["minimum"].mean()
# self.assertLess(abs(mean_qor - self.qor) / self.qor, (1-self.THRESHOLD))

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

0 comments on commit b2cea5f

Please sign in to comment.