Skip to content
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

[APPack] Added Max Displacement Metric #2876

Merged

Conversation

AlexandreSinger
Copy link
Contributor

@AlexandreSinger AlexandreSinger commented Feb 1, 2025

Added the ability to print the max displacement from the placement reconstruction to the original flat placement.

This metric will help show another dimension to the flat placement reconstruction. Generally, if the average displacement is low, that may not be good if that means that one atom is placed way farther away than where it would like. This can really hurt quality.

I also turned the distance calculation from the Euclidean distance to the Manhattan distance. This should better represent the objective in terms of FPGAs (where the fastest path between two points is not necessarily a straight line).

I reran the results of the flat placement reconstruction on MCNC and VTR-Chain (same testing procedure as the last PR).

MCNC:

iter_num pack_time(s) device_util total_wl CPD(ns) percent_cluster_errors percent_atoms_displaced average_atom_displacement max_atom_displacement
0 1.66 0.55 15915.75 5.74 -1.00 -1.00 -1.00 -1.00
1 1.38 0.55 15845.75 5.72 0.06 0.11 1.03 24.90
2 1.36 0.55 15760.75 5.78 0.02 0.05 0.62 23.35
3 1.35 0.55 15741.55 5.75 0.01 0.03 0.50 24.20
4 1.36 0.55 15731.45 5.77 0.00 0.03 0.47 22.10
5 1.37 0.55 15744.25 5.75 0.00 0.03 0.47 22.60
6 1.36 0.55 15738.00 5.70 0.00 0.03 0.46 23.70
7 1.36 0.55 15718.60 5.75 0.00 0.03 0.47 22.40
8 1.37 0.55 15771.60 5.72 0.00 0.03 0.44 22.05
9 1.36 0.55 15771.50 5.72 0.00 0.03 0.46 22.60
10 1.36 0.55 15737.35 5.73 0.00 0.03 0.46 20.75

VTR-Chain:

iter_num pack_time(s) device_util total_wl CPD(ns) percent_cluster_errors percent_atoms_displaced average_atom_displacement max_atom_displacement
0 38.35 0.41 181585.10 17.57 -1.00 -1.00 -1.00 -1.00
1 31.37 0.41 180732.90 17.54 0.03 0.09 2.35 74.43
2 31.65 0.41 180024.86 17.50 0.01 0.07 1.67 73.48
3 32.44 0.41 180185.67 17.57 0.00 0.05 1.37 73.81
4 33.79 0.41 179515.57 17.55 0.00 0.05 1.27 73.24
5 32.11 0.41 179527.86 17.42 0.00 0.05 1.17 73.19
6 32.66 0.41 178827.62 17.41 0.00 0.05 1.11 74.24
7 31.22 0.41 178657.33 17.48 0.00 0.05 1.18 73.81
8 32.27 0.41 178222.38 17.46 0.00 0.05 1.14 73.67
9 34.71 0.41 177943.86 17.43 0.00 0.05 1.08 73.81
10 35.68 0.41 177570.81 17.44 0.00 0.05 1.07 73.10

Looking at a single circuit: LU32PEEng from the VTR-Chain benchmark, with a device size of 105x105:

iter_num pack_time(s) device_util total_wl CPD(ns) percent_cluster_errors percent_atoms_displaced average_atom_displacement max_atom_displacement
0 250.52 0.79 1286419.00 73.20 -1.00 -1.00 -1.00 -1
1 204.88 0.79 1268451.00 72.93 0.01 0.02 1.27 182
2 210.36 0.79 1274392.00 72.09 0.00 0.01 0.47 188
3 211.24 0.79 1279439.00 72.85 0.00 0.00 0.28 193
4 216.72 0.79 1270402.00 72.35 0.00 0.00 0.32 183
5 209.30 0.79 1268843.00 71.84 0.00 0.00 0.18 190
6 213.68 0.79 1258073.00 71.66 0.00 0.00 0.15 194
7 206.72 0.79 1257779.00 72.79 0.00 0.00 0.22 180
8 211.49 0.79 1255023.00 72.64 0.00 0.00 0.12 189
9 229.91 0.79 1253152.00 72.55 0.00 0.00 0.06 194
10 235.62 0.79 1252555.00 72.55 0.00 0.00 0.05 183

The units for the max atom displacement is the euclidean distance from the flat placement location to the reconstructed clustered placement. For MCNC, the devices range from 11x11 to 22x22. For VTR-Chain, the devices range from 20x20 to 105x105.

These results show a potential problem with the current (basic) reconstruction, where although the cluster errors and average displacement is quite low, we still see a very high maximum displacement! This implies that there is something wrong with how we are placing the clusters. I think the issue may be the fact that if we find that a cluster cannot be placed at the tile it wants, it falls back on the original algorithm; which may be randomly placed on the chip!

Notice, for the LU32PEEng circuit, the largest distance possible on the device is 210. We can see that the current reconstruction is sometimes placing atoms (a few of them) all the way on the other side of the chip!

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Feb 1, 2025
Added the ability to print the max displacement from the placement
reconstruction to the original flat placement.

This metric will help show another dimension to the flat placement
reconstruction. Generally, if the average displacement is low, that may
not be good if that means that one atom is placed way farther away than
where it would like. This can really hurt quality.

Turned the distance calculation into the Manhattan Norm instead of the
Euclidean Norm.
@AlexandreSinger
Copy link
Contributor Author

@vaughnbetz This PR is ready for review. I have updated the results above for MCNC to the Manhattan distance; the VTR Chain results with Manhattan distance are currently being collected.

@AlexandreSinger
Copy link
Contributor Author

I have updated the description of the PR with the Manhattan distance for VTR Chain.

@vaughnbetz
Copy link
Contributor

LGTM!

@vaughnbetz vaughnbetz merged commit 1279554 into verilog-to-routing:master Feb 6, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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