-
Notifications
You must be signed in to change notification settings - Fork 375
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
Fix fixed clusters issue #2495
base: master
Are you sure you want to change the base?
Fix fixed clusters issue #2495
Conversation
Link to QoR results for Titan benchmarks. They are the same as master. |
|
@vaughnbetz |
Please summarize the relative runtime, cpd, wirelength etc. of the master vs. this fix. |
|
Issue runtime: was a few days, now is less than 5 min so it is fixed. |
@@ -126,6 +126,8 @@ ClusterBlockId propose_block_to_move(const t_placer_opts& placer_opts, | |||
ClusterNetId* net_from, | |||
int* pin_from); | |||
|
|||
const std::vector<ClusterBlockId>& movable_blocks_per_type(const t_logical_block_type& blk_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a doxygen comment for this routine.
vpr/src/place/move_utils.cpp
Outdated
} | ||
|
||
std::unordered_set<ClusterBlockId> tried_from_blocks; | ||
auto found_blocks = place_ctx.movable_blocks_per_type.find(logical_blk_type_index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we should store movable_blocks_per_type in a vector instead of an unordered_map for speed.
vpr/src/place/move_utils.cpp
Outdated
auto& place_ctx = g_vpr_ctx.mutable_placement(); | ||
const std::vector<ClusterBlockId>& movable_blocks_per_type(const t_logical_block_type& blk_type) { | ||
// empty vector is declared static to avoid re-allocation every time the function is called | ||
static std::vector<ClusterBlockId> empty_vector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the load_movable_blocks_per_type function could instead just load a vector for each block type in the netlist (movable_blocks_per_type) and return that vector. Types with no movable blocks would just return an empty vector that way (naturally, without special ifs and static varaibles).
That seems simpler, and if we use a vector of vectors like that it might be faster. I suggest switching to that style.
@soheilshahrouz : need to resolve a conflict. |
Description
When a large number of clustered blocks are fixed, placement takes a very long time. This is because for picking a random block, we exhaust all blocks until we find a movable block. If most clustered blocks are fixed, it would take a long time to exhaust fixed blocks by random selection. This PR stores movable blocks in a vtr::vector so that a movable random block can be selected more quickly. It also makes reading the placement file more robust.
Related Issue
Issue 2484
How Has This Been Tested?
Types of changes
Checklist: