Skip to content

Commit 8250b76

Browse files
remove scaffolding, fix CI
1 parent 34b8e13 commit 8250b76

3 files changed

Lines changed: 16 additions & 53 deletions

File tree

vpr/src/analytical_place/global_placement/affinity_spring_term.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class AffinitySpringTerm final : public ObjectiveTerm {
5858
void add_curvature(vtr::vector<APBlockId, double>& diagonal) const final;
5959

6060
private:
61-
6261
std::vector<AffinityGroup> groups_;
6362
double pack_pattern_weight_ = 0.;
6463
vtr::vector<APBlockId, bool> moveable_; ///< Block mobility, precomputed (static per netlist).

vpr/src/analytical_place/global_placement/nonlinear_nesterov_placer.cpp

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <cctype>
1111
#include <cmath>
1212
#include <cstdio>
13-
#include <cstdlib>
1413
#include <functional>
1514
#include <limits>
1615
#include <map>
@@ -453,7 +452,6 @@ NonlinearNesterovPlacer::NonlinearNesterovPlacer(const APNetlist& ap_netlist,
453452
, atom_netlist_(atom_netlist)
454453
, pre_cluster_timing_manager_(pre_cluster_timing_manager)
455454
, place_delay_model_(place_delay_model)
456-
, models_(models)
457455
, net_weights_(ap_netlist.nets().size(), 1.0)
458456
, device_grid_width_(device_grid.width())
459457
, device_grid_height_(device_grid.height())
@@ -685,13 +683,7 @@ PartialPlacement NonlinearNesterovPlacer::place() {
685683
// Applying it and using a unit step are one regime, not two knobs: a
686684
// preconditioned gradient carries position units so its natural step is ~1,
687685
// while a raw gradient needs the span-scaled step.
688-
//
689-
// ABLATION GATE (temporary): VPR_ABL_PRECOND=always preconditions every design.
690-
const char* abl_precond = std::getenv("VPR_ABL_PRECOND");
691-
bool precond_always = abl_precond && std::string(abl_precond) == "always";
692-
if (precond_always)
693-
VTR_LOG("ABL: PRECOND=always (size gate bypassed; unit step everywhere).\n");
694-
large_design_ = precond_always || moveable_blocks_.size() >= kPreconditionSizeThreshold;
686+
large_design_ = moveable_blocks_.size() >= kPreconditionSizeThreshold;
695687

696688
return run_global_optimization_(density_dimensions, device_span, convergence_displacement);
697689
}
@@ -704,18 +696,7 @@ PartialPlacement NonlinearNesterovPlacer::run_global_optimization_(const std::ve
704696
if (log_verbosity_ >= 1)
705697
VTR_LOG("Nonlinear Nesterov phase time: warm start took %.2f seconds.\n", warmstart_timer.elapsed_sec());
706698
cohesion_->update_periphery_pair_nets(density_dimensions);
707-
// ABLATION GATE (temporary): VPR_ABL_PACKPAT=off disables chain springs
708-
// entirely; =ungated keeps them on regardless of the periphery-net gate.
709-
const char* abl_packpat = std::getenv("VPR_ABL_PACKPAT");
710-
bool abl_off = abl_packpat && std::string(abl_packpat) == "off";
711-
bool abl_ungated = abl_packpat && std::string(abl_packpat) == "ungated";
712-
if (abl_off) {
713-
VTR_LOG("ABL: PACKPAT=off (chain affinity springs disabled).\n");
714-
pack_pattern_cohesion_weight_ = 0.;
715-
affinity_term_->set_pack_pattern_weight(0.);
716-
} else if (abl_ungated) {
717-
VTR_LOG("ABL: PACKPAT=ungated (periphery gate bypassed).\n");
718-
} else if (pack_pattern_cohesion_weight_ > 0.
699+
if (pack_pattern_cohesion_weight_ > 0.
719700
&& cohesion_->num_periphery_pair_nets() == 0) {
720701
if (log_verbosity_ >= 1) {
721702
VTR_LOG("Nonlinear Nesterov pack-pattern affinity disabled: no two-pin periphery nets were found.\n");
@@ -786,8 +767,6 @@ PartialPlacement NonlinearNesterovPlacer::optimize_from_seed_(const PartialPlace
786767
num_epochs, iterations_per_epoch);
787768
}
788769

789-
// --- Ablation gates (env, default OFF -> bit-identical). Load-bearing campaign. ---
790-
791770
FillerState current_fillers;
792771
initialize_dynamic_fillers_(seed,
793772
density_dimensions,
@@ -887,8 +866,8 @@ PartialPlacement NonlinearNesterovPlacer::optimize_from_seed_(const PartialPlace
887866
kMaxNesterovIterations,
888867
num_epochs);
889868
auto apply_continuation_schedule = [&](double schedule) {
890-
// Ablation: fix gamma to a constant mid value (removes the coarse->sharp anneal); density
891-
// weight still follows the real schedule.
869+
// Anneal gamma geometrically from its coarse starting value to its sharp
870+
// final value while increasing the density weight on the same schedule.
892871
current_gamma_fraction_ = kGammaStartFraction
893872
* std::pow(kGammaEndFraction / kGammaStartFraction, schedule);
894873
double density_weight_scale = std::pow(kFinalDensityWeightMultiplier, schedule);
@@ -1994,19 +1973,6 @@ void NonlinearNesterovPlacer::initialize_dynamic_fillers_(const PartialPlacement
19941973
void NonlinearNesterovPlacer::compute_preconditioner_(const std::vector<PrimitiveVectorDim>& dimensions,
19951974
const std::vector<double>& density_multipliers) {
19961975
block_precond_.assign(ap_netlist_.blocks().size(), 0.0);
1997-
// ABLATION GATE (temporary): VPR_ABL_PRECOND_ALPHA overrides the softening
1998-
// exponent. kPreconditionAlpha = 0.5 has no board record; every published
1999-
// electrostatic placer uses 1.0. The exponent changes the SHAPE of the
2000-
// diagonal (the per-block ratios), which is the only property the
2001-
// Barzilai-Borwein secant cannot absorb by rescaling.
2002-
static const double precondition_alpha = [] {
2003-
const char* e = std::getenv("VPR_ABL_PRECOND_ALPHA");
2004-
double a = e ? std::atof(e) : kPreconditionAlpha;
2005-
if (e)
2006-
VTR_LOG("ABL: PRECOND_ALPHA=%g (default %g).\n", a, kPreconditionAlpha);
2007-
return a;
2008-
}();
2009-
20101976
// Wirelength Hessian diagonal. Under the B2B model this is exact: the
20111977
// quadratic's diagonal is the block's incident edge-weight sum (mean of
20121978
// the two axes, since the preconditioner is one scalar per block). Under
@@ -2052,7 +2018,7 @@ void NonlinearNesterovPlacer::compute_preconditioner_(const std::vector<Primitiv
20522018
block_precond_[blk_id] = jacobi_precond_diagonal(block_precond_[blk_id] + density_curvature,
20532019
0.,
20542020
kPreconditionFloor,
2055-
precondition_alpha);
2021+
kPreconditionAlpha);
20562022
}
20572023

20582024
filler_precond_.assign(dimensions.size(), kPreconditionFloor);
@@ -2062,7 +2028,7 @@ void NonlinearNesterovPlacer::compute_preconditioner_(const std::vector<Primitiv
20622028
filler_precond_[dim_idx] = jacobi_precond_diagonal(density_multipliers[dim_idx] * unit_mass,
20632029
0.,
20642030
kPreconditionFloor,
2065-
precondition_alpha);
2031+
kPreconditionAlpha);
20662032
}
20672033
}
20682034

vpr/src/analytical_place/global_placement/nonlinear_nesterov_placer.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -323,18 +323,16 @@ class NonlinearNesterovPlacer : public GlobalPlacer {
323323
const AtomNetlist& atom_netlist_; ///< Atom netlist used for timing criticality lookup.
324324
PreClusterTimingManager& pre_cluster_timing_manager_; ///< Timing manager used to weight differentiable wirelength nets.
325325
std::shared_ptr<PlaceDelayModel> place_delay_model_; ///< Delay model used to update timing criticalities.
326-
const LogicalModels& models_; ///< Logical models used to classify I/O-chain primitives.
327-
328-
std::vector<APBlockId> moveable_blocks_; ///< Movable AP blocks touched by the optimizer.
329-
vtr::vector<APNetId, double> net_weights_; ///< Per-net weight applied to the weighted-average (WA) wirelength term computed in add_wirelength_gradient_.
330-
vtr::vector<APBlockId, double> block_precond_; ///< Per-block diagonal preconditioner (objective curvature estimate).
331-
bool large_design_ = false; ///< Design is at or above @ref kPreconditionSizeThreshold: applies the Jacobi preconditioner and the unit step.
332-
vtr::vector<APBlockId, float> pin_density_inflation_; ///< Per-block density-term mass inflation from pin count (routability cell inflation); 1.0 for blocks at or below the reference pin count.
333-
std::unique_ptr<NetCohesion> cohesion_; ///< Periphery-pair net detection (gates pack-pattern affinity).
334-
std::unique_ptr<AffinitySpringTerm> affinity_term_; ///< Affinity-spring objective term (groups + energy/gradient/curvature).
335-
size_t num_pack_pattern_affinity_groups_ = 0; ///< Count of PACK_PATTERN affinity groups.
336-
std::vector<double> filler_unit_mass_; ///< [dim] density mass per dynamic filler.
337-
std::vector<double> filler_precond_; ///< [dim] density-only filler preconditioner.
326+
std::vector<APBlockId> moveable_blocks_; ///< Movable AP blocks touched by the optimizer.
327+
vtr::vector<APNetId, double> net_weights_; ///< Per-net weight applied to the weighted-average (WA) wirelength term computed in add_wirelength_gradient_.
328+
vtr::vector<APBlockId, double> block_precond_; ///< Per-block diagonal preconditioner (objective curvature estimate).
329+
bool large_design_ = false; ///< Design is at or above @ref kPreconditionSizeThreshold: applies the Jacobi preconditioner and the unit step.
330+
vtr::vector<APBlockId, float> pin_density_inflation_; ///< Per-block density-term mass inflation from pin count (routability cell inflation); 1.0 for blocks at or below the reference pin count.
331+
std::unique_ptr<NetCohesion> cohesion_; ///< Periphery-pair net detection (gates pack-pattern affinity).
332+
std::unique_ptr<AffinitySpringTerm> affinity_term_; ///< Affinity-spring objective term (groups + energy/gradient/curvature).
333+
size_t num_pack_pattern_affinity_groups_ = 0; ///< Count of PACK_PATTERN affinity groups.
334+
std::vector<double> filler_unit_mass_; ///< [dim] density mass per dynamic filler.
335+
std::vector<double> filler_precond_; ///< [dim] density-only filler preconditioner.
338336
// Placement-invariant density-grid constants, cached once (device grid,
339337
// bin capacity, and target density are fixed across the optimization) and
340338
// reused across every objective evaluation instead of being rebuilt.

0 commit comments

Comments
 (0)