MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BuildExecutable

Method BuildExecutable

tensorflow/compiler/xla/service/service.cc:803–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803StatusOr<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
834Status Service::Compile(const CompileRequest* arg, CompileResponse* result) {
835 VLOG(1) << "running compile request";

Callers

nothing calls this directly

Calls 9

CreateModuleFromProtoFunction · 0.85
DumpHloModuleIfEnabledFunction · 0.85
set_hlo_protoMethod · 0.80
TF_ASSIGN_OR_RETURNFunction · 0.70
nameMethod · 0.65
RunHloPassesMethod · 0.45
compilerMethod · 0.45
RunBackendMethod · 0.45

Tested by

no test coverage detected