Skip to content

Check QoR offline against saved dashboard limits - #4908

Open
vvbandeira wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
vvbandeira:qor-check-offline-cache
Open

vvbandeira wants to merge 4 commits into
The-OpenROAD-Project:masterfrom
vvbandeira:qor-check-offline-cache

Conversation

@vvbandeira

Copy link
Copy Markdown
Member

A site with no network access cannot reach the QoR dashboard, so make metadata-check cannot judge its runs.
This PR adds two opt-in options to checkQorMetrics.py:

  • --save-cache DIR (DASHBOARD_SAVE_CACHE) runs the normal online check and also saves the baseline and the per-rule limits from each pass or fail reply to DIR/<platform>/<design>/<variant>.json.
  • --offline-cache DIR (DASHBOARD_OFFLINE_CACHE) judges runs against those saved limits and does not contact the dashboard.
    The report and the exit status are the same as online.

Both options are off by default.
The online path does not change.

Why one saved reply is enough

The dashboard computes each limit from the baseline build and the rule only, never from the metrics that it checks.
So a saved limit gives the same verdict for a later run of the same design.
The offline check rebuilds the operator from the reply's mode, comparison type, and rule source, as Threshold.cs in the dashboard does.
It divides the delta by the absolute baseline, as the dashboard does.

Limits

  • The saved baseline does not move with master.
    A rule change in the dashboard reaches the cache only when the cache is saved again.
  • The cache fixes the baseline, so an offline check resolves no local merge base and no pipeline.
    It ignores DASHBOARD_JOB_NAME, DASHBOARD_BRANCH, and DASHBOARD_MERGE_BASE, and it refuses --base-commit, --beta, and --api-url.
  • The dashboard sends rules only for the metrics it receives.
    So the cache has no rule for a metric that the saved run did not send, for example one that was not finite then.
    A later run with such a metric is INCONCLUSIVE unless a saved rule fails.
  • A cache file that cannot be read, has an unknown format, or holds a value of the wrong type or a non-finite limit is an error (exit 1), not a pass.
  • Only a pass or fail reply that the cache can use is saved.
    An outage, a missing API key, a nightly pass with no baseline build, or a failed write keeps the earlier cache file.
    A reply with a rule that the offline check cannot replay, for example a new threshold mode, also keeps it and fails the save.
  • An empty DASHBOARD_OFFLINE_CACHE or DASHBOARD_SAVE_CACHE turns the option off, as for the other DASHBOARD_* variables.
    An empty --offline-cache or --save-cache argument is an error.

Verification

flow/test/test_checkQorMetrics_cache.py covers the save and replay round trip, each operator, inclusive limits, negative and zero baselines, non-finite metrics and limits, metrics that the saved run did not send, damaged cache files, atomic writes, kept caches after an outage or a failed save, and the refused or ignored options.

A live comparison on the public asap7/gcd baseline (25 rules) gave identical tables and verdicts online and offline, both for a run with metrics fetched from the dashboard and for a copy of that run changed to fail 7 rules.

A site with no network access cannot reach the QoR dashboard, so it
cannot run the check at all.

The dashboard computes each limit from the baseline build and the rule
only, never from the run that it checks. So one reply is enough to
judge later runs of the same design. --save-cache writes the limits
from each pass or fail reply. --offline-cache judges new runs against
them and gives the same report and exit status as the online check.
The offline delta divides by the absolute baseline, as the dashboard
does.

Both options are off by default. DASHBOARD_SAVE_CACHE and
DASHBOARD_OFFLINE_CACHE set them for make metadata-check.

The cache fixes the baseline of an offline check. So the offline check
resolves no local merge base and no pipeline, and it refuses
--base-commit, --beta and --api-url. The cache has no rule for a metric
that the saved run did not send. A run with such a metric is
inconclusive unless a saved rule fails.

A save checks each reply before it writes it. A nightly pass with no
baseline build keeps the earlier file. A rule that the cache cannot
replay also keeps it and fails the save.

Signed-off-by: Vitor Bandeira <[email protected]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds offline checking capabilities to the QoR metrics checker, allowing users to save baselines and limits locally and perform checks without network access. It includes a new test suite for the caching mechanism and updates the documentation and Makefiles. The review feedback suggests refactoring the atomic file-writing logic to use a finally block for cleaning up temporary files, preventing potential masking of original exceptions.

Comment thread flow/util/checkQorMetrics.py Resolved
@openroad-ci

openroad-ci commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit 8fa940d · Jenkins build #3 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

✅ QoR is compared against the master build at this PR's merge base 58710a4.

If the removal of the temporary cache file failed, its error replaced
the one that stopped the write, so the report named the cleanup and
not, for example, a full disk. Remove the temporary file in a finally
block and ignore an error from that removal.

Signed-off-by: Vitor Bandeira <[email protected]>
A damaged cache could hide a failed rule or replace a valid cache.
Validate the cache on save and replay. Name the environment variables
that conflict with offline mode and cover the cache CLI paths.

Signed-off-by: Vitor Bandeira <[email protected]>
Keep cache validation and replay in one module. Resolve that module
when the Bazel Python wrapper launches the checker with runpy.

Signed-off-by: Vitor Bandeira <[email protected]>
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.

2 participants