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 counts floating-point operations.

  • DenseSize counts result-tensor storage elements (summed over intermediates) — a gross-traffic proxy, not a peak.

  • DensePeakSize 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 it chooses the evaluation order that minimizes that peak. Unlike the order-independent DenseFLOPs/DenseSize, the contraction order is a real lever here. NOTE: DensePeakSize does not yet support common-subexpression elimination (CSEOptions::subnet must be false).

  • DensePeakSizeBatched extends DensePeakSize with a per-index batchability model: each index satisfying OptimizeOptions::batch_policy.is_batchable_index is treated as independently sliced to min(extent, batch_policy.batch_target_size(ix)) elements per index — 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 (never above the target; see mode_batches_of_trange1). The DP minimises peak over the worst-case sliced configuration. Only consulted by the batched oracle and DP; requires batch_policy.is_batchable_index and batch_policy.batch_target_size to be set.

Leaves room for Sparse* models later.

Values:

enumerator DenseFLOPs
enumerator DenseSize
enumerator DensePeakSize
enumerator DensePeakSizeBatched