aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/costs/op_level_cost_estimator.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-04-06 11:16:17 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-06 11:18:52 -0700
commit6e8008294b6ed502123feadca93a2968f76b94a8 (patch)
treef180ffb29d998a582cefcdb2f0f2ef354487758c /tensorflow/core/grappler/costs/op_level_cost_estimator.h
parent711e2f503039bd8a277928ef8a2b3740ae2bfa4b (diff)
TPU Cost Estimator has been modified to also account for the memory cost in the execution time. Until more sophisticated methods are added, we resort to the roofline model to calculate such cost.
PiperOrigin-RevId: 191913626
Diffstat (limited to 'tensorflow/core/grappler/costs/op_level_cost_estimator.h')
-rw-r--r--tensorflow/core/grappler/costs/op_level_cost_estimator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/grappler/costs/op_level_cost_estimator.h b/tensorflow/core/grappler/costs/op_level_cost_estimator.h
index fcbecbb6dc..7080264698 100644
--- a/tensorflow/core/grappler/costs/op_level_cost_estimator.h
+++ b/tensorflow/core/grappler/costs/op_level_cost_estimator.h
@@ -173,6 +173,11 @@ class OpLevelCostEstimator {
const TensorShapeProto& original_image_shape, const OpInfo& op_info,
bool* found_unknown_shapes);
+ // This method calculates the execution time depending on whether IO can
+ // overlap with computation. It assumes the memory and the compute times have
+ // already been calculated.
+ void CombineCostsAndUpdateExecutionTime(Costs* costs) const;
+
protected:
std::map<string, int> elementwise_ops_;
typedef std::function<Costs(const OpContext& op_context)> CostImpl;