mpl: Fixes MPL-45 can't split cluster error#10520
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a "Rocks vs Sand Check" in the clustering engine to detect when a single macro dominates the total standard cell area. When macro domination is detected, macro weights are dynamically normalized to the average standard cell area to prevent knapsack partition failures. A new test case mpl_dominated has been added to verify this behavior. The reviewer identified a critical bug where macro-only clusters (with zero standard cells) would incorrectly trigger this domination logic, leading to suboptimal weight normalization. A code suggestion was provided to ensure standard cells are present before flagging macro domination.
| // 2. The Rocks vs Sand Check | ||
| // If a single macro dwarfs the entire standard cell cloud, area-balancing | ||
| // is structurally impossible against a min-cut objective. | ||
| const bool discrete_macro_domination = (max_macro_area > total_std_cell_area); |
There was a problem hiding this comment.
If there are no standard cells in the cluster (num_std_cells == 0), total_std_cell_area will be 0.0f. If there is at least one macro, max_macro_area will be greater than 0.0f, which makes discrete_macro_domination evaluate to true.
This triggers macro weight normalization to 1.0f (since avg_std_cell_area defaults to 1.0f when num_std_cells == 0). For a macro-only cluster, normalizing all macro weights to 1.0f prevents the partitioner from balancing the actual physical areas of the macros, leading to poor partitioning results.
We should only consider the cluster macro-dominated if there are actually standard cells present to be balanced against.
| const bool discrete_macro_domination = (max_macro_area > total_std_cell_area); | |
| const bool discrete_macro_domination = (num_std_cells > 0) && (max_macro_area > total_std_cell_area); |
There was a problem hiding this comment.
If a block contains only macros this method is never called.
98cc178 to
72e3e19
Compare
|
The review dog clang tidy seems to not be posting comments |
This error seems to occur when you have a macro dominated block with just a few standard cells. Added a test case that I validated failed with HEAD and passes with my change. B:513351985 Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com> clang-format Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
72e3e19 to
167e32b
Compare
|
What's your opinion on simply splitting the cluster into I did some testing on the current behavior of TritonPart using the Also, I think something more descriptive like |
|
In my prod design it's six identical macros of roughly 1 million cells and 90,000 cells connecting them. Would your proposed solution work for something like that? My worry with the 50% check is that it wouldn't trigger when we have many macros, but only a small standard cell area. Also I could use a pointer on the mechanics of implementing what you suggested. Where should I put that code? |
|
@QuantamHD |
This error seems to occur when you have a macro dominated block with just a few standard cells. Added a test case that I validated failed with HEAD and passes with my change.
Verification
./etc/Build.sh).