Skip to content

[RouterLookahead] Router Lookahead Report #3161

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexandreSinger
Copy link
Contributor

Added an option to generate a report on the router lookahead. This reports profiles the router lookahead by performing a set of trial routes from source RR nodes to all target RR nodes and comparing the estimated cost from the router lookahead to the actual cost of the path.

Notably, this report tries to show the mean squared error of the router lookahead and the maximum overestimation of the router lookahead.

The mean squared error is a measure of how accurate the router lookahead is. The more accurate the router lookahead is, the faster the path search will be (with less loss in quality). The max overestimation is a measure of the admissibility of the router lookahead heuristic. The more the router lookahead overestimates, the worse the quality of the path found (theoretically).

@AlexandreSinger
Copy link
Contributor Author

Here is an example of what the report looks like:
report_router_lookahead.txt

image

...

image

@AlexandreSinger
Copy link
Contributor Author

@amin1377 FYI, you might find this option interesting.

Added an option to generate a report on the router lookahead. This
reports profiles the router lookahead by performing a set of trial
routes from source RR nodes to all target RR nodes and comparing the
estimated cost from the router lookahead to the actual cost of the path.

Notably, this report tries to show the mean squared error of the router
lookahead and the maximum overestimation of the router lookahead.

The mean squared error is a measure of how accurate the router lookahead
is. The more accurate the router lookahead is, the faster the path
search will be (with less loss in quality). The max overestimation is a
measure of the admissibility of the router lookahead heuristic. The more
the router lookahead overestimates, the worse the quality of the path
found (theoretically).
@AlexandreSinger AlexandreSinger force-pushed the feature-lookahead-profile-report branch from d4026a5 to c60fde5 Compare June 24, 2025 03:51
@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool docs Documentation lang-cpp C/C++ code labels Jun 24, 2025
return "UNKNOWN";
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

rr_node_typename in rr_node_types.h does the same thing.


// Create a NOP router lookahead to be used during the all-destination dijkstra search.
t_det_routing_arch temp_det_routing_arch;
auto temp_router_lookahead = make_router_lookahead(temp_det_routing_arch, e_router_lookahead::NO_OP,
Copy link
Contributor

Choose a reason for hiding this comment

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

replace auto with explicit type name

float heuristic_delay = 0.0f;
float path_delay = 0.0f;
};
std::vector<t_overestimation_info> max_overestimation_per_type((int)e_rr_type::NUM_RR_TYPES);
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use vtr::vector and index it directly with e_rr_type

* valuable since over-estimations in the router lookahead cause the
* heuristic to be inadmissible which can hurt quality.
*/
static void profile_lookahead_overestimation(std::ofstream& os,
Copy link
Contributor

Choose a reason for hiding this comment

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

This functio is quite long. Consider breaking it down

// The target number of random source (sample) nodes to use.
size_t target_num_trials = 100;
// The maximum number of attempts.
size_t max_attempts = 10000;
Copy link
Contributor

Choose a reason for hiding this comment

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

use constexpr if there is no plan to modify these values through command line options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants