diff options
author | Peter Ma <pcma@google.com> | 2018-08-10 15:03:22 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-10 15:13:09 -0700 |
commit | 2625345c727b14f8e770d4f980fe86e9ccc8b03d (patch) | |
tree | ba456d8a49c073e56c8f78d26bc17f413937fff0 /tensorflow/core/grappler/costs/virtual_scheduler.cc | |
parent | 83a1435684149e381521de528c3af40daa784570 (diff) |
Add two counters in Costs Struct for number of ops processed/predicted in total, and number of ops predicted with unknown shapes
PiperOrigin-RevId: 208274158
Diffstat (limited to 'tensorflow/core/grappler/costs/virtual_scheduler.cc')
-rw-r--r-- | tensorflow/core/grappler/costs/virtual_scheduler.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tensorflow/core/grappler/costs/virtual_scheduler.cc b/tensorflow/core/grappler/costs/virtual_scheduler.cc index f31d22e105..6e3ebdee12 100644 --- a/tensorflow/core/grappler/costs/virtual_scheduler.cc +++ b/tensorflow/core/grappler/costs/virtual_scheduler.cc @@ -47,9 +47,11 @@ Costs CombineCosts(const Costs& left, const Costs& right) { result.execution_time += right.execution_time; result.compute_time += right.compute_time; result.memory_time += right.memory_time; - if (right.inaccurate) { - result.inaccurate = true; - } + + result.num_ops_total += right.num_ops_total; + if (right.inaccurate) result.inaccurate = true; + result.num_ops_with_unknown_shapes += right.num_ops_with_unknown_shapes; + if (right.max_memory != kMemoryUnknown) { result.max_memory += right.max_memory; } @@ -283,6 +285,7 @@ VirtualScheduler::VirtualScheduler(const GrapplerItem* grappler_item, grappler_item_(grappler_item), use_static_shapes_(use_static_shapes), placer_(cluster) { + graph_costs_.num_ops_total = 0; initialized_ = false; } @@ -845,6 +848,11 @@ bool VirtualScheduler::MarkCurrNodeExecuted(const Costs& node_costs) { } Costs VirtualScheduler::Summary() const { + // Overall statement about accuracy + VLOG(1) << graph_costs_.num_ops_total << " ops processed in total, with " + << graph_costs_.num_ops_with_unknown_shapes + << " having unknown shapes"; + // Print out basic execution summary. VLOG(1) << "Expected execution time: " << graph_costs_.execution_time.count(); VLOG(1) << "Expected compute time: " << graph_costs_.compute_time.count(); @@ -906,6 +914,12 @@ Costs VirtualScheduler::Summary() const { << ", at the end: " << strings::HumanReadableNumBytes(state.memory_usage); + // Overall statement about accuracy + VLOG(1) << state.device_costs.num_ops_total + << " ops processed in total, with " + << state.device_costs.num_ops_with_unknown_shapes + << " having unknown shapes"; + VLOG(1) << "Per-op execution time / compute time / memory time " "(and memory usage at peak memory usage):"; |