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

Method IsCompilableCall

tensorflow/compiler/jit/compilability_check_util.cc:224–261  ·  view source on GitHub ↗

Tests whether 'call_def' is a call to a completely compilable function. Every operator in the function must be compilable for a function to be compilable.

Source from the content-addressed store, hash-verified

222// Every operator in the function must be compilable for a function to be
223// compilable.
224bool RecursiveCompilabilityChecker::IsCompilableCall(
225 const NodeDef& call_def, FunctionLibraryRuntime* lib_runtime,
226 std::vector<StackFrameView>* stack_trace,
227 std::vector<UncompilableNodeInfo>* uncompilable_nodes) const {
228 if (stack_trace->size() > kMaxRecursionDepth) {
229 std::string uncompilable_reason = "function depth limit exceeded";
230 MaybeMarkUncompilableNode(uncompilable_reason, *stack_trace,
231 uncompilable_nodes);
232 VLOG(2) << "Rejecting " << call_def.op() << ": " << uncompilable_reason
233 << ".";
234 return false;
235 }
236
237 FunctionLibraryRuntime::Handle handle;
238 Status status = InstantiateFunctionCall(call_def, lib_runtime, &handle);
239 if (!status.ok()) {
240 std::string uncompilable_reason = "could not instantiate call";
241 MaybeMarkUncompilableNode(uncompilable_reason, *stack_trace,
242 uncompilable_nodes);
243 VLOG(2) << "Rejecting " << call_def.DebugString() << ": "
244 << uncompilable_reason << " : " << status;
245 return false;
246 }
247
248 auto release_handle_on_return = gtl::MakeCleanup(
249 [&] { TF_CHECK_OK(lib_runtime->ReleaseHandle(handle)); });
250 const FunctionBody* fbody = lib_runtime->GetFunctionBody(handle);
251 bool is_compilable = true;
252 for (const Node* node : fbody->graph->op_nodes()) {
253 stack_trace->emplace_back(StackFrameView{node->name(), call_def.op()});
254 is_compilable &=
255 IsCompilableNode(*node, lib_runtime, stack_trace, uncompilable_nodes);
256 stack_trace->pop_back();
257 if (!uncompilable_nodes && !is_compilable) return is_compilable;
258 }
259
260 return is_compilable;
261}
262
263bool RecursiveCompilabilityChecker::OpIsInaccurate(const Node& node) const {
264 // b/127344411: SelfAdjointEigV2 and Svd precision issues.

Callers 1

IsCompilableFunction · 0.45

Calls 11

InstantiateFunctionCallFunction · 0.85
GetFunctionBodyMethod · 0.80
op_nodesMethod · 0.80
pop_backMethod · 0.80
nameMethod · 0.65
sizeMethod · 0.45
opMethod · 0.45
okMethod · 0.45
DebugStringMethod · 0.45
ReleaseHandleMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected