Skip to content

[AutoTuner] Replace failed metric string "-" with ERROR_METRIC#3940

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
harsh-kumar-patwa:topic/autotuner-error-metric-fix
Mar 3, 2026
Merged

[AutoTuner] Replace failed metric string "-" with ERROR_METRIC#3940
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
harsh-kumar-patwa:topic/autotuner-error-metric-fix

Conversation

@harsh-kumar-patwa
Copy link
Contributor

Fixes #3482

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.

Changes

  • utils.pycalculate_score(): return ERROR_METRIC instead of "-" for all sub-metrics on error/not-found
  • distributed.pyAutoTunerBase.step(): return ERROR_METRIC instead of "-" for invalid config, and add missing die_area key to match the success path
  • distributed.pyPPAImprov.evaluate(): return ERROR_METRIC instead of "-" for all sub-metrics on error/not-found

Why this works

ERROR_METRIC (9e99) is already defined in utils.py and used for the primary score on failure. The TensorBoardLogger.log_sweep_metrics() method uses isinstance(value, (int, float)) checks — with "-" (string), failed metrics were silently skipped; with ERROR_METRIC (float), they are now properly logged.

Trade-off

As noted in #3482, 9e99 will distort TensorBoard Parallel Coordinates axis scales for failed runs. Users can adjust the Max slider per axis to filter these out.

Testing

  • Unit tested calculate_score() for ERR, N/A, and success cases — all return consistent numeric types
  • Verified isinstance compatibility with TensorBoardLogger
  • Black formatting passes

@jeffng-or @luarss

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 The-OpenROAD-Project#3482

Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
@maliberty maliberty requested a review from luarss March 2, 2026 15:26
@jeffng-or
Copy link
Contributor

Hi Harsh,

Great, thanks! I defer to Jack on the review.

@harsh-kumar-patwa
Copy link
Contributor Author

Hi Harsh,

Great, thanks! I defer to Jack on the review.

Hi Jeff,

Thanks for the update! Sounds good. I’ll wait to hear from Jack regarding the review.
Appreciate it.

luarss

This comment was marked as resolved.

Copy link
Contributor

@luarss luarss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maliberty maliberty enabled auto-merge March 3, 2026 02:13
@maliberty maliberty merged commit b75a511 into The-OpenROAD-Project:master Mar 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change AutoTuner failed metrics from "-" to ERROR_METRIC

4 participants