Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsz: repairSetup: Restrict number of repairs per iteration #6244

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eszpotanski
Copy link
Contributor

This PR changes the way rsz::repairSetup iterates over the violations. Instead of going one by one and trying to completely repair a violation, this PR introduces the maximum number of repairs per iteration.
If a violation was not repaired, it goes back to the queue and algorithm proceeds to the violation with the worst slack.

This approach should minimize the probability of falling into local optimums, and potentially make fixing other violation easier. Base on the experiment, it can speedup the repairs which resolves all violations, from 6% and up to 25%:

Design: ibex, stage: 2_1_floorplan
Strategy Min [s] Max [s] Mean [s] Median [s] Relative
baseline 34.07 34.43 34.25 ± 0.15 34.25 125%
Max 5 repairs per iteration 27.40 27.52 27.46 ± 0.04 27.46 100%
Max 10 repairs per iteration 27.42 27.50 27.46 ± 0.03 27.47 100%
Max 20 repairs per iteration 32.26 32.57 32.44 ± 0.12 32.51 118%
Max 30 repairs per iteration 31.64 31.91 31.78 ± 0.10 31.78 116%
Max 40 repairs per iteration 31.67 32.37 31.94 ± 0.25 31.86 116%
Design: ibex, stage 4_1_cts
Strategy Min [s] Max [s] Mean [s] Median [s] Relative
baseline 141.94 143.26 142.46 ± 0.58 142.17 110%
Max 5 repairs per iteration 130.77 132.21 131.71 ± 0.66 132.14 102%
Max 10 repairs per iteration 144.99 145.81 145.28 ± 0.38 145.04 112%
Max 20 repairs per iteration 133.92 136.12 135.09 ± 0.91 135.23 105%
Max 30 repairs per iteration 129.04 131.44 129.85 ± 1.12 129.09 100%
Max 40 repairs per iteration 375.26 381.54 377.54 ± 2.84 375.81 291%
Design: black_parrot, stage: 2_1_floorplan
Strategy Min [s] Max [s] Mean [s] Median [s] Relative
baseline 54.34 55.46 55.03 ± 0.49 55.29 106%
Max 5 repairs per iteration 51.83 52.31 52.03 ± 0.20 51.95 100%
Max 10 repairs per iteration 52.00 52.89 52.47 ± 0.37 52.52 101%
Max 20 repairs per iteration 52.13 52.73 52.41 ± 0.25 52.36 101%
Max 30 repairs per iteration 52.21 52.64 52.42 ± 0.18 52.40 101%
Max 40 repairs per iteration 52.12 52.75 52.40 ± 0.26 52.32 101%
Design: black_parrot, stage: 4_1_cts
Branch Min [s] Max [s] Mean [s] Median [s] Relative
baseline 192.68 194.13 193.40 ± 0.59 193.39 111%
Max 5 repairs per iteration 173.96 174.63 174.31 ± 0.28 174.35 100%
Max 10 repairs per iteration 174.06 175.66 174.80 ± 0.66 174.68 101%
Max 20 repairs per iteration 174.20 174.45 174.30 ± 0.11 174.24 100%
Max 30 repairs per iteration 173.69 174.57 173.98 ± 0.41 173.70 100%
Max 40 repairs per iteration 174.15 175.71 174.76 ± 0.68 174.40 100%
Design: ariane133, stage: 2_1_floorplan
Strategy Min [s] Max [s] Mean [s] Median [s] Relative
baseline 89.18 91.54 90.27 ± 0.97 90.08 107%
Max 5 repairs per iteration 83.93 86.98 85.92 ± 1.40 86.84 103%
Max 10 repairs per iteration 84.02 86.44 85.22 ± 0.99 85.18 101%
Max 20 repairs per iteration 85.16 86.72 85.75 ± 0.69 85.36 102%
Max 30 repairs per iteration 83.70 86.34 85.05 ± 1.08 85.12 101%
Max 40 repairs per iteration 81.91 84.82 83.56 ± 1.22 83.94 100%

For stages where all violations are not resolved, it can increase the number of iterations and improve the slack:

Design: aes, stage: 4_1_cts
Strategy Mean [s] Median [s] Relative Number of iterations Worst slack Total negative slack
baseline 69.88 ± 2.89 70.2042 105% 1331 -37.1303 -1127.02
Max 5 repairs per iteration 66.73 ± 1.85 66.6787 100% 917 -41.5148 -1822.57
Max 10 repairs per iteration 72.13 ± 0.88 71.645 107% 1200 -36.0651 -1602.71
Max 20 repairs per iteration 78.81 ± 1.16 78.1942 117% 1400 -33.651 -1020.18
Max 30 repairs per iteration 80.75 ± 2.08 80.0711 120% 1561 -32.8517 -1411.56
Max 40 repairs per iteration 73.42 ± 1.60 73.8805 110% 1433 -29.8058 -1163.81
Design: ibex, stage: 5_1_grt
Strategy Mean [s] Median [s] Relative Number of iterations Worst slack Total negative slack
baseline 116.72 ± 0.05 116.74 103% 493 -67.1365 -588.325
Max 5 repairs per iteration 218.10 ± 4.85 220.85 195% 475 -57.9249 -1036.24
Max 10 repairs per iteration 111.28 ± 3.29 113.16 100% 442 -59.0674 -954.488
Max 20 repairs per iteration 121.88 ± 3.89 121.13 107% 495 -60.2138 -569.195
Max 30 repairs per iteration 119.03 ± 4.51 117.11 103% 499 -67.1365 -620.345
Max 40 repairs per iteration 116.94 ± 4.03 116.25 102% 489 -67.1365 -892.091

As results depends on max number of repairs per iteration, default value was set to 20 (usually ) and -max_passes_per_iter parameters was added for repair_timing to make it adjustable.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/rsz/src/RepairSetup.cc Outdated Show resolved Hide resolved
@eszpotanski eszpotanski force-pushed the eszpot/restrict-repairs-per-iter branch from 42405ec to 0ec2fc5 Compare November 26, 2024 10:08
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eszpotanski eszpotanski marked this pull request as draft November 26, 2024 10:45
…alling into local optimums

Signed-off-by: Eryk Szpotanski <eszpotanski@antmicro.com>
Signed-off-by: Eryk Szpotanski <eszpotanski@antmicro.com>
@eszpotanski eszpotanski force-pushed the eszpot/restrict-repairs-per-iter branch from 3a8e562 to 98b133b Compare November 26, 2024 23:36
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@@ -311,6 +312,7 @@ repair_timing
| `-skip_buffer_removal` | Flag to skip buffer removal. The default is to perform buffer removal transform during setup fixing. |
| `-skip_last_gasp` | Flag to skip final ("last gasp") optimizations. The default is to perform greedy sizing at the end of optimization. |
| `-repair_tns` | Percentage of violating endpoints to repair (0-100). When `tns_end_percent` is zero, only the worst endpoint is repaired. When `tns_end_percent` is 100 (default), all violating endpoints are repaired. |
| `-max_passes_per_iter` | Max number of repairs per iteration for `rsz::repairSetup`. |
Copy link
Member

Choose a reason for hiding this comment

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

Give the default (20)

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