Estimation
Interface
The interface that has to be implemented for an estimator.
ComputableDAGs.AbstractEstimator
— TypeAbstractEstimator
Abstract base type for an estimator. An estimator estimates the cost of a graph or the difference an operation applied to a graph will make to its cost.
Interface functions are
ComputableDAGs.cost_type
— Functioncost_type(estimator::AbstractEstimator)
Interface function returning a specific estimator's cost type, i.e., the type returned by its implementation of graph_cost
and operation_effect
.
ComputableDAGs.graph_cost
— Functiongraph_cost(estimator::AbstractEstimator, graph::DAG)
Get the total estimated cost of the graph. The cost's data type can be chosen by the implementation, but must have a usable lessthan comparison operator (<), basic math operators (+, -) and an implementation of zero()
and typemax()
.
ComputableDAGs.operation_effect
— Methodoperation_effect(estimator::AbstractEstimator, graph::DAG, operation::Operation)
Get the estimated effect on the cost of the graph, such that graph_cost(estimator, graph) + operation_effect(estimator, graph, operation) ~= graph_cost(estimator, graph_with_operation_applied)
. There is no hard requirement for this, but the better the estimate, the better an optimization algorithm will be.
There is a default implementation of this function, applying the operation, calling graph_cost
, then popping the operation again.
It can be much faster to overload this function for a specific estimator and directly compute the effects from the operation if possible.
Global Metric Estimator
Implementation of a global metric estimator. It uses the graph properties compute effort, data transfer, and compute intensity.
ComputableDAGs.CDCost
— TypeCDCost
Representation of a DAG
's cost as estimated by the GlobalMetricEstimator
.
Fields:
.data
: The total data transfer..computeEffort
: The total compute effort..computeIntensity
: The compute intensity, will always equal .computeEffort / .data
.
Note that the computeIntensity
doesn't necessarily make sense in the context of only operation costs. It will still work as intended when adding/subtracting to/from a graph_cost
estimate.
ComputableDAGs.GlobalMetricEstimator
— TypeGlobalMetricEstimator <: AbstractEstimator
A simple estimator that adds up each node's set compute_effort
and data
.