OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

rmp: Genetic algorithm for slack tuning

Open b-chmiel opened this issue 1 month ago • 11 comments

New resynthesis strategy for rmp. Alternative approach to https://github.com/The-OpenROAD-Project/OpenROAD/pull/8437 for optimizing ABC timing. Utilizes a genetic algorithm with the following tunable parameters:

  • population size
  • mutation probability
  • cross probability
  • tournament size
  • tournament probability

Results from regression tests:

test slack execution time [s]
asap7 aes_genetic +26.52 164.3
asap7 aes_annealing +14.28 52.7

Marking as draft for a discussion, currently working on some minor implementation restructuring and algorithm parameter tuning.

Depends on https://github.com/The-OpenROAD-Project/OpenROAD/pull/8889.

b-chmiel avatar Nov 26 '25 16:11 b-chmiel

aes on what pdk? Are the slacks negative or positive?

maliberty avatar Nov 26 '25 16:11 maliberty

Tested on asap7 PDK. Results (in the regression test suite): aes_annealing.ok aes_genetic.ok

Slacks are positive, the higher the better. I'll adjust the description.

b-chmiel avatar Nov 26 '25 16:11 b-chmiel

@QuantamHD please assign a Google reviewer

maliberty avatar Nov 26 '25 16:11 maliberty

@calewis could you review this PR from antmicro?

QuantamHD avatar Nov 26 '25 17:11 QuantamHD

@calewis could you review this PR from antmicro?

Almost done, I just need to go through src/rmp/src/gia.cpp tomorrow.

calewis avatar Dec 01 '25 23:12 calewis

I'll review after your comments are addressed

maliberty avatar Dec 02 '25 17:12 maliberty

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 09 '25 13:12 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 09 '25 13:12 github-actions[bot]

The only errors I'm getting right now are related to ABC imports. For instance, importing header such as map/if/if.h causes include cycle warning (which is there as it includes map/if/acd/ac_wrapper.h which includes if.h) and redeclaration errors in cmake build. Not including this header causes misc-include-cleaner warning as those functions are not directly included in ac_wrapper.h. I'm also getting warnings from the inside of ABC library too.

@maliberty Should I avoid including this header altogether or ignore all problematical warnings with lint comments and compiler pragmas?

I'm also running a benchmark for https://github.com/The-OpenROAD-Project/OpenROAD/pull/8908#discussion_r2579031594 to decide which mutation approach will be best.

Besides that, I believe this PR is ready for a review.

b-chmiel avatar Dec 09 '25 14:12 b-chmiel

If you don't include if.h in ac_wrapper.h, what are "those functions" that it complains about?

maliberty avatar Dec 09 '25 19:12 maliberty

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 10 '25 13:12 github-actions[bot]

@maliberty The if.h header is required to be able to construct If_Par_t struct with custom parameters (defined there). This header throws two warnings:

  • Wredundant-decls (for repeated externs)
  • Wunused-but-set-variable (for inline code in utilTruth.h) I'd silenced those warnings for this header only, this resolved issues.

I'd also removed call to ABSL_UNREACHABLE as it requires bumping abseil to at least 2023. Then we may also add it to https://github.com/The-OpenROAD-Project/OpenROAD/blob/b57cfc641359379a86bd13e6a66bccdde1840a7e/src/dft/src/clock_domain/ClockDomain.cpp#L38 and nix environment files would need to be bumped as well in a separate PR.

b-chmiel avatar Dec 11 '25 15:12 b-chmiel

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 11 '25 15:12 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 12 '25 23:12 github-actions[bot]

@maliberty All tests pass now without warnings

b-chmiel avatar Dec 15 '25 13:12 b-chmiel

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Dec 17 '25 09:12 github-actions[bot]