Skip to content

mpl: stop annealing once the best result stops improving - #11807

Open
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:mpl-early-stop
Open

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:mpl-early-stop

Conversation

@oharboe

@oharboe oharboe commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Opened for discussion.

Every annealing run in mpl took its full 2000 steps. A run now stops when its best result has not improved for a fifth of its budget (400 steps).

mpl on 18 ORFS designs at each design's own core and settings, measured with mpl_bench (#11809): median of 3 runs per arm, 8 threads pinned to 8 cores, same machine. Run-to-run spread was up to 7% of the median; read differences below 10% as noise.

result
mpl runtime 1.26x geometric mean; 9 designs faster by 10% or more, 9 within noise, none slower
macro placement identical on 12 designs; on 6 the macro-net wirelength moved, by 0.24% or less except asap7/riscv32i-mock-sram (10.9% shorter)
Per design
design master s this PR s speedup macro-net HPWL change
asap7/aes-block 2.85 2.25 1.27x same
asap7/coralnpu 2.30 2.07 1.11x same
asap7/cva6 40.29 39.54 1.02x same
asap7/riscv32i 5.49 5.17 1.06x +0.24%
asap7/riscv32i-mock-sram 7.68 7.46 1.03x -10.86%
asap7/swerv_wrapper 80.18 77.88 1.03x -0.00%
asap7/tinyRocket 12.81 11.97 1.07x same
gf180/uart-blocks 0.85 0.18 4.84x same
nangate45/ariane133 8.32 5.34 1.56x -0.02%
nangate45/ariane136 9.05 7.63 1.19x +0.01%
nangate45/black_parrot 5.46 4.53 1.20x same
nangate45/bp_be_top 4.77 4.34 1.10x same
nangate45/bp_fe_top 11.32 10.67 1.06x same
nangate45/bp_multi_top 5.52 4.42 1.25x same
nangate45/cva6 28.26 27.57 1.03x -0.00%
nangate45/mempool_group 15.87 15.46 1.03x same
nangate45/swerv_wrapper 44.95 44.01 1.02x same
nangate45/tinyRocket 1.23 0.56 2.21x same

The patience was chosen by replaying the improvement traces of every annealing run mpl made on 18 ORFS designs (asap7, gf180, nangate45) against the full budget. An early stop changes nothing before it fires, so the replay is exact:

runs steps run cost loss: median p95 worst
cluster placement (179) 59% 0.00% 0.01% 0.08%
macro placement (218) 30% 0.00% 0.00% 0.00%
tilings (264) 26% 0.00% 0.00% 9.62%

A tenth of the budget (200 steps) cost up to 9.85% on a cluster placement and 20% on a tiling. The one tiling outlier loses the same 9.62% at every patience from 300 to 1000 steps.

QoR at global route, one ORFS build per arm through GRT (the full study series, whose macro placements equal this PR's on all 18 designs, so the moves are this change's): 12 identical, 2 with positive slack in both arms, and 4 whose worst slack moved: nangate45/ariane133 +87.7 ps, asap7/swerv_wrapper +20.5 ps, asap7/riscv32i -0.7 ps, nangate45/cva6 -5.8 ps. One build per arm; a different placement moves slack either way.

How these were measured, and the rest of the study: The-OpenROAD-Project/bazel-orfs#1290. The bench is offered separately in #11809.

Tests

No new test: the change is a stopping rule, and its effect is runtime and the quality numbers above, which a unit test would only pin down as golden output. The existing regressions pass unchanged.

Claude made the changes and stared at paint drying.

🤖 Generated with Claude Code

Every annealing run took its full 2000 steps. A run now stops when its
best result has not improved for a fifth of its budget.

Replayed from the improvement traces of every run mpl made on 18 ORFS
designs (asap7, gf180, nangate45), against the full budget:

  runs                 steps kept   cost loss: median   p95     worst
  cluster placement    59%                     0.00%    0.01%   0.08%
  macro placement      30%                     0.00%    0.00%   0.00%
  tilings              26%                     0.00%    0.00%   9.62%

A tenth of the budget cost up to 9.85% on a cluster placement and 20%
on a tiling. The one tiling outlier loses the same 9.62% at every
patience from 300 to 1000 steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@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 introduces an early stopping mechanism to the simulated annealing loop in SimulatedAnnealingCore::fastSA(). It defines a patience threshold of one-fifth of the maximum steps and terminates the loop early if the best result has not improved within this window, saving computation time when the temperature is too low to escape local minima. There are no review comments, so I have no feedback to provide.

@oharboe
oharboe marked this pull request as ready for review October 17, 2026 09:48
@oharboe
oharboe requested a review from a team as a code owner October 17, 2026 09:48
@oharboe
oharboe requested a review from AcKoucher October 17, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant