-
Notifications
You must be signed in to change notification settings - Fork 415
[vpr][place] refactoring variables in net_cost_handler #2644
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
Conversation
inet_cost, proposed_net_cost, and bb_updated_before grouped in a struct. bb_updated_before renamed to bb_update_status.
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.
Some changes requested for commenting and naming.
3% slowdown in place time: there are similar slowdowns in pack and route time, so this just looks like a machine load bounce. So overall the CPU time looks very similar.
vpr/src/place/net_cost_handler.cpp
Outdated
@@ -55,14 +55,10 @@ static vtr::NdMatrix<float, 2> chanx_place_cost_fac({0, 0}); // [0...device_ctx. | |||
static vtr::NdMatrix<float, 2> chany_place_cost_fac({0, 0}); // [0...device_ctx.grid.height()-2] | |||
|
|||
/** | |||
* @brief Cost of a net, and a temporary cost of a net used during move assessment. | |||
* @brief For the first two element in the struct: Cost of a net, and a temporary cost of a net used during move assessment. |
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.
You should use the member names (net_cost etc.) instead of the order in the struct, in case a member is added or deleted or reordered in the future. It also makes the comment more self-contained.
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.
Also comment that there is one entry per cluster level net [0...cluster_ctx.clb_nlist.nets().size()-1] for each of these vectors. (Mention this early in the comment).
vpr/src/place/net_cost_handler.cpp
Outdated
|
||
/** * | ||
* @brief Flag array to indicate whether the specific bounding box has been updated | ||
* For the last one element in the struct: Flag array to indicate whether the specific bounding box has been updated |
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.
Change to "bb_update_status: flag array ..."
vpr/src/place/net_cost_handler.cpp
Outdated
@@ -74,7 +70,12 @@ static vtr::vector<ClusterNetId, double> net_cost, proposed_net_cost; | |||
* bounding box is got from scratch, so the bounding box would definitely be | |||
* right, DO NOT update again. | |||
*/ | |||
static vtr::vector<ClusterNetId, NetUpdateState> bb_updated_before; // [0...cluster_ctx.clb_nlist.nets().size()-1] | |||
struct NetInfo { |
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.
I suggest a somewhat more descriptive name, e.g. PLNetCost.
vpr/src/place/net_cost_handler.cpp
Outdated
vtr::vector<ClusterNetId, double> net_cost; | ||
vtr::vector<ClusterNetId, double> proposed_net_cost; | ||
vtr::vector<ClusterNetId, NetUpdateState> bb_update_status; // [0...cluster_ctx.clb_nlist.nets().size()-1] | ||
} NetInfo; |
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.
Isn't this making a variable NetInfo as well as a struct called NetInfo?
vpr/src/place/net_cost_handler.cpp
Outdated
vtr::vector<ClusterNetId, double> proposed_net_cost; | ||
vtr::vector<ClusterNetId, NetUpdateState> bb_update_status; // [0...cluster_ctx.clb_nlist.nets().size()-1] | ||
} NetInfo; | ||
static struct NetInfo net_info; |
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.
Can just write
static NetInfo net_info;
(or better yet, a renamed
static PLNetCost pl_net_cost;
)
All comments addressed and pushed again. |
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.
Looks good. Some conflicts need to be resolved, and then CI should launch (not sure why only four tests launched so far but hopefully they all launch after the conflicts are updated).
vpr/src/place/net_cost_handler.cpp
Outdated
@@ -55,14 +55,12 @@ static vtr::NdMatrix<float, 2> chanx_place_cost_fac({0, 0}); // [0...device_ctx. | |||
static vtr::NdMatrix<float, 2> chany_place_cost_fac({0, 0}); // [0...device_ctx.grid.height()-2] | |||
|
|||
/** | |||
* @brief Cost of a net, and a temporary cost of a net used during move assessment. | |||
* @brief For each of the vector in this struct, there is one entry per cluster level net: |
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.
vector -> vectors
@vaughnbetz I think the reason the CI did not launch is because this PR is being merged into the |
Ah, that makes sense. Yes, this should be merged into master. |
This work is based on |
I think Robert is right. We first need to merge the placement refactoring PR before this one. Vaughn has reviewed that PR, and I have addressed his comments. The only remaining task is for me to run the QoR tests one more time. I have discussed this with @AlexandreSinger, and it will be done this week (before Wednesday). @robluo I have a question regarding the QoR test. Is the baseline the VTR master branch or the placement refactoring PR? Thanks! |
@amin1377 The base line is |
net_cost, proposed_net_cost, and bb_updated_before grouped in a struct. bb_updated_before renamed to bb_update_status.
performance data is compared in:
[https://docs.google.com/spreadsheets/d/1VVvTxhVbGLO6Hq9d2ZmZqi7IWLRDFhMkFIhwDXQtYcw/edit?usp=sharing]
Geomean of vtr flow runtime on titan quick qor increased by 3%. Routed wire length remains unchanged.