aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/costs/cost_estimator.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <bsteiner@google.com>2018-01-26 14:02:33 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-26 14:06:25 -0800
commitea25bf9558a79747d82220e493d4347901853976 (patch)
treeeda168812562c1233f7e939d113d03bad94fff16 /tensorflow/core/grappler/costs/cost_estimator.h
parent1bd5b2e6fada5334b04e2db87cf246d1a83fa533 (diff)
Add op level memory usage estimation to the op_level_cost_estimator
PiperOrigin-RevId: 183441321
Diffstat (limited to 'tensorflow/core/grappler/costs/cost_estimator.h')
-rw-r--r--tensorflow/core/grappler/costs/cost_estimator.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/core/grappler/costs/cost_estimator.h b/tensorflow/core/grappler/costs/cost_estimator.h
index d442861339..9e01ec5ff5 100644
--- a/tensorflow/core/grappler/costs/cost_estimator.h
+++ b/tensorflow/core/grappler/costs/cost_estimator.h
@@ -100,6 +100,8 @@ struct Costs {
// requirements of a graph. For example, it might assume that all activations
// are live for all of a graph's execution.
int64 max_memory; // Maximum main memory requirement in bytes over all ops.
+ int64 persistent_memory;
+ int64 temporary_memory;
// These fields are used for TPU-related estimations. They are per-op
// maximums, so each op is evaluated independently, but we want the maximum of
@@ -132,6 +134,8 @@ Costs::Costs() {
compute_time = Duration::zero();
memory_time = Duration::zero();
max_memory = kMemoryUnknown;
+ persistent_memory = kMemoryUnknown;
+ temporary_memory = kMemoryUnknown;
max_per_op_buffers = kMemoryUnknown;
max_per_op_streaming = kMemoryUnknown;
}
@@ -142,6 +146,8 @@ Costs Costs::ZeroCosts() {
costs.compute_time = Duration::zero();
costs.memory_time = Duration::zero();
costs.max_memory = kZeroMemory;
+ costs.persistent_memory = kZeroMemory;
+ costs.temporary_memory = kZeroMemory;
costs.max_per_op_buffers = kZeroMemory;
costs.max_per_op_streaming = kZeroMemory;
return costs;