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

Method Compile

tensorflow/compiler/xla/service/interpreter/compiler.cc:124–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124StatusOr<std::vector<std::unique_ptr<Executable>>> InterpreterCompiler::Compile(
125 std::unique_ptr<HloModuleGroup> module_group,
126 std::vector<std::vector<se::StreamExecutor*>> stream_exec,
127 se::DeviceMemoryAllocator* device_allocator) {
128 if (module_group->empty()) {
129 return std::vector<std::unique_ptr<Executable>>();
130 }
131 if (module_group->size() > 1) {
132 return tensorflow::errors::Unimplemented(
133 "Compilation of multiple HLO modules is not supported on Interpreter.");
134 }
135 if (stream_exec.size() != 1 || stream_exec[0].size() != 1) {
136 return tensorflow::errors::Unimplemented(
137 "Unexpected number of StreamExecutor's.");
138 }
139 auto hlo_modules = module_group->ConsumeModules();
140 TF_ASSIGN_OR_RETURN(auto module,
141 RunHloPasses(std::move(hlo_modules[0]), stream_exec[0][0],
142 device_allocator));
143 TF_ASSIGN_OR_RETURN(
144 auto executable,
145 RunBackend(std::move(module), stream_exec[0][0], device_allocator));
146 std::vector<std::unique_ptr<Executable>> ret;
147 ret.push_back(std::move(executable));
148 return std::move(ret);
149}
150
151StatusOr<std::vector<std::unique_ptr<AotCompilationResult>>>
152InterpreterCompiler::CompileAheadOfTime(

Callers

nothing calls this directly

Calls 5

UnimplementedFunction · 0.85
ConsumeModulesMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected