[GPL] Add randomized initial placement perturbation in GPL#10642
[GPL] Add randomized initial placement perturbation in GPL#10642calewis wants to merge 6 commits into
Conversation
|
Note The number of changes in this pull request is too large for Gemini Code Assist to generate a review. |
fbc9177 to
0eddb5e
Compare
| // microns. We guarantee at least 1 site/row step of shift if perturbation is | ||
| // enabled. |
There was a problem hiding this comment.
Why is that guarantee needed? Global placement doesn't legal the result.
There was a problem hiding this comment.
It's not needed, you want to simplify to something else?
There was a problem hiding this comment.
We could use https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/dist_ref/dists/normal_dist.html with a <good value> radius if you'd prefer.
018a4f0 to
ca5112e
Compare
Signed-off-by: Drew Lewis <cannada@google.com> TAG=agy CONV=0fed8794-10c3-4c6f-bdf2-3dedf6c02c30
ca5112e to
616a13d
Compare
Update the golden file to match the deterministic placement results produced by the global placement perturbation logic on this branch. The test has been verified to be 100% deterministic and independent of thread count (verified with both 4 and 8 threads). Signed-off-by: Drew Lewis <cannada@google.com>
173be28 to
c86c58e
Compare
|
@maliberty all checks now pass and I'm happy with where it's at. |
|
I started a secure CI. This has a merge conflict. |
| // To ensure that 99.5% of the perturbations fall within a circle of radius | ||
| // r_dbu, we use a Rayleigh distribution for the radial distance R = sqrt(X^2 | ||
| // + Y^2). CDF(r) = 1 - exp(-r^2 / (2 * sigma^2)) = 0.995 => sigma = r_dbu * | ||
| // sqrt(-1 / (2 * ln(0.005))) sigma \approx 0.3071963263271184 * r_dbu. | ||
| const double sigma = r_dbu * 0.3071963263271184; | ||
|
|
||
| boost::random::normal_distribution<double> dist(0.0, sigma); |
There was a problem hiding this comment.
I thought we talked about using a bounded offset. This gives some chance for a large jump that is unexpected.
There was a problem hiding this comment.
If you'd like we can just resample until the offset is <= the radius? There is only a 0.5% of a point falling outside the radius so only a 0.003% chance you'd need to sample more than twice. Gaussian is nice because the most probable outcome is that you barely move the point at all.
There was a problem hiding this comment.
The perturbation distances in microns look like (0.5 micron radius):
Vector Length Histogram (Rayleigh Distribution)
Based on 2D Normal (mean=0, sigma=0.153598)
Points: 50000
Min length: 0.000769
Max length: 0.786546
------------------------------------------
0.00 | ** (267)
0.03 | **************** (1900)
0.06 | ****************************** (3537)
0.09 | ****************************************** (4884)
0.12 | *********************************************** (5460)
0.15 | ************************************************** (5792)
0.18 | ************************************************* (5752)
0.21 | ********************************************* (5246)
0.24 | ************************************** (4517)
0.27 | ****************************** (3548)
0.30 | ************************* (2952)
0.33 | ****************** (2111)
0.36 | ************ (1458)
0.39 | ******** (1016)
0.42 | ***** (621)
0.45 | *** (400)
0.48 | ** (263)
0.51 | * (124)
0.54 | (67)
0.57 | (38)
0.60 | (22)
0.63 | (8)
0.66 | (9)
0.69 | (4)
0.72 | (2)
0.78 | (2)
With the current code if instead we use rejection based sampling for distances over 0.5 micron:
Truncated Vector Length Histogram
Based on 2D Normal (mean=0, sigma=0.153598)
Points Accepted: 50000
Points Rejected: 256 (fell outside 0.5 radius)
Min length: 0.001130
Max length: 0.499774
------------------------------------------
0.00 | * (103)
0.02 | ********** (826)
0.04 | ******************** (1627)
0.06 | **************************** (2315)
0.08 | ************************************* (2976)
0.10 | ****************************************** (3423)
0.12 | *********************************************** (3836)
0.14 | ************************************************** (4009)
0.16 | ************************************************* (3954)
0.18 | ************************************************ (3864)
0.20 | ******************************************** (3558)
0.22 | ***************************************** (3323)
0.24 | ************************************** (3063)
0.26 | ********************************* (2708)
0.28 | *************************** (2225)
0.30 | *********************** (1919)
0.32 | ******************* (1543)
0.34 | *************** (1217)
0.36 | ************ (991)
0.38 | ********* (759)
0.40 | ******* (582)
0.42 | ***** (426)
0.44 | *** (297)
0.46 | ** (231)
0.48 | * (150)
0.50 | (75)
There was a problem hiding this comment.
Finally, for completeness the old code, assuming it was using uniform sampling between 0 and 0.5 microns for both x and y:
Uniform Vector Length Histogram [x, y from U(0.0, 0.5)]
------------------------------------------
0.00 | (18)
0.02 | * (111)
0.04 | **** (255)
0.06 | ****** (368)
0.08 | ******** (509)
0.10 | ********* (572)
0.12 | ************ (766)
0.14 | ************** (875)
0.16 | **************** (1007)
0.18 | ****************** (1092)
0.20 | ******************** (1271)
0.22 | ********************** (1353)
0.24 | ************************ (1475)
0.26 | ************************* (1556)
0.28 | *************************** (1684)
0.30 | ******************************* (1899)
0.32 | ********************************* (2003)
0.34 | ********************************* (2035)
0.36 | ************************************** (2321)
0.38 | *************************************** (2423)
0.40 | ****************************************** (2556)
0.42 | ******************************************** (2692)
0.44 | ********************************************** (2824)
0.46 | *********************************************** (2862)
0.48 | ************************************************** (3031)
0.50 | *********************************************** (2903)
0.52 | *********************************** (2132)
0.54 | **************************** (1742)
0.56 | *********************** (1442)
0.58 | ******************* (1195)
0.60 | **************** (992)
0.62 | ************* (810)
0.64 | ********* (566)
0.66 | ****** (379)
0.68 | *** (216)
0.70 | * (65)
There was a problem hiding this comment.
I guess it still falls off sharply enough to not be worth changing.
…turbation Signed-off-by: Drew Lewis <cannada@google.com> # Conflicts: # test/ibex_sky130hs.metrics_limits
Signed-off-by: Drew Lewis <cannada@google.com>
Signed-off-by: Drew Lewis <cannada@google.com>
Signed-off-by: Drew Lewis <cannada@google.com>
dd4a0ab to
3280e93
Compare
Summary
Implemented a randomized initial placement perturbation feature in the OpenROAD Global Placer (GPL). This feature shifts standard cells by discrete increments of site widths (X direction) and row heights (Y direction), bounded to a maximum of 0.5 microns in both directions.
This replacement of the legacy
srand(42)andrand()non-grid-aligned cell perturbation is controlled by a seed configured via the new-random_seedflag (default is1)Impact
-random_seedoption to theglobal_placementTcl command to customize the random seed (default is1)..okand.defokfiles) to align with the new default seed1layout expectations.Verification
./etc/Build.sh).