dpl: runtime improvements#10936
Conversation
use std::vector<char> instead of std::unordered_set for checking new active cells. early abort when checking costs. early return at checkDRC(), only check all cases with debug level. hoist a few variables. Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request introduces several performance optimizations to the NegotiationLegalizer and PlacementDRC modules. Key improvements include caching Node pointers within NegCell to eliminate redundant network lookups, adding early-abort logic in negotiationCost when the accumulated cost exceeds a threshold, and introducing a fast-path short-circuit in checkDRC. The review feedback suggests further performance enhancements: reordering the short-circuit checks in checkDRC to evaluate cheaper checks before the expensive edge spacing check, and avoiding repeated heap allocations in negotiationIter by reusing a member variable instead of allocating a local vector on each iteration.
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
|
From the internal runtime report in the logs (message |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@osamahammad21 @maliberty we are clear to merge. |
| } | ||
| if (!isCellLegal(i)) { | ||
| activeCells.push_back(i); | ||
| active_set.insert(i); |
There was a problem hiding this comment.
Do you need is_active[i] = 1 to replace this line?
There was a problem hiding this comment.
Perhaps it doesn't matter as you are linearly scanning and won't see that index again?
There was a problem hiding this comment.
exactly! we don't need that, we won't iterate over i again.
|
BTW here are the runtimes for current master without changes from PR #10929 And negotiation alone is 71sec, so we go from this to 31sec, which is less half the measured time. |
|
Here are the runtimes for the latest changes at #10949. We do get a few seconds reduced, from around 85sec to 82sec. Going from 31sec to 27sec at the standalone Negotiation run. |



Summary
Runtime improvements for Negotiation Legalizer.
Type of Change
Impact
Local experiments present 23.3% runtime reduction (versus current master with Negotiation) on a design with 154K instances.
Here are some runtime measurements (repeated 3x each). Left is diamond search, middle is current master with Negotiation, and right is this PR.

Negotiation (85.231sec) is still 49% slower than diamond search (57.074sec), in other words it takes 1.5x more time than diamond search.
Verification
./etc/Build.sh).Related Issues