Enum ObjectiveFunction¶
Defined in File options.hpp
Enum Documentation¶
-
enum class sequant::ObjectiveFunction¶
Objective function to minimize in single-term and top-level optimize routines. The
Dense*models assume dense tensors:DenseFLOPscounts floating-point operations.DenseSizecounts result-tensor storage elements (summed over intermediates) — a gross-traffic proxy, not a peak.DenseSpaceTime(also spelledDensePeakSize, a deprecated alias) is peak-first, perf-second: it minimizes peak memory — the maximum over the evaluation schedule of the combined size of all simultaneously-live tensors (intermediates and resident input leaves, the all-co-resident model) — and breaks ties by the roofline perf cost. Unlike the order-independentDenseFLOPs/DenseSize, the contraction order is a real lever here. Note: does not yet support common-subexpression elimination (CSEOptions::subnetmust be false).DenseSpaceTimeBatched(deprecated aliasDensePeakSizeBatched) extendsDenseSpaceTimewith a per-index batchability model: each index satisfyingOptimizeOptions::batch_policy.is_batchable_index()(the derived union of the contracted- and external-role building blocks) is treated as independently sliced tomin(extent, batch_policy.batch_target_size(ix))elements per index —batch_target_sizeis an upper bound, so this is a conservative (over-)estimate of the realized whole-tile batch, which the backend rounds down to a tile multiple (never above the target; seemode_batches_of_trange1). The DP minimises peak over the worst-case sliced configuration. Only consulted by the batched oracle and DP; requires a batchability role predicate (batch_policy.is_batchable_contracted_indexand/oris_batchable_external_index) andbatch_policy.batch_target_sizeto be set. Final selection is ceiling-gated bypeak_threshold, which must be finite for any loop to be opened at all.DenseTimeSpace/DenseTimeSpaceBatchedare the perf-first, peak-second duals ofDenseSpaceTime/DenseSpaceTimeBatched: they select a factorization by roofline perf first and peak second (same Pareto-frontier and roofline machinery, opposite lexicographic order). Because slicing is perf-neutral, a perf-first primary never prefers a flops-catastrophic factorization merely for its sliceability. Naming:Dense{Primary}{Secondary},Space= peak/size,Time= perf.peak_thresholdand these objectives: it is a feasibility ceiling on the perf-first branch ofselect_roottoo — among the frontier points that fit the budget it takes the fewest flops, ties broken toward the least-sliced realization (nsl) and then lower peak, so nothing is sliced for free below the ceiling. When no point fits, the fallback stays perf-first: global min flops, ties by min peak. It cannot force a flops-catastrophic factorization the way the space-first branch can.peak_thresholdis also the switch that turns batching on at all:PeakBatchedModel::relaxopens neither a contracted nor an external loop unlessstd::isfinite(peak_threshold). External opens are emitted per node, gated by exactlybatch_policy.batch_spectator_indices && std::isfinite(peak_threshold)— under both batched objectives, with no objective condition and no post-DP external placement pass.
Leaves room for
Sparse*models later.Values:
-
enumerator DenseFLOPs¶
-
enumerator DenseSize¶
-
enumerator DenseSpaceTime¶
Peak-first, perf-second. Deprecated alias:
DensePeakSize.
-
enumerator DenseSpaceTimeBatched¶
Batched variant of
DenseSpaceTime. Deprecated alias:DensePeakSizeBatched.
-
enumerator DenseTimeSpace¶
Perf-first, peak-second: never prefers a flops-catastrophic factorization for its sliceability.
-
enumerator DenseTimeSpaceBatched¶
Batched variant of
DenseTimeSpace.
-
enumerator DensePeakSize¶
Deprecated aliases, sharing the underlying values of the constants above so that code and JSON inputs spelling them (“dense_peak_size”) keep working: a
== DensePeakSizeguard catchesDenseSpaceTime.
-
enumerator DensePeakSizeBatched¶