Skip to content

Commit 9fe00ff

Browse files
committed
Documentation
Signed-off-by: Dusty DeWeese <[email protected]>
1 parent b46fd7d commit 9fe00ff

File tree

4 files changed

+75
-52
lines changed

4 files changed

+75
-52
lines changed

doc/src/vpr/command_line_usage.rst

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -669,46 +669,6 @@ If any of init_t, exit_t or alpha_t is specified, the user schedule, with a fixe
669669

670670
**Default:** ``0.8``
671671

672-
.. option:: --alpha_min <float>
673-
674-
The minimum (starting) update factor (alpha) used.
675-
Ranges between 0 and alpha_max.
676-
Setting this flag selects Dusty's annealing schedule.
677-
678-
**Default:** ``0.2``
679-
680-
.. option:: --alpha_max <float>
681-
682-
The maximum (stopping) update factor (alpha) used after which simulated annealing will complete.
683-
Ranges between alpha_min and 1.
684-
Setting this flag selects Dusty's annealing schedule.
685-
686-
**Default:** ``0.9``
687-
688-
.. option:: --alpha_decay <float>
689-
690-
The rate at which alpha will approach 1: alpha(n) = 1 - (1 - alpha(n-1)) * alpha_decay
691-
Ranges between 0 and 1.
692-
Setting this flag selects Dusty's annealing schedule.
693-
694-
**Default:** ``0.7``
695-
696-
.. option:: --anneal_success_min <float>
697-
698-
The minimum success ratio after which the temperature will reset to maintain the target success ratio.
699-
Ranges between 0 and anneal_success_target.
700-
Setting this flag selects Dusty's annealing schedule.
701-
702-
**Default:** ``0.1``
703-
704-
.. option:: --anneal_success_target <float>
705-
706-
The temperature after each reset is selected to keep this target success ratio.
707-
Ranges between anneal_success_target and 1.
708-
Setting this flag selects Dusty's annealing schedule.
709-
710-
**Default:** ``0.25``
711-
712672
.. option:: --fix_pins {free | random | <file.pads>}
713673

714674
Controls how the placer handles I/O pads during placement.
@@ -746,6 +706,44 @@ If any of init_t, exit_t or alpha_t is specified, the user schedule, with a fixe
746706

747707
**Default:** ``0.0``
748708

709+
.. _dusty_sa_options:
710+
Setting any of the following options selects `Dusty's annealing schedule <dusty_sa.rst>`_.
711+
712+
.. option:: --alpha_min <float>
713+
714+
The minimum (starting) update factor (alpha) used.
715+
Ranges between 0 and alpha_max.
716+
717+
**Default:** ``0.2``
718+
719+
.. option:: --alpha_max <float>
720+
721+
The maximum (stopping) update factor (alpha) used after which simulated annealing will complete.
722+
Ranges between alpha_min and 1.
723+
724+
**Default:** ``0.9``
725+
726+
.. option:: --alpha_decay <float>
727+
728+
The rate at which alpha will approach 1: alpha(n) = 1 - (1 - alpha(n-1)) * alpha_decay
729+
Ranges between 0 and 1.
730+
731+
**Default:** ``0.7``
732+
733+
.. option:: --anneal_success_min <float>
734+
735+
The minimum success ratio after which the temperature will reset to maintain the target success ratio.
736+
Ranges between 0 and anneal_success_target.
737+
738+
**Default:** ``0.1``
739+
740+
.. option:: --anneal_success_target <float>
741+
742+
The temperature after each reset is selected to keep this target success ratio.
743+
Ranges between anneal_success_target and 1.
744+
745+
**Default:** ``0.25``
746+
749747
.. _timing_driven_placer_options:
750748

751749
Timing-Driven Placer Options

doc/src/vpr/dusty_sa.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Dusty's Simulated Annealing Schedule
2+
====================================
3+
4+
This simulated annealing schedule is designed to quickly characterize the search space and maintain a target success ratio (accepted moves.)
5+
6+
It starts at the minimum alpha (``--alpha_min``) to allow it to quickly find the target.
7+
8+
For each alpha, the temperature decays by a factor of alpha after each outer loop iteration.
9+
10+
The temperature before which the success ratio drops below the target (``--anneal_success_target``) is recorded; after hitting the minimum success ratio (``--anneal_success_min``), the temperature resets to a little before recorded temperature, and alpha parameter itself decays according to ``--alpha_decay``.
11+
12+
The effect of this is many fast, but slowing sweeps in temperature, focused where they can make the most effective progress. Unlike fixed and adaptive schedules that monotonically decrease temperature, this allows the global properties of the search space to affect the schedule.
13+
14+
In addition, move_lim (which controls the number of iterations in the inner loop) is scaled with the target success ratio over the current success ratio, which reduces the time to reach the target ratio.
15+
16+
The schedule terminates when the maximum alpha is reached. Termination is ensured by the narrowing range between the recorded upper temperature and the minimum success ratio, which will eventually cause alpha to reach its minimum.
17+
18+
This algorithm was inspired by Lester Ingber's adaptive simulated annealing algorithm [ASA93]_.
19+
20+
See ``update_state()`` in ``place.cpp`` for the algorithm details.
21+
22+
.. [ASA93] Ingber, Lester. "Adaptive simulated annealing (ASA)." Global optimization C-code, Caltech Alumni Association, Pasadena, CA (1993).

vpr/src/base/read_options.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,19 +2072,19 @@ void set_conditional_defaults(t_options& args) {
20722072
args.ShowPlaceTiming.set(args.timing_analysis, Provenance::INFERRED);
20732073
}
20742074

2075-
//Are we using the automatic, or user-specified annealing schedule?
2076-
if (args.PlaceAlphaMin.provenance() == Provenance::SPECIFIED
2075+
//Which schedule?
2076+
if (args.PlaceAlphaMin.provenance() == Provenance::SPECIFIED // Any of these flags select Dusty's schedule
20772077
|| args.PlaceAlphaMax.provenance() == Provenance::SPECIFIED
20782078
|| args.PlaceAlphaDecay.provenance() == Provenance::SPECIFIED
20792079
|| args.PlaceSuccessMin.provenance() == Provenance::SPECIFIED
20802080
|| args.PlaceSuccessTarget.provenance() == Provenance::SPECIFIED) {
20812081
args.anneal_sched_type.set(DUSTY_SCHED, Provenance::INFERRED);
2082-
} else if (args.PlaceInitT.provenance() == Provenance::SPECIFIED
2082+
} else if (args.PlaceInitT.provenance() == Provenance::SPECIFIED // Any of these flags select a manual schedule
20832083
|| args.PlaceExitT.provenance() == Provenance::SPECIFIED
20842084
|| args.PlaceAlphaT.provenance() == Provenance::SPECIFIED) {
20852085
args.anneal_sched_type.set(USER_SCHED, Provenance::INFERRED);
20862086
} else {
2087-
args.anneal_sched_type.set(AUTO_SCHED, Provenance::INFERRED);
2087+
args.anneal_sched_type.set(AUTO_SCHED, Provenance::INFERRED); // Otherwise use the automatic schedule
20882088
}
20892089

20902090
//Are the pad locations specified?

vpr/src/place/place.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ using std::min;
5656
* cost computation. 0.01 means that there is a 1% error tolerance. */
5757
#define ERROR_TOL .01
5858

59+
/* The final rlim (range limit) is 1, which is the smallest value that can *
60+
* still make progress, since an rlim of 0 wouldn't allow any swaps. */
5961
#define FINAL_RLIM 1
6062

6163
/* This defines the maximum number of swap attempts before invoking the *
@@ -99,15 +101,16 @@ struct t_placer_prev_inverse_costs {
99101
double timing_cost;
100102
};
101103

104+
// Used by update_state()
102105
struct t_annealing_state {
103-
float t;
104-
float rlim;
105-
float inverse_delta_rlim;
106-
float alpha;
107-
float restart_t;
108-
float crit_exponent;
109-
int move_lim_max;
110-
int move_lim;
106+
float t; // Temperature
107+
float rlim; // Range limit for swaps
108+
float inverse_delta_rlim; // used to calculate crit_exponent
109+
float alpha; // Temperature decays by this factor each outer iteration
110+
float restart_t; // Temperature used after restart due to minimum success ratio
111+
float crit_exponent; // Used by timing-driven placement to "sharpen" timing criticality
112+
int move_lim_max; // Maximum move limit
113+
int move_lim; // Current move limit
111114
};
112115

113116
constexpr float INVALID_DELAY = std::numeric_limits<float>::quiet_NaN();

0 commit comments

Comments
 (0)