Browse Source

Fix Remove Edge

tags/v1.2.0
zhangxiaokun 3 years ago
parent
commit
464aff111e
2 changed files with 13 additions and 10 deletions
  1. +7
    -4
      ge/common/profiling/profiling_manager.cc
  2. +6
    -6
      ge/graph/passes/subgraph_const_migration_pass.cc

+ 7
- 4
ge/common/profiling/profiling_manager.cc View File

@@ -27,6 +27,8 @@ namespace {
const char *const kTrainingTrace = "training_trace"; const char *const kTrainingTrace = "training_trace";
const char *const kFpPoint = "fp_point"; const char *const kFpPoint = "fp_point";
const char *const kBpPoint = "bp_point"; const char *const kBpPoint = "bp_point";

#ifdef DAVINCI_SUPPORT_PROFILING
const size_t kReportMaxLen = 2048; const size_t kReportMaxLen = 2048;
const int32_t kMaxDeviceNum = 256; const int32_t kMaxDeviceNum = 256;
const std::string kConfigNumsdev = "devNums"; const std::string kConfigNumsdev = "devNums";
@@ -35,6 +37,7 @@ const std::string kProfStart = "prof_start";
const std::string kProfStop = "prof_stop"; const std::string kProfStop = "prof_stop";
const std::string kProfModelSubscribe = "prof_model_subscribe"; const std::string kProfModelSubscribe = "prof_model_subscribe";
const std::string kProfModelUnsubscribe = "prof_model_cancel_subscribe"; const std::string kProfModelUnsubscribe = "prof_model_cancel_subscribe";
#endif
} // namespace } // namespace


namespace ge { namespace ge {
@@ -110,7 +113,7 @@ ge::Status ProfilingManager::InitFromOptions(const Options &options, MsprofGeOpt
} }
// enable profiling by env // enable profiling by env
is_execute_profiling_ = true; is_execute_profiling_ = true;
GELOGI("The profiling in env is %s, %s", env_profiling_mode, prof_conf.options);
GELOGI("The profiling in env is %s, %s", env_profiling_mode, prof_conf.options);
} }


if (!is_execute_profiling_) { if (!is_execute_profiling_) {
@@ -186,7 +189,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::StopProf
GELOGW("Call rtProfilerStop failed, ret:%d", rt_ret); GELOGW("Call rtProfilerStop failed, ret:%d", rt_ret);
} }
} }
// stop profiling // stop profiling
if (prof_cb_.msprofCtrlCallback == nullptr) { if (prof_cb_.msprofCtrlCallback == nullptr) {
GELOGE(ge::PARAM_INVALID, "MsprofCtrlCallback callback is nullptr."); GELOGE(ge::PARAM_INVALID, "MsprofCtrlCallback callback is nullptr.");
@@ -801,7 +804,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::CallMs
if (prof_cb_.msprofReporterCallback == nullptr) { if (prof_cb_.msprofReporterCallback == nullptr) {
GELOGE(ge::PARAM_INVALID, "MsprofReporterCallback callback is nullptr."); GELOGE(ge::PARAM_INVALID, "MsprofReporterCallback callback is nullptr.");
return ge::PARAM_INVALID; return ge::PARAM_INVALID;
}
}
return prof_cb_.msprofReporterCallback( return prof_cb_.msprofReporterCallback(
static_cast<uint32_t>(MsprofReporterModuleId::MSPROF_MODULE_FRAMEWORK), static_cast<uint32_t>(MsprofReporterModuleId::MSPROF_MODULE_FRAMEWORK),
static_cast<uint32_t>(MsprofReporterCallbackType::MSPROF_REPORTER_REPORT), static_cast<uint32_t>(MsprofReporterCallbackType::MSPROF_REPORTER_REPORT),
@@ -853,7 +856,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::GetFpBpP
return; return;
} }
} }
return; return;
} }




+ 6
- 6
ge/graph/passes/subgraph_const_migration_pass.cc View File

@@ -340,15 +340,15 @@ Status SubgraphConstMigrationPass::DetachParallelNode(const map<string, NodePtr>
const NodePtr &const_node, const NodePtr &data_node) { const NodePtr &const_node, const NodePtr &data_node) {
// Break Data and Move node. // Break Data and Move node.
const auto &in_anchor = const_node->GetInControlAnchor(); const auto &in_anchor = const_node->GetInControlAnchor();
while (!in_anchor->GetPeerOutControlAnchors().empty()) {
const auto &out_anchor = in_anchor->GetPeerOutControlAnchors().at(kZeroIndex);
const auto out_anchors = in_anchor->GetPeerOutControlAnchors();
for (const auto out_anchor : out_anchors) {
GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_anchor, in_anchor), "Remove edge failed"); GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_anchor, in_anchor), "Remove edge failed");
GELOGI("Remove Edge: %s %s", out_anchor->GetOwnerNode()->GetName().c_str(), const_node->GetName().c_str()); GELOGI("Remove Edge: %s %s", out_anchor->GetOwnerNode()->GetName().c_str(), const_node->GetName().c_str());
} }


const auto &ctrl_anchor = const_node->GetOutControlAnchor(); const auto &ctrl_anchor = const_node->GetOutControlAnchor();
while (!ctrl_anchor->GetPeerInControlAnchors().empty()) {
const auto &in_anchor = ctrl_anchor->GetPeerInControlAnchors().at(kZeroIndex);
const auto ctrl_anchors = ctrl_anchor->GetPeerInControlAnchors();
for (const auto in_anchor : ctrl_anchors) {
GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(ctrl_anchor, in_anchor), "Remove edge failed"); GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(ctrl_anchor, in_anchor), "Remove edge failed");
GELOGI("Remove Edge: %s %s", const_node->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str()); GELOGI("Remove Edge: %s %s", const_node->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str());


@@ -358,8 +358,8 @@ Status SubgraphConstMigrationPass::DetachParallelNode(const map<string, NodePtr>


// Break Move and follow, Link Data and follow. // Break Move and follow, Link Data and follow.
const auto &out_anchor = const_node->GetOutDataAnchor(kZeroIndex); const auto &out_anchor = const_node->GetOutDataAnchor(kZeroIndex);
while (!out_anchor->GetPeerInDataAnchors().empty()) {
const auto &in_anchor = out_anchor->GetPeerInDataAnchors().at(kZeroIndex);
const auto in_anchors =out_anchor->GetPeerInDataAnchors();
for (const auto in_anchor : in_anchors) {
GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_anchor, in_anchor), "Remove edge failed"); GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_anchor, in_anchor), "Remove edge failed");
GELOGI("Remove Edge: %s %s", const_node->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str()); GELOGI("Remove Edge: %s %s", const_node->GetName().c_str(), in_anchor->GetOwnerNode()->GetName().c_str());




Loading…
Cancel
Save