Enum ObjectiveFunction

Enum Documentation

enum class sequant::ObjectiveFunction

Objective function to minimize in single-term and top-level optimize routines. The Dense* models assume dense tensors:

  • DenseFLOPs (the default) counts floating-point operations, the metric used throughout the contraction-ordering literature.

  • DenseTimeSpace is the objective intended for production. It is perf-first, peak-second: it minimizes a performance cost – the flop count, or the roofline wall-time proxy when RooflineParams is set – and breaks ties by 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). Does not support common-subexpression elimination (CSEOptions::subnet must be false).

  • DenseTimeSpaceBatched extends DenseTimeSpace with a per-index batchability model: each index satisfying OptimizeOptions::batch_policy.is_batchable_index() (the derived union of the contracted- and external-role building blocks) may be sliced to min(extent, batch_policy.batch_target_size(ix)) elements – batch_target_size is 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 (see mode_batches_of_trange1). Requires a batchability role predicate (batch_policy.is_batchable_contracted_index and/or is_batchable_external_index) and batch_policy.batch_target_size to be set. Because slicing is perf-neutral, the perf-first primary never prefers a flops-catastrophic factorization merely for its sliceability.

    peak_threshold is a feasibility ceiling: among the schedules that fit the budget the fewest flops win, ties broken toward the least-sliced realization (nsl) and then lower peak, so nothing is sliced for free below the ceiling. When no schedule fits, the fallback stays perf-first: global min flops, ties by min peak. peak_threshold is also the switch that turns batching on at all: PeakBatchedModel::relax opens neither a contracted nor an external loop unless std::isfinite(peak_threshold). External opens are emitted per node, gated by exactly batch_policy.batch_spectator_indices && std::isfinite(peak_threshold), with no post-DP external placement pass.

  • DenseSize, DenseSpaceTime and DenseSpaceTimeBatched (and the DensePeakSize/DensePeakSizeBatched spellings) are deprecated.

Naming: Dense{Primary}{Secondary}, Space = peak/size, Time = perf.

Leaves room for Sparse* models later.

Values:

enumerator DenseFLOPs

Floating-point operation count (the default).

enumerator DenseSize

Deprecated:

Use DenseTimeSpace. Result-tensor storage elements summed over intermediates – a gross-traffic proxy, not a peak.

enumerator DenseSpaceTime

Deprecated:

Use DenseTimeSpace. Peak-first, perf-second; can prefer a flops-catastrophic factorization for a lower peak.

enumerator DenseSpaceTimeBatched

Deprecated:

Use DenseTimeSpaceBatched. Batched variant of DenseSpaceTime.

enumerator DenseTimeSpace

Perf-first, peak-second; the objective intended for production.

enumerator DenseTimeSpaceBatched

Batched variant of DenseTimeSpace.

enumerator DensePeakSize

Deprecated:

Old spelling of DenseSpaceTime, sharing its value so that code and JSON inputs spelling it (“dense_peak_size”) keep working: a == DensePeakSize guard catches DenseSpaceTime.

enumerator DensePeakSizeBatched

Deprecated:

Old spelling of DenseSpaceTimeBatched.