Skip to content

Commit c179e3c

Browse files
[AutoTuner] Replace failed metric string "-" with ERROR_METRIC
When AutoTuner trials fail, sub-metrics (effective_clk_period, num_drc, die_area) were returned as the string "-". This caused TensorBoard HPARAMS to silently drop entire metric columns because of mixed string/numeric data types across trials. Replace "-" with ERROR_METRIC (9e99) in all error return paths so TensorBoard consistently receives numeric values. Also add the missing die_area key in AutoTunerBase.step() invalid config return to match the success path. Fixes #3482 Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
1 parent 2b00536 commit c179e3c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ def step(self):
147147

148148
# if not a valid config, then don't run and pass back an error
149149
if not self.is_valid_config:
150-
return {METRIC: ERROR_METRIC, "effective_clk_period": "-", "num_drc": "-"}
150+
return {
151+
METRIC: ERROR_METRIC,
152+
"effective_clk_period": ERROR_METRIC,
153+
"num_drc": ERROR_METRIC,
154+
"die_area": ERROR_METRIC,
155+
}
151156
self._variant = f"{self.variant}-{self.step_}"
152157
metrics_file = openroad(
153158
args=args,
@@ -242,7 +247,7 @@ def evaluate(self, metrics):
242247
error = "ERR" in metrics.values() or "ERR" in reference.values()
243248
not_found = "N/A" in metrics.values() or "N/A" in reference.values()
244249
if error or not_found:
245-
return (ERROR_METRIC, "-", "-", "-")
250+
return (ERROR_METRIC, ERROR_METRIC, ERROR_METRIC, ERROR_METRIC)
246251
ppa = self.get_ppa(metrics)
247252
gamma = ppa / 10
248253
score = ppa * (self.step_ / 100) ** (-1) + (gamma * metrics["num_drc"])

tools/AutoTuner/src/autotuner/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def calculate_score(metrics, step=1):
7979
not_found = "N/A" in metrics.values()
8080

8181
if error or not_found:
82-
return (ERROR_METRIC, "-", "-", "-")
82+
return (ERROR_METRIC, ERROR_METRIC, ERROR_METRIC, ERROR_METRIC)
8383

8484
effective_clk_period = metrics["clk_period"] - metrics["worst_slack"]
8585
num_drc = metrics["num_drc"]

0 commit comments

Comments
 (0)