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

Method TryToBuildCostModel

tensorflow/core/common_runtime/executor.cc:1731–1750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1729}
1730
1731ExecutorInternal::ExecuteCostModel* ExecutorImpl::TryToBuildCostModel() {
1732 if (cost_model_) return cost_model_;
1733
1734 if (!enable_cost_model_ ||
1735 !kernel_stats_.CollectStatsDone()) {
1736 return nullptr;
1737 }
1738
1739 // Build cost model
1740 int counter = build_cost_model_counter_.fetch_add(1);
1741 if (counter == 0) {
1742 ExecutorInternal::ExecuteCostModel* cm =
1743 new ExecutorInternal::ExecuteCostModel();
1744 cm->BuildCostModel(&kernel_stats_);
1745 cost_model_ = cm;
1746 LOG(INFO) << "Build execute cost model successful.";
1747 }
1748 if (cost_model_) return cost_model_;
1749 return nullptr;
1750}
1751
1752void ExecutorImpl::RunAsync(const Args& args, DoneCallback done) {
1753 if (immutable_state_.requires_control_flow_support()) {

Callers 1

CreateMethod · 0.80

Calls 2

CollectStatsDoneMethod · 0.80
BuildCostModelMethod · 0.45

Tested by

no test coverage detected