Skip to content

gpl: Restart Nesterov momentum after non-virtual timing-driven repair - #11553

Merged
gudeh merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gpl-momentum-reset-fix
Sep 29, 2026
Merged

gudeh merged 4 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gpl-momentum-reset-fix

Conversation

@jhkim-pii

Copy link
Copy Markdown
Contributor

Summary

QoR analysis

Commits used for the BASE and TEST

ORFS OpenROAD
BASE (secure-base-0903) 7daaaed55b63f16ad43f54c5e743ae751e5be354 (master, 2026-09-09 19:07 UTC) c6c0900a1619481c3e09a75c7af410befc8f900e (26Q3-1953, 2026-09-09 16:21 UTC)
TEST (secure-td-gpl-momentum-fix) 16ead012a2f7f1e1e92f230596f7defa3ff3dd80 (7daaaed55 + OR bump) cd73f911f7d22341e45df1e56a55020e05a6d148 (c6c0900 + this fix, identical content to this PR)

CI runs

CI BASE TEST
OpenROAD unit tests secure-base-0903 #2 SUCCESS secure-td-gpl-momentum-fix #2 SUCCESS (4319/4319)
ORFS public PDKs secure-base-0903 #2 SUCCESS secure-td-gpl-momentum-fix #2 FAILURE: metadata-check gates on uart/mock-alu/cva6 asap7, ibex nangate45, ibex sky130hs, swerv_wrapper nangate45

ORFS QoR, BASE vs TEST (final stage; asap7 values in ps, all others in ns; dWL is detailed-route wirelength)

Design set Compared TNS improved TNS regressed Neutral Net dTNS
Public PDKs (asap7, gf180, gt2n, ihp-sg13g2, nangate45, sky130hd, sky130hs) 62 30 16 16 asap7 +32764 ps, others +277.3 ns
  • Largest improvements: riscv32i asap7 (+24920 ps), jpeg asap7 (+5324 ps), riscv32i-mock-sram asap7 (+4436 ps), aes-block asap7 (+325 ps), riscv32i sky130hs (+190 ns), ariane133 nangate45 (+147 ns), ethmac_lvt asap7 (+104 ps), chameleon sky130hd (+104 ns).
  • Largest regressions: mock-alu asap7 (-1543 ps), swerv_wrapper asap7 (-490 ps), cva6 asap7 (-301 ps), mempool_group nangate45 (-211 ns), uart asap7 (-136 ps), jpeg sky130hs (-65 ns, WL +17%), ethmac asap7 (-56 ps), ibex sky130hs (-30 ns, WL +11%).
  • DRC count is 0 -> 0 on every design. CI runtimes are not comparable between builds (shared agents); on leon3_vta_bus the 3_3 stage runtime is unchanged (9:52 -> 10:09 for 50 more Nesterov iterations).

Result (62 designs)

Design Base WS Test WS Base TNS Test TNS dTNS dWL DRC base/test
aes asap7 -3.801 -4.734 -10.84 -10.92 -0.08 -1.1% 0/0
aes-block asap7 -33.75 1.001 -324.6 0 +324.6 -0.0% 0/0
aes-mbff asap7 -8.846 -4.626 -69.39 -10.69 +58.7 -1.4% 0/0
aes_lvt asap7 3.806 9.571 0 0 +0 -0.7% 0/0
cva6 asap7 -4.32 -15.98 -10.74 -311.8 -301 -3.9% 0/0
ethmac asap7 -81.39 -87.17 -1349 -1405 -56.02 -4.4% 0/0
ethmac_lvt asap7 -18.83 -17.63 -347.9 -243.9 +104.1 -1.4% 0/0
gcd asap7 -39.85 -41.38 -113.1 -107.8 +5.311 -1.0% 0/0
gcd-ccs asap7 -44.69 -43.52 -134.9 -114.6 +20.27 -1.5% 0/0
ibex asap7 -6.967 21.26 -30.04 0 +30.04 -0.2% 0/0
jpeg asap7 -95.34 -81.14 -2.259e+04 -1.727e+04 +5324 -2.6% 0/0
jpeg_lvt asap7 -14.87 -1.657 -71.41 -1.657 +69.76 -1.3% 0/0
mock-alu asap7 -282.4 -285.6 -1.735e+04 -1.889e+04 -1543 -3.0% 0/0
mock-cpu asap7 17.04 15.79 0 0 +0 -1.2% 0/0
riscv32i asap7 -42.74 -16.55 -2.739e+04 -2478 +2.492e+04 -0.4% 0/0
riscv32i-mock-sram asap7 -30.2 -14.35 -5105 -668.7 +4436 -0.4% 0/0
swerv_wrapper asap7 -90.15 -109.9 -1458 -1947 -489.5 -1.0% 0/0
uart asap7 -24.54 -27.17 -815.5 -951.6 -136.1 -0.3% 0/0
aes gf180 -0.7939 -0.7071 -98.83 -93.82 +5.012 -2.4% 0/0
aes-hybrid gf180 -0.9399 -0.8905 -128.3 -126.6 +1.731 -0.6% 0/0
ibex gf180 -0.06168 -0.1128 -0.1216 -0.1651 -0.04356 -0.7% 0/0
jpeg gf180 -0.1187 -0.05944 -0.6918 -0.1342 +0.5576 -0.8% 0/0
riscv32i gf180 -0.2543 -0.2021 -1.474 -1.046 +0.4276 -0.1% 0/0
uart-blocks gf180 1.268 1.254 0 0 +0 +0.6% 0/0
aes gt2n 26.35 32.24 0 0 +0 -1.1% 0/0
gcd gt2n 150.5 148.4 0 0 +0 -0.1% 0/0
jpeg gt2n 27.22 47.35 0 0 +0 -0.5% 0/0
aes ihp-sg13g2 0.788 1.081 0 0 +0 -0.7% 0/0
gcd ihp-sg13g2 0.4755 0.5114 0 0 +0 +0.6% 0/0
i2c-gpio-expander ihp-sg13g2 -2.039 -2.046 -5.638 -5.509 +0.1291 +0.2% 0/0
ibex ihp-sg13g2 0.07064 -0.0396 0 -0.05782 -0.05782 -1.7% 0/0
jpeg ihp-sg13g2 1.556 1.715 0 0 +0 -0.4% 0/0
riscv32i ihp-sg13g2 0.9336 1.055 0 0 +0 -0.3% 0/0
spi ihp-sg13g2 0.09465 0.09271 0 0 +0 -1.1% 0/0
aes nangate45 -0.01362 -0.02568 -0.06014 -0.1641 -0.104 -0.5% 0/0
ariane133 nangate45 -0.3566 -0.3012 -588.6 -441.9 +146.6 -3.5% 0/0
ariane136 nangate45 0.1734 0.2191 0 0 +0 -3.3% 0/0
bp nangate45 -2.986 -3.002 -2.986 -3.002 -0.0161 -1.7% 0/0
bp_be nangate45 0.003933 0.007568 0 0 +0 +0.3% 0/0
bp_fe nangate45 -0.05874 -0.05874 -1.098 -1.098 +0 +0.0% 0/0
bp_multi nangate45 -0.1631 -0.03546 -0.1631 -0.03546 +0.1276 -0.7% 0/0
cva6 nangate45 996.5 996.3 0 0 +0 +3.1% 0/0
dynamic_node nangate45 -1.001 -1.003 -823.1 -812.9 +10.23 -2.3% 0/0
gcd nangate45 -0.1606 -0.1625 -7.176 -7.097 +0.07901 -0.7% 0/0
ibex nangate45 -0.0155 -0.02385 -1.371 -2.597 -1.226 -1.1% 0/0
jpeg nangate45 -0.1103 -0.1293 -39.52 -45.31 -5.797 -2.2% 0/0
mempool_group nangate45 -2.16 -2.16 -1.178e+04 -1.199e+04 -211.3 -0.9% 0/0
swerv nangate45 -0.6402 -0.6702 -459.1 -479.5 -20.34 -0.4% 0/0
swerv_wrapper nangate45 -0.3423 -0.369 -514.4 -418.1 +96.35 -1.1% 0/0
tinyRocket nangate45 -0.1188 -0.1342 -35.76 -31.28 +4.485 -1.4% 0/0
aes sky130hd -0.1959 -0.07569 -0.6734 -0.3334 +0.34 -0.3% 0/0
chameleon sky130hd -2.256 -1.119 -145 -41.07 +104 -12.4% 0/0
gcd sky130hd -1.465 -1.355 -65.09 -61.44 +3.653 -14.7% 0/0
ibex sky130hd 0.06897 0.03388 0 0 +0 +3.3% 0/0
jpeg sky130hd -0.5711 -0.5461 -91.08 -76.91 +14.17 +0.2% 0/0
microwatt sky130hd -1.161 -0.9849 -167.9 -140.7 +27.28 +0.2% 0/0
riscv32i sky130hd -0.7531 -0.5349 -43.27 -37.9 +5.377 +3.4% 0/0
aes sky130hs -0.01216 0.01203 -0.02358 0 +0.02358 -2.9% 0/0
gcd sky130hs -0.2489 -0.2505 -7.667 -7.49 +0.1767 -3.0% 0/0
ibex sky130hs -0.5364 -0.805 -289.8 -320.1 -30.32 +10.6% 0/0
jpeg sky130hs -0.2318 -0.4797 -38.93 -103.5 -64.61 +16.9% 0/0
riscv32i sky130hs -0.4268 -0.2243 -281.6 -91.26 +190.4 -0.5% 0/0

A non-virtual timing-driven iteration runs repair_design, which replaces
large portions of the netlist topology (buffer insertion/removal and the
corresponding GCell create/delete). updateGCellState() re-seeds only the
new instances, while the global accelerated-gradient momentum coefficient
curA and the existing cells' velocity carry the pre-repair trajectory into
the changed objective.

On nangate45 leon3_vta_bus this makes HPWL diverge (18.76M -> 37.53M um)
over the iterations after the repair while density overflow keeps falling,
so checkDivergence() (which only triggers on rising overflow) never fires
and GPL terminates on the overflow<0.1 criterion with a badly placed net:
an SRAM output buffer ends up 4.67 mm from its driver.

Restart the FISTA momentum (curA = 1.0) on the first iteration after a
non-virtual repair so the extrapolation coefficient starts from zero
instead of the stale ~0.99 value, then rebuilds gradually. On the repro
the SRAM-output first-sink distance drops from 4674 to 717 um and the
final HPWL from 37.53M to 18.67M um, with runtime unchanged.

Add the simple01-td-restart regression (simple01-td with max_fanout 2 so
both non-virtual repairs rebuild most of the netlist; it fails without the
restart) and refresh the goldens of the timing-driven tests whose
trajectories change with the restart (new GPL-0111 line, same final QoR).

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Reduce the seven-line rationale at the restart request in
runTimingDriven() to two lines; the mechanism is documented once on the
reset_nesterov_momentum_ member.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Merge origin/master (556e89f) into the momentum restart branch.

simple01-td-repair.ok conflicted: master dropped the startpoint TNS
column from the repair_timing progress table (The-OpenROAD-Project#11455) while this branch
changed the placement trajectory. Regenerate the golden from the merged
build; it differs from the previous branch golden only in the table
columns, the placement results are unchanged.

Follow master's test naming change (cae9bfe) in the new
simple01-td-restart test by calling diff_files instead of the diff_file
abbreviation.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@jhkim-pii jhkim-pii self-assigned this Sep 28, 2026

@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 a mechanism to restart FISTA momentum in the Nesterov loop after a non-virtual timing-driven iteration replaces the design topology. By resetting the momentum coefficient (curA to 1.0), the placer avoids extrapolating stale pre-repair trajectories onto the updated objective, preventing placement divergence. The changes include introducing the reset_nesterov_momentum_ flag, logging the restart event, adding a new regression test (simple01-td-restart), and updating test reference outputs. There are no review comments provided, so I have no feedback to offer.

@jhkim-pii
jhkim-pii marked this pull request as ready for review September 28, 2026 17:20
@jhkim-pii
jhkim-pii requested a review from a team as a code owner September 28, 2026 17:20
@jhkim-pii
jhkim-pii requested a review from gudeh September 28, 2026 17:20
Comment thread src/gpl/src/nesterovPlace.cpp Outdated
Comment thread src/gpl/src/nesterovPlace.cpp Outdated
@gudeh

gudeh commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

This should require metrics update, I understand.

Address review: remove the comments at the restart request in
runTimingDriven() and at the restart in doNesterovPlace(). The comment
on the reset_nesterov_momentum_ member already explains the mechanism.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@gudeh

gudeh commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

I wouldn't call this a workaround, I would call this a legit fix!

I tried resetting the gradients in the past but it didn't work. Some folks from a PII client also tried resetting gradients and also weren't successful.

This seems like a simple and elegant solution to the problem. I experimented this idea on other divergences occurrences and it does help. A PR is open ATM: #11560

For posterity, here are some results from the dashboard:

Clear improvement in TNS and WNS at GPL:
image

Final TNS and WNS, we observe a weak correlation, positive mean nonetheless:
image
image

@gudeh
gudeh merged commit b2e51b5 into The-OpenROAD-Project:master Sep 29, 2026
20 checks passed
@gudeh
gudeh deleted the secure-gpl-momentum-reset-fix branch September 29, 2026 13:38
gudeh added a commit that referenced this pull request Sep 29, 2026
…ecure-gpl-momentum-reset-fix"

This reverts commit b2e51b5, reversing
changes made to 3aa45d8.

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
gudeh added a commit that referenced this pull request Sep 29, 2026
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.

2 participants