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

Method Initialize

tensorflow/compiler/jit/mark_for_compilation_pass.cc:591–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591StatusOr<bool> MarkForCompilationPassImpl::Initialize() {
592 TF_RET_CHECK(!initialized_ && !edges_contracted_ && !clusters_created_);
593 initialized_ = true;
594
595 TF_RETURN_IF_ERROR(FindCompilationCandidates());
596
597 if (compilation_candidates_.empty()) {
598 VLOG(2) << "No compilable candidates";
599 return false;
600 }
601
602 TF_ASSIGN_OR_RETURN(bool cycle_detection_graph_ok,
603 CreateCycleDetectionGraph(graph_, &cycles_graph_));
604 if (!cycle_detection_graph_ok) {
605 // TODO(sanjoy): This should be logged via the XLA activity listener.
606 VLOG(2) << "Could not form cycle detection graph";
607 return false;
608 }
609
610 if (!debug_options_.ignore_deadness_checks) {
611 XLA_SCOPED_LOGGING_TIMER_LEVEL("DeadnessAnalysis", 1);
612 TF_RETURN_IF_ERROR(DeadnessAnalysis::Run(*graph_, &deadness_analysis_));
613 }
614
615 // Each compilation candidate belongs to a cluster. The cluster's
616 // representative names the node in the 'cycles' graph that represents the
617 // cluster.
618 TF_RETURN_IF_ERROR(BuildInitialClusterSet());
619 return true;
620}
621
622template <typename FnTy>
623StatusOr<bool> MarkForCompilationPassImpl::ForEachEdgeInPostOrder(FnTy fn) {

Callers

nothing calls this directly

Calls 2

RunFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected