| 801 | } |
| 802 | |
| 803 | StatusOr<std::unique_ptr<Executable>> Service::BuildExecutable( |
| 804 | const HloModuleProto& module_proto, |
| 805 | std::unique_ptr<HloModuleConfig> module_config, Backend* backend, |
| 806 | se::StreamExecutor* executor, se::DeviceMemoryAllocator* device_allocator) { |
| 807 | VLOG(1) << StrFormat( |
| 808 | "BuildExecutable on service %p with serialized module proto: %s", this, |
| 809 | module_proto.name()); |
| 810 | |
| 811 | TF_ASSIGN_OR_RETURN(std::unique_ptr<HloModule> module, |
| 812 | CreateModuleFromProto(module_proto, *module_config)); |
| 813 | DumpHloModuleIfEnabled(*module, kBeforeOptimizationsDumpName); |
| 814 | |
| 815 | TF_ASSIGN_OR_RETURN( |
| 816 | module, backend->compiler()->RunHloPasses(std::move(module), executor, |
| 817 | device_allocator)); |
| 818 | |
| 819 | TF_ASSIGN_OR_RETURN(std::unique_ptr<Executable> executable, |
| 820 | backend->compiler()->RunBackend( |
| 821 | std::move(module), executor, device_allocator)); |
| 822 | |
| 823 | const auto& debug_opts = module_config->debug_options(); |
| 824 | if (DumpingEnabledForHloModule(module_proto.name(), debug_opts) && |
| 825 | debug_opts.xla_dump_hlo_snapshots()) { |
| 826 | auto hlo_proto = absl::make_unique<HloProto>(); |
| 827 | *hlo_proto->mutable_hlo_module() = module_proto; |
| 828 | executable->set_hlo_proto(std::move(hlo_proto)); |
| 829 | } |
| 830 | |
| 831 | return std::move(executable); |
| 832 | } |
| 833 | |
| 834 | Status Service::Compile(const CompileRequest* arg, CompileResponse* result) { |
| 835 | VLOG(1) << "running compile request"; |
nothing calls this directly
no test coverage detected