Struct CostParams

Struct Documentation

struct CostParams

Cost-model tuning knobs consumed by opt::single_term_opt and forwarded to the objective models. Bundled so callers (and sequant::optimize via OptimizeOptions) pass one object rather than five positional arguments. All have neutral defaults: an empty is_volatile_leaf disables replay weighting, and roofline.machine_balance == 0 keeps the pure-flop tie-break.

Public Members

std::function<bool(Tensor const&)> is_volatile_leaf = {}

Marks a LEAF tensor as volatile (amplitude-dependent), so the contraction forming any subset that contains it is replayed every iteration. Empty => nothing volatile (replay weighting off).

double volatile_weight = 1.0

Replay weight on volatile contractions (conceptually the replay count).

double footprint_weight = 0.0

Per-intermediate storage-footprint penalty (DenseFLOPs/DenseSize only; see OptimizeOptions::footprint_weight). Not used by the peak objectives.

double peak_flops_tolerance = 0.10

Relative peak tolerance for the peak objectives’ final selection; see OptimizeOptions::peak_flops_tolerance.

RooflineParams roofline = {}

Roofline parameters for the peak objectives’ secondary cost; see RooflineParams. machine_balance == 0 => pure-flop tie-break.

double accumulation_factor = 0.0

In-flight batch-contribution footprint multiplier for DensePeakSizeBatched; see BatchPolicy::accumulation_factor. 0 (default) = no penalty.

bool prune_outer_products = true

Prune disconnected (outer-product) subsets from the single-term DP; see OptimizeOptions::prune_outer_products. true (default) = prune.