diff options
author | Asim Shankar <ashankar@google.com> | 2017-01-30 21:09:16 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-30 21:34:48 -0800 |
commit | 8691453b900aef43bf4a3966a5a96b14fbb7bfc3 (patch) | |
tree | 50f653d76cda5ca6d1daaa258ed39f52bcd5c571 /tensorflow/core/util/stat_summarizer.h | |
parent | 643fc7712fcedd1252eae855e4e89fc642cf0426 (diff) |
StatSummarizer: Make it work without needing the GraphDef.
This will allow the StatSummarizer to be instantiated and used
even when the GraphDef is not easily accessible. A consequence of
this is that the BY_DEFINITION_ORDER ordering of stats is no
longer available, but that was deemed acceptable for this change.
Other notables:
- Added a basic C++ unittest for stat_summarizer.
- Added some commentary about caveats about summaries over runs
that involve GPUs or partitioned graphs. These caveats existed
in the prior implementation as well.
Change: 146076563
Diffstat (limited to 'tensorflow/core/util/stat_summarizer.h')
-rw-r--r-- | tensorflow/core/util/stat_summarizer.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tensorflow/core/util/stat_summarizer.h b/tensorflow/core/util/stat_summarizer.h index 4568fa420b..248266e6d4 100644 --- a/tensorflow/core/util/stat_summarizer.h +++ b/tensorflow/core/util/stat_summarizer.h @@ -131,22 +131,31 @@ class StatSummarizerOptions { bool show_summary; }; -// A class intended to make performance analysis easier by collecting StepStats -// and showing in an easily understandable format where CPU time is being spent. -// See tensorflow/examples/android/jni/tensorflow_jni.cc for an example usage. +// A StatSummarizer assists in performance analysis of Graph executions. +// +// It summarizes time spent executing (on GPU/CPU), memory used etc. across +// multiple executions of a single Graph from the StepStats collected during +// graph execution. +// +// See tensorflow/tools/benchmark/benchmark_model.cc for an example usage. class StatSummarizer { public: enum SortingMetric { BY_NAME, - BY_DEFINITION_ORDER, BY_RUN_ORDER, BY_TIME, BY_MEMORY, BY_TYPE, }; + explicit StatSummarizer(const StatSummarizerOptions& options); + + // Deprecated: Use StatSummarizer(const StatSummarizerOptions&) instead. The + // GraphDef is not needed by the StatSummarizer. explicit StatSummarizer(const tensorflow::GraphDef& tensorflow_graph); + // Deprecated: Use StatSummarizer(const StatSummarizerOptions&) instead. The + // GraphDef is not needed by the StatSummarizer. StatSummarizer(const tensorflow::GraphDef& tensorflow_graph, const StatSummarizerOptions& options); @@ -207,9 +216,7 @@ class StatSummarizer { Stat<int64> run_total_us_; Stat<int64> memory_; - std::vector<string> nodes_in_def_order_; std::map<std::string, Detail> details_; - std::map<string, string> node_types_; StatSummarizerOptions options_; }; |