Skip to content

Placement Refactoring #2396

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

Merged
merged 207 commits into from
Jul 19, 2024
Merged

Placement Refactoring #2396

merged 207 commits into from
Jul 19, 2024

Conversation

amin1377
Copy link
Contributor

This is a work in progress. The full description will be written soon.

MohamedElgammal added 30 commits May 5, 2023 04:28
… movement (still need cleaning and testing)
@vaughnbetz
Copy link
Contributor

Looks promising!

  1. Resolve conflicts
  2. Run koios & VTR to get more CPU times. These ones are looking promising.
  3. If there's a runtime gap, we should then profile to see if there are any obvious hotspots. But we don't need to get exact runtime parity if it proves really hard.

@amin1377 amin1377 changed the title [WIP] Reclustring during placement Placement Refactoring Jun 20, 2024
@vaughnbetz
Copy link
Contributor

Please attach Koios and VTR run results.

Copy link
Contributor

@vaughnbetz vaughnbetz 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 the big refactoring @amin1377 !
I have a lot of comments though. Here is a summary:

Things to definitely do before merging this PR:

  • Doxygen comments: expand, describe parameters, unify comments where we have a function-scope comment both at the declaration and the definition (prefer declaration).
  • A few time-critical asserts should become VTR_ASSERT_SAFE or VTR_ASSERT_DEBUG
  • Various specific code comments.

Things to consider, but to do in a separate PR with QoR measurements on each:

  • We could clean up / organize some of the file scope variables by putting them in structures.
  • Could we use the .size() member of a ts_ vector instead of num_nets_affected?
  • We can speed up and simplify the bounding box calculation a bit, and make it a little more accurate, by getting rid of the min/max code that keeps all bounding boxes in the [1..width-1] range.
  • Where is the z-directed bounding box cost, and the computation of the z-directed channel normalization factors?
  • Do we need the num_sinks_per_layer[] data structure or could we get rid of it (it leads to O(layer) computations).

costs->cost = new_bb_cost * costs->bb_cost_norm;
}

if (noc_opts.noc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

All these noc cost checks can be shortened by using vtr::isclose with an absolute tolerance of MIN_EXPECTED_NOC_LATENCY_COST etc. (i.e. set the last argument to that value). So the if statements can be taken out, the check_and_print_cost lambda should take one more parameter (absolute cost threshold) and that parameter should be passed to vtr::isclose().

Copy link
Contributor

Choose a reason for hiding this comment

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

Can file an issue to @soheilshahrouz if you want him to clean this up.

@amin1377
Copy link
Contributor Author

QoR on all koios circuits:
image

@vaughnbetz
Copy link
Contributor

You have a warning that is making the various build types fail (we turn on -Werror):
[ 81%] Building CXX object vpr/CMakeFiles/libvpr.dir/src/place/net_cost_handler.cpp.o
/home/runner/work/vtr-verilog-to-routing/vtr-verilog-to-routing/vpr/src/place/net_cost_handler.cpp:243:13: error: "/" within comment [-Werror=comment]
243 | * @details /
Updates the bounding box of a net by storing its coordinates in the bb_coord_new data structure and

@vaughnbetz
Copy link
Contributor

Thanks @amin1377 ! Once you have as many suggestions resolved as you want for this PR (others can go to separate issues), you'll need to run full QoR sweeps:

  • VTR, Titan, Koios on usual 2D architecture each
  • 3D architecture with 3D BB
  • 3D architecture with layer BB

@vaughnbetz
Copy link
Contributor

Adding @soheilshahrouz to the conversation, as he is interested in trying parallel "population annealing", and to do that he would need non-global objects for the placement state and the placement cost.

@amin1377
Copy link
Contributor Author

QoR after applying comments:
Baseline: Master branch (121a16c)
Placement Refac Branch (d000874)
Titan:
image

Large VTR:
image

@vaughnbetz vaughnbetz merged commit fca017a into master Jul 19, 2024
53 checks passed
@vaughnbetz vaughnbetz deleted the placement_move_primitive branch July 19, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code libarchfpga Library for handling FPGA Architecture descriptions libvtrutil VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants