Skip to content

Conversation

@b-chmiel
Copy link
Contributor

@b-chmiel b-chmiel commented Nov 26, 2025

New resynthesis strategy for rmp.
Alternative approach to #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 #8889.

@maliberty
Copy link
Member

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

@b-chmiel
Copy link
Contributor Author

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.

@maliberty
Copy link
Member

@QuantamHD please assign a Google reviewer

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

There were too many comments to post at once. Showing the first 25 out of 72. Check the log or trigger a new build to see more.

@QuantamHD
Copy link
Collaborator

@calewis could you review this PR from antmicro?

@b-chmiel b-chmiel force-pushed the rmp-genetic-slack-tuning-algorithm branch from 476e7f0 to e2e28e4 Compare December 1, 2025 14:16
@calewis
Copy link
Contributor

calewis commented Dec 1, 2025

@calewis could you review this PR from antmicro?

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

Copy link
Contributor

@calewis calewis left a comment

Choose a reason for hiding this comment

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

A few things: I think a lot of the code could benefit from a sample function. std::sample is a bit problematic though because it uses an implementation defined std::uniform_int_distribution which can lead to different behavior for the same seed on different compilers. There might be a boost::sample, but I didn't see it in boost.random. So I suggest making a utl::sample using the absl::uniform_int_distribution.

I didn't review the TCL changes and I don't know much about what ABC is doing so I only reviewed gia.cpp for the code in the file and not for what it is trying to accomplish.

In general it's close to LTGM, but we'll need @maliberty to give it a once over as well. I might be missing some style things since this is my first OpenRoad review.

@maliberty
Copy link
Member

I'll review after your comments are addressed

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

@b-chmiel b-chmiel force-pushed the rmp-genetic-slack-tuning-algorithm branch from e2e28e4 to 46ed168 Compare December 8, 2025 20:37
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

@b-chmiel b-chmiel force-pushed the rmp-genetic-slack-tuning-algorithm branch 2 times, most recently from 77af6d8 to f7540ca Compare December 9, 2025 11:59
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

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

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

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

@b-chmiel
Copy link
Contributor Author

b-chmiel commented Dec 9, 2025

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 #8908 (comment) to decide which mutation approach will be best.

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

@b-chmiel b-chmiel marked this pull request as ready for review December 9, 2025 14:26
Copy link
Contributor

@calewis calewis left a comment

Choose a reason for hiding this comment

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

Thanks for fixing things

@maliberty
Copy link
Member

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

@github-actions
Copy link
Contributor

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

@b-chmiel
Copy link
Contributor Author

@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

// TODO replace with std::unreachable() once we reach c++23
and nix environment files would need to be bumped as well in a separate PR.

@github-actions
Copy link
Contributor

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

1 similar comment
@github-actions
Copy link
Contributor

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

@b-chmiel
Copy link
Contributor Author

@maliberty All tests pass now without warnings

b-chmiel and others added 5 commits December 17, 2025 10:37
Co-authored-by: Krzysztof Bieganski <kbieganski@antmicro.com>
Co-authored-by: Ryszard Rozak <rrozak@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Co-authored-by: Krzysztof Bieganski <kbieganski@antmicro.com>
Co-authored-by: Ryszard Rozak <rrozak@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
@b-chmiel b-chmiel force-pushed the rmp-genetic-slack-tuning-algorithm branch from 7eb5e78 to 9206880 Compare December 17, 2025 09:38
@github-actions
Copy link
Contributor

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

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.

5 participants