aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/clusters
diff options
context:
space:
mode:
authorGravatar Yuefeng Zhou <yuefengz@google.com>2017-12-05 16:03:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-12-05 16:07:07 -0800
commitd1906697d04092fedea4489f661380db52c37bab (patch)
tree83731b6a3dbcc11a6c9cb049d3005f3333a77e78 /tensorflow/core/grappler/clusters
parentb6ed812dbc87833a2f3076184cfe7d6fdbdba2fe (diff)
Add SaveRestoreMeasuringCostEstimator to measure the memory and runtime cost of a grappler item's save/restore subgraph.
PiperOrigin-RevId: 178025696
Diffstat (limited to 'tensorflow/core/grappler/clusters')
-rw-r--r--tensorflow/core/grappler/clusters/cluster.cc4
-rw-r--r--tensorflow/core/grappler/clusters/cluster.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/core/grappler/clusters/cluster.cc b/tensorflow/core/grappler/clusters/cluster.cc
index e2db47b758..01a618ed77 100644
--- a/tensorflow/core/grappler/clusters/cluster.cc
+++ b/tensorflow/core/grappler/clusters/cluster.cc
@@ -35,6 +35,10 @@ void Cluster::SetNumWarmupSteps(int num_steps) {
num_steps);
}
+int Cluster::NumWarmupSteps() const {
+ return options_.config.graph_options().build_cost_model_after();
+}
+
void Cluster::DisableDetailedStats(bool disable) {
if (disable) {
options_.config.mutable_graph_options()->set_build_cost_model(0);
diff --git a/tensorflow/core/grappler/clusters/cluster.h b/tensorflow/core/grappler/clusters/cluster.h
index 616ab6ffdc..d7af50f7dc 100644
--- a/tensorflow/core/grappler/clusters/cluster.h
+++ b/tensorflow/core/grappler/clusters/cluster.h
@@ -64,6 +64,9 @@ class Cluster {
// before Provision().
void SetNumWarmupSteps(int num_steps);
+ // Returns the number of warmup steps.
+ int NumWarmupSteps() const;
+
// Disable the collection of detailed statistics. Must be called
// before Provision().
void DisableDetailedStats(bool disable);