diff options
Diffstat (limited to 'tensorflow/compiler/plugin')
6 files changed, 14 insertions, 25 deletions
diff --git a/tensorflow/compiler/plugin/example/compiler.cc b/tensorflow/compiler/plugin/example/compiler.cc index 562492be51..cd8a337a05 100644 --- a/tensorflow/compiler/plugin/example/compiler.cc +++ b/tensorflow/compiler/plugin/example/compiler.cc @@ -49,7 +49,6 @@ namespace exampleplugin { * contains useful optimization passes. */ Status ExampleCompiler::RunHloOptimization(HloModule* hlo_module, - HloModuleConfig* module_config, HloDumper dump_hlo) { HloPassPipeline pipeline("Example", dump_hlo); pipeline.AddPass<Inliner>(); @@ -68,15 +67,13 @@ Status ExampleCompiler::RunHloOptimization(HloModule* hlo_module, } StatusOr<std::unique_ptr<Executable>> ExampleCompiler::Compile( - std::unique_ptr<HloModule> hlo_module, - std::unique_ptr<HloModuleConfig> module_config, HloDumper dump_hlo, - se::StreamExecutor* stream_exec) { + std::unique_ptr<HloModule> hlo_module, HloDumper dump_hlo, + se::StreamExecutor* stream_exec) { TF_RET_CHECK(stream_exec != nullptr); VLOG(1) << "Generate graph " << hlo_module->name(); - TF_RETURN_IF_ERROR( - RunHloOptimization(hlo_module.get(), module_config.get(), dump_hlo)); + TF_RETURN_IF_ERROR(RunHloOptimization(hlo_module.get(), dump_hlo)); // Typically you would visit the HLO graph, building up a compiled equivalent // In this case we are using an Hlo evaluator at execution time, so we don't @@ -84,16 +81,15 @@ StatusOr<std::unique_ptr<Executable>> ExampleCompiler::Compile( // Create executable from only the Hlo module std::unique_ptr<Executable> executable; - executable.reset( - new ExampleExecutable(std::move(hlo_module), std::move(module_config))); + executable.reset(new ExampleExecutable(std::move(hlo_module))); return std::move(executable); } StatusOr<std::vector<std::unique_ptr<Executable>>> ExampleCompiler::Compile( - std::vector<std::unique_ptr<HloModule>> hlo_modules, - std::vector<std::unique_ptr<HloModuleConfig>> module_configs, - HloDumper dump_hlos, std::vector<se::StreamExecutor*> stream_execs) { + std::vector<std::unique_ptr<HloModule>> hlo_modules, + HloDumper dump_hlos, std::vector<se::StreamExecutor*> stream_execs) { + return tensorflow::errors::Unimplemented( "Compilation of multiple HLO modules is not supported on Example."); } @@ -101,9 +97,7 @@ StatusOr<std::vector<std::unique_ptr<Executable>>> ExampleCompiler::Compile( StatusOr<std::vector<std::unique_ptr<AotCompilationResult>>> ExampleCompiler::CompileAheadOfTime( std::vector<std::unique_ptr<HloModule>> hlo_modules, - std::vector<std::unique_ptr<HloModuleConfig>> module_configs, HloDumper dump_hlo, const AotCompilationOptions& aot_options) { - TF_RET_CHECK(hlo_modules.size() == module_configs.size()); return tensorflow::errors::InvalidArgument( "AOT compilation not supported on Example"); diff --git a/tensorflow/compiler/plugin/example/compiler.h b/tensorflow/compiler/plugin/example/compiler.h index f45aa7680e..bcc451bed5 100644 --- a/tensorflow/compiler/plugin/example/compiler.h +++ b/tensorflow/compiler/plugin/example/compiler.h @@ -35,19 +35,17 @@ class ExampleCompiler : public Compiler { StatusOr<std::unique_ptr<Executable>> Compile( std::unique_ptr<HloModule> hlo_module, - std::unique_ptr<HloModuleConfig> module_config, HloDumper dump_hlo, + HloDumper dump_hlo, perftools::gputools::StreamExecutor* stream_exec) override; StatusOr<std::vector<std::unique_ptr<Executable>>> Compile( std::vector<std::unique_ptr<HloModule>> hlo_module, - std::vector<std::unique_ptr<HloModuleConfig>> module_config, HloDumper dump_hlo, std::vector<perftools::gputools::StreamExecutor*> stream_exec) override; StatusOr<std::vector<std::unique_ptr<AotCompilationResult>>> CompileAheadOfTime( std::vector<std::unique_ptr<HloModule>> module, - std::vector<std::unique_ptr<HloModuleConfig>> module_config, HloDumper dump_hlo, const AotCompilationOptions& options) override; int64 ShapeSizeBytes(const Shape& shape) const override; @@ -55,8 +53,7 @@ class ExampleCompiler : public Compiler { perftools::gputools::Platform::Id PlatformId() const override; private: - Status RunHloOptimization(HloModule* hlo_module, - HloModuleConfig* module_config, HloDumper dump_hlo); + Status RunHloOptimization(HloModule* hlo_module, HloDumper dump_hlo); TF_DISALLOW_COPY_AND_ASSIGN(ExampleCompiler); }; diff --git a/tensorflow/compiler/plugin/example/executable.cc b/tensorflow/compiler/plugin/example/executable.cc index 6875323722..da01bd1a7a 100644 --- a/tensorflow/compiler/plugin/example/executable.cc +++ b/tensorflow/compiler/plugin/example/executable.cc @@ -27,10 +27,8 @@ namespace sep = ::perftools::gputools::exampleplugin; namespace xla { namespace exampleplugin { -ExampleExecutable::ExampleExecutable( - std::unique_ptr<HloModule> hlo_module, - std::unique_ptr<HloModuleConfig> module_config) - : Executable(std::move(hlo_module), std::move(module_config)) {} +ExampleExecutable::ExampleExecutable(std::unique_ptr<HloModule> hlo_module) + : Executable(std::move(hlo_module)) {} ExampleExecutable::~ExampleExecutable() {} diff --git a/tensorflow/compiler/plugin/example/executable.h b/tensorflow/compiler/plugin/example/executable.h index 99d2da77dd..e745b7ad11 100644 --- a/tensorflow/compiler/plugin/example/executable.h +++ b/tensorflow/compiler/plugin/example/executable.h @@ -37,8 +37,7 @@ namespace exampleplugin { class ExampleExecutable : public Executable { public: - ExampleExecutable(std::unique_ptr<HloModule> hlo_module, - std::unique_ptr<HloModuleConfig> module_config); + ExampleExecutable(std::unique_ptr<HloModule> hlo_module); ~ExampleExecutable() override; StatusOr<perftools::gputools::DeviceMemoryBase> ExecuteOnStream( diff --git a/tensorflow/compiler/plugin/example/transfer_manager.cc b/tensorflow/compiler/plugin/example/transfer_manager.cc index cef8a49e19..14cb00b971 100644 --- a/tensorflow/compiler/plugin/example/transfer_manager.cc +++ b/tensorflow/compiler/plugin/example/transfer_manager.cc @@ -31,6 +31,8 @@ limitations under the License. #include <utility> #include <vector> +namespace sep = ::perftools::gputools::exampleplugin; + namespace xla { namespace exampleplugin { diff --git a/tensorflow/compiler/plugin/example/transfer_manager.h b/tensorflow/compiler/plugin/example/transfer_manager.h index 0f7b81e613..3b6e0c6a42 100644 --- a/tensorflow/compiler/plugin/example/transfer_manager.h +++ b/tensorflow/compiler/plugin/example/transfer_manager.h @@ -29,7 +29,6 @@ limitations under the License. #include <vector> namespace se = ::perftools::gputools; -namespace sep = ::perftools::gputools::exampleplugin; namespace xla { namespace exampleplugin { |