aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/plugin
diff options
context:
space:
mode:
authorGravatar Bjarke Hammersholt Roune <broune@google.com>2017-07-31 18:48:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-07-31 18:52:42 -0700
commitb882d686ff00f73425a846c47e29a7c336435f25 (patch)
tree65ce9501716aac37d9bb26bc58960ed64b19b4ef /tensorflow/compiler/plugin
parent14b73676136f6044ae372513e56189b5528a3b6e (diff)
Allow cost estimates to differ per backend and include the estimates into the HLO profile. Add a summary table for what categories have the most opportunity for optimization left in them.
PiperOrigin-RevId: 163780413
Diffstat (limited to 'tensorflow/compiler/plugin')
-rw-r--r--tensorflow/compiler/plugin/executor/executable.cc7
-rw-r--r--tensorflow/compiler/plugin/executor/executable.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/tensorflow/compiler/plugin/executor/executable.cc b/tensorflow/compiler/plugin/executor/executable.cc
index 484465210b..e866dfef05 100644
--- a/tensorflow/compiler/plugin/executor/executable.cc
+++ b/tensorflow/compiler/plugin/executor/executable.cc
@@ -26,7 +26,7 @@ namespace se = ::perftools::gputools;
namespace sep = ::perftools::gputools::executorplugin;
ExecutorExecutable::ExecutorExecutable(std::unique_ptr<HloModule> hlo_module)
- : Executable(std::move(hlo_module), ShapeSizeBytes) {}
+ : Executable(std::move(hlo_module)) {}
ExecutorExecutable::~ExecutorExecutable() {}
@@ -140,5 +140,10 @@ StatusOr<se::DeviceMemoryBase> ExecutorExecutable::ExecuteAsyncOnStream(
return ShapeUtil::ByteSizeOf(shape, sizeof(void*));
}
+std::unique_ptr<HloCostAnalysis> ExecutorExecutable::CreateCostAnalysis()
+ const {
+ return MakeUnique<HloCostAnalysis>(ShapeSizeBytes);
+}
+
} // namespace executorplugin
} // namespace xla
diff --git a/tensorflow/compiler/plugin/executor/executable.h b/tensorflow/compiler/plugin/executor/executable.h
index ba3d4da21d..8572aba43d 100644
--- a/tensorflow/compiler/plugin/executor/executable.h
+++ b/tensorflow/compiler/plugin/executor/executable.h
@@ -55,6 +55,8 @@ class ExecutorExecutable : public Executable {
static int64 ShapeSizeBytes(const Shape& shape);
+ std::unique_ptr<HloCostAnalysis> CreateCostAnalysis() const override;
+
private:
TF_DISALLOW_COPY_AND_ASSIGN(ExecutorExecutable);
};