Skip to content

WIP: Enhancing VPR lookahead map #1351

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

Closed

Conversation

acomodi
Copy link
Collaborator

@acomodi acomodi commented Jun 8, 2020

Signed-off-by: Alessandro Comodi [email protected]

Description

This PR is an initial Draft with the effort of getting the lookahead map work well with the Series 7 architectures.

Related Issue

The issue tracking what needs to be done and all suggestions is here: #1325

Motivation and Context

Currently, the SymbiFlow VTR fork implements the connection box lookahead map which has been tested to work well with Series 7 devices.
The idea is to get the lookahead map code produce similar results, so that eventually, there can be only one lookahead code being used.

In case the two different approaches cannot be merged, an alternative would be to have a common utility library for the different lookaheads.

How Has This Been Tested?

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@probot-autolabeler probot-autolabeler bot added lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool labels Jun 8, 2020
@acomodi acomodi marked this pull request as draft June 8, 2020 16:59
@acomodi acomodi force-pushed the enhance-lookahead-map branch from 4b3302a to 08656d1 Compare June 9, 2020 12:02
acomodi and others added 26 commits June 15, 2020 16:24
Signed-off-by: Alessandro Comodi <[email protected]>
 - New sampling method for connection box lookahead map.
 - New spiral hole filling algorithm
 - Use a lightweight version of PQ_Entry (PQ_Entry_Lite)
 - Use maps in run_dijkstra()
 - Move context of router_lookahead_map_utils inside of util namespace.

Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Keith Rothman <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
Expand base_cost too.

The delay and base cost matricies are independent, so should be expanded
and filled independently.

Signed-off-by: Keith Rothman <[email protected]>
Signed-off-by: Dusty DeWeese <[email protected]>
HackerFoo and others added 10 commits June 15, 2020 16:24
Before on the A200T:
> Computing connection box lookahead map took 31769.29 seconds (max_rss 45671.6 MiB, delta_rss +14486.3 MiB)

After on the A200T:
> Computing connection box lookahead map took 16791.79 seconds (max_rss 40113.6 MiB, delta_rss +8895.9 MiB)

Signed-off-by: Keith Rothman <[email protected]>
Signed-off-by: Keith Rothman <[email protected]>
Signed-off-by: Alessandro Comodi <[email protected]>
This reverts commit 8c4519c8723b7adf2c4571700202f06690d04278.
@acomodi acomodi force-pushed the enhance-lookahead-map branch from 08656d1 to 1334f91 Compare June 15, 2020 14:27
@probot-autolabeler probot-autolabeler bot added build Build system lang-make CMake/Make code tests labels Jun 15, 2020
@acomodi
Copy link
Collaborator Author

acomodi commented Jun 15, 2020

@litghost, @kmurray, @HackerFoo FYI.

I have completed the merge of the connection box lookahead map and the upstream lookahead map.

From the connection box lookahead, the following has been taken:

  • Sampling method: this has been extracted in a separate file
  • Paths expansion and lookahead filling
  • Lookahead map format (different capnp schema)

From the upstream lookahead map:

  • OPIN --> CHAN information
  • CHAN --> IPIN information
  • Delta locations calculations
  • Map addressability: e.g. cost_map[CHAN][SEG_ID][DELTA_X][DELTA_Y]

There are two assertions that needed to be skipped as they were triggered during the place delay matrix calculations:

The last one is due to the fact that there are some non valid values for the expected cost which is set to infinite.

I also had to temporarily remove the lookahead generation test under vpr/test which still needs to be adapted to the new lookahead generation mechanism.

With this implementation, the routing step has the following results:

  • 238.30 seconds
  • 18.796 ns (CPD)
  • Works on HW

With the connection box lookahead map:

  • 146.26 seconds
  • 17.381 ns (CPD)
  • Works on HW

The test design is the baselitex test from SymbiFlow

There is an increase in the CPD which I still need to analyse, as well as an increased run-time. Both of them are probably due to mispredictions, which I still need to analyse in details.

This is the route log out of this PR's implementation: route.log

@litghost
Copy link
Collaborator

There are two assertions that needed to be skipped as they were triggered during the place delay matrix calculations:

Both of these assertions should be in place, and violating them likely indicates a bug?

@@ -19,6 +19,7 @@ endif()
# Each schema used should appear here.
set(CAPNP_DEFS
place_delay_model.capnp
connection_map.capnp
Copy link
Collaborator

Choose a reason for hiding this comment

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

connection_map.capnp shouldn't be required, because it isn't used?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or if we are going to use this, it should move to map_lookahead.capnp

@@ -29,6 +30,10 @@ void time_on_fanout_analysis() {}

void profiling_initialization(unsigned /*max_net_fanout*/) {}

void conn_start() {}
Copy link
Collaborator

@litghost litghost Jun 15, 2020

Choose a reason for hiding this comment

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

The changes to route_profiling.cpp/.h should likely be in another PR.

@@ -1096,6 +1096,8 @@ bool timing_driven_route_net(ConnectionRouter& router,
conn_delay_budget.short_path_criticality = budgeting_inf.get_crit_short_path(net_id, target_pin);
}

profiling::conn_start();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should move out of this PR with the route_profiling.h/.cpp changes

@@ -1,62 +0,0 @@
#include "catch.hpp"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did this test get deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was based on the previous router_lookahead_map code, I would need to readapt the test with the code merged from the connection box lookahead map and the upstream lookahead map. It still is in the TODO list.

@@ -48,7 +48,7 @@
* This field is valid only for IPINs and OPINs and should be ignored *
* otherwise. */
struct alignas(16) t_rr_node_data {
int8_t cost_index_ = -1;
int16_t cost_index_ = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be put in another PR, to examine changing this independently of the other changes.

@@ -1,48 +1,84 @@
#pragma once
#ifndef CONNECTION_BOX_LOOKAHEAD_H_
#define CONNECTION_BOX_LOOKAHEAD_H_
Copy link
Collaborator

Choose a reason for hiding this comment

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

Either leave this as #pragma once, or fix the #define

@litghost
Copy link
Collaborator

This PR likely combines too many changes at once. Things unrelated to the lookahead change should go in their own PR, and the initial change to the map lookahead should be extensions that do not change behavior significantly. For example, the CHAN to IPIN PR should be separated from the sampling / parallelism PR.

@acomodi
Copy link
Collaborator Author

acomodi commented Jun 15, 2020

@litghost All right, I'll split this into multiple ones in the following order to have an incremental merge of the changes:

@kmurray
Copy link
Contributor

kmurray commented Jun 16, 2020

I'll split this into multiple ones in the following order to have an incremental merge of the changes

I agree this seems like the right approach.

@acomodi
Copy link
Collaborator Author

acomodi commented Aug 4, 2020

Closing, superseded by #1449

@acomodi acomodi closed this Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system lang-cpp C/C++ code lang-make CMake/Make code tests VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants