aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/interpreter
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-11-17 14:16:09 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-11-17 14:20:28 -0800
commit3f888e1539db5551cfcf9ee837a0555c224e0018 (patch)
tree5f2df45e666fc15e370e6c029bf0712ee65d53ed /tensorflow/compiler/xla/service/interpreter
parentd79dd4993061670c1ec5ea01db3022f28d72d0a3 (diff)
Add a Compiler::BuildExecutable interface that compiles the given Hlo module without optimizations.
PiperOrigin-RevId: 176158846
Diffstat (limited to 'tensorflow/compiler/xla/service/interpreter')
-rw-r--r--tensorflow/compiler/xla/service/interpreter/compiler.cc12
-rw-r--r--tensorflow/compiler/xla/service/interpreter/compiler.h8
2 files changed, 16 insertions, 4 deletions
diff --git a/tensorflow/compiler/xla/service/interpreter/compiler.cc b/tensorflow/compiler/xla/service/interpreter/compiler.cc
index 6d5796a24b..c9a5285a4f 100644
--- a/tensorflow/compiler/xla/service/interpreter/compiler.cc
+++ b/tensorflow/compiler/xla/service/interpreter/compiler.cc
@@ -69,11 +69,19 @@ Status InterpreterCompiler::RunHloOptimization(HloModule* hlo_module) {
return pipeline.Run(hlo_module).status();
}
-StatusOr<std::unique_ptr<Executable>> InterpreterCompiler::Compile(
+StatusOr<std::unique_ptr<HloModule>> InterpreterCompiler::RunHloPasses(
+ std::unique_ptr<HloModule> hlo_module,
+ se::StreamExecutor* /*stream_exec*/) {
+ VLOG(1) << "Run hlo passes on graph " << hlo_module->name();
+ TF_RETURN_IF_ERROR(RunHloOptimization(hlo_module.get()));
+ return std::move(hlo_module);
+}
+
+StatusOr<std::unique_ptr<Executable>> InterpreterCompiler::RunBackend(
std::unique_ptr<HloModule> hlo_module, se::StreamExecutor* stream_exec) {
TF_RET_CHECK(stream_exec != nullptr);
- VLOG(1) << "Generate graph " << hlo_module->name();
+ VLOG(1) << "Run backend " << hlo_module->name();
TF_RETURN_IF_ERROR(RunHloOptimization(hlo_module.get()));
diff --git a/tensorflow/compiler/xla/service/interpreter/compiler.h b/tensorflow/compiler/xla/service/interpreter/compiler.h
index cfdc9b6256..278cf51842 100644
--- a/tensorflow/compiler/xla/service/interpreter/compiler.h
+++ b/tensorflow/compiler/xla/service/interpreter/compiler.h
@@ -43,8 +43,12 @@ class InterpreterCompiler : public Compiler {
InterpreterCompiler() {}
~InterpreterCompiler() override {}
- StatusOr<std::unique_ptr<Executable>> Compile(
- std::unique_ptr<HloModule> hlo_modules,
+ StatusOr<std::unique_ptr<HloModule>> RunHloPasses(
+ std::unique_ptr<HloModule> hlo_module,
+ perftools::gputools::StreamExecutor* stream_exec) override;
+
+ StatusOr<std::unique_ptr<Executable>> RunBackend(
+ std::unique_ptr<HloModule> hlo_module,
perftools::gputools::StreamExecutor* stream_exec) override;
StatusOr<std::vector<std::unique_ptr<Executable>>> Compile(