|
|
|
@ -64,7 +64,7 @@ Status AssignByLabelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr> &
|
|
|
|
|
subgraph->stream_id = iter->second;
|
|
|
|
|
} else {
|
|
|
|
|
subgraph->stream_id = next_stream;
|
|
|
|
|
GELOGI("Assign new stream %ld for label %s.", next_stream, stream_label.c_str());
|
|
|
|
|
GELOGI("Assign new stream %ld for label %s", next_stream, stream_label.c_str());
|
|
|
|
|
|
|
|
|
|
label_streams.emplace(stream_label, next_stream);
|
|
|
|
|
++next_stream;
|
|
|
|
@ -96,7 +96,7 @@ Status IndependentStreamPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
|
|
|
|
|
subgraph->stream_id = iter->second;
|
|
|
|
|
} else {
|
|
|
|
|
subgraph->stream_id = next_stream;
|
|
|
|
|
GELOGI("Assign new independent stream %ld for engine %s (label: %s).", next_stream, engine.c_str(),
|
|
|
|
|
GELOGI("Assign new independent stream %ld for engine %s (label: %s)", next_stream, engine.c_str(),
|
|
|
|
|
stream_label.c_str());
|
|
|
|
|
|
|
|
|
|
label_streams.emplace(stream_label, next_stream);
|
|
|
|
@ -127,7 +127,7 @@ Status AssignByDependencyPass::Run(ComputeGraphPtr graph, const vector<SubgraphP
|
|
|
|
|
} else {
|
|
|
|
|
int64_t stream_id = AssignNewStream(reusable_subgraph);
|
|
|
|
|
subgraph->stream_id = stream_id;
|
|
|
|
|
GELOGI("Reusable subgraph %s has not been assigned a stream, now assign new stream %ld.",
|
|
|
|
|
GELOGI("Reusable subgraph %s has not been assigned a stream, now assign new stream %ld",
|
|
|
|
|
reusable_subgraph->name.c_str(), stream_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -137,7 +137,7 @@ Status AssignByDependencyPass::Run(ComputeGraphPtr graph, const vector<SubgraphP
|
|
|
|
|
|
|
|
|
|
subgraph->reused_subgraph = reusable_subgraph;
|
|
|
|
|
reused_subgraphs_.emplace_back(subgraph, reusable_subgraph);
|
|
|
|
|
GELOGI("Subgraph %s of engine %s reuses stream of subgraph %s of engine %s.", subgraph->name.c_str(),
|
|
|
|
|
GELOGI("Subgraph %s of engine %s reuses stream of subgraph %s of engine %s", subgraph->name.c_str(),
|
|
|
|
|
subgraph->engine_conf.id.c_str(), reusable_subgraph->name.c_str(),
|
|
|
|
|
reusable_subgraph->engine_conf.id.c_str());
|
|
|
|
|
} else {
|
|
|
|
@ -249,7 +249,7 @@ int64_t AssignByDependencyPass::AssignNewStream(SubgraphPtr subgraph) {
|
|
|
|
|
engine_stream_num_[engine_name] = stream_id + 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GELOGI("Subgraph %s assigns new temp stream %ld (engine: %s).", subgraph->name.c_str(), stream_id,
|
|
|
|
|
GELOGI("Subgraph %s assigns new temp stream %ld (engine: %s)", subgraph->name.c_str(), stream_id,
|
|
|
|
|
engine_name.c_str());
|
|
|
|
|
|
|
|
|
|
return stream_id;
|
|
|
|
@ -282,7 +282,7 @@ void AssignByDependencyPass::UpdateAssignedSubgraphs(Context &context) {
|
|
|
|
|
GELOGI("Subgraph %s of engine %s reuses default stream %ld.", subgraph->name.c_str(),
|
|
|
|
|
subgraph->engine_conf.id.c_str(), context.default_stream);
|
|
|
|
|
} else {
|
|
|
|
|
GELOGI("Stream of subgraph %s has been updated to %ld.", subgraph->name.c_str(), subgraph->stream_id);
|
|
|
|
|
GELOGI("Stream of subgraph %s has been updated to %ld", subgraph->name.c_str(), subgraph->stream_id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -293,7 +293,7 @@ void AssignByDependencyPass::UpdateReusedSubgraphs() {
|
|
|
|
|
auto &cur_subgraph = item.first;
|
|
|
|
|
auto &reused_graph = item.second;
|
|
|
|
|
cur_subgraph->stream_id = reused_graph->stream_id;
|
|
|
|
|
GELOGI("Stream of subgraph %s has been updated to %ld.", cur_subgraph->name.c_str(), cur_subgraph->stream_id);
|
|
|
|
|
GELOGI("Stream of subgraph %s has been updated to %ld", cur_subgraph->name.c_str(), cur_subgraph->stream_id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -330,7 +330,7 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr
|
|
|
|
|
engine_name.c_str());
|
|
|
|
|
return INTERNAL_ERROR;
|
|
|
|
|
} else {
|
|
|
|
|
GELOGI("Subgraph %s is assigned stream %ld (engine: %s).", subgraph->name.c_str(), subgraph->stream_id,
|
|
|
|
|
GELOGI("Subgraph %s is assigned stream %ld (engine: %s)", subgraph->name.c_str(), subgraph->stream_id,
|
|
|
|
|
engine_name.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -353,11 +353,11 @@ Status NodeStreamUpdatePass::Run(ComputeGraphPtr graph, const vector<SubgraphPtr
|
|
|
|
|
GELOGD("Node %s of type %s in subgraph %s is assigned parent stream %ld (engine: %s).", node->GetName().c_str(),
|
|
|
|
|
node->GetType().c_str(), subgraph->name.c_str(), context.default_stream, engine_name.c_str());
|
|
|
|
|
} else if (IsEngineSkip(*subgraph) && node->GetInNodes().empty()) {
|
|
|
|
|
GELOGD("Node %s of type %s in subgraph %s doesn't need to assign a stream (engine: %s).",
|
|
|
|
|
GELOGD("Node %s of type %s in subgraph %s doesn't need to assign a stream (engine: %s)",
|
|
|
|
|
node->GetName().c_str(), node->GetType().c_str(), subgraph->name.c_str(), engine_name.c_str());
|
|
|
|
|
} else {
|
|
|
|
|
node->GetOpDesc()->SetStreamId(stream_id);
|
|
|
|
|
GELOGD("Node %s of type %s in subgraph %s is assigned stream %ld (engine: %s).", node->GetName().c_str(),
|
|
|
|
|
GELOGD("Node %s of type %s in subgraph %s is assigned stream %ld (engine: %s)", node->GetName().c_str(),
|
|
|
|
|
node->GetType().c_str(), subgraph->name.c_str(), stream_id, engine_name.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -387,7 +387,7 @@ int64_t UpdateForSkippedEnginePass::GetSingleInoutStream(const NodePtr &node) co
|
|
|
|
|
|
|
|
|
|
if (stream_ids.size() == 1) {
|
|
|
|
|
int64_t stream_id = *(stream_ids.begin());
|
|
|
|
|
GELOGI("The stream of all input and output nodes of node %s (type: %s) is %ld.", node->GetName().c_str(),
|
|
|
|
|
GELOGI("The stream of all input and output nodes of node %s (type: %s) is %ld", node->GetName().c_str(),
|
|
|
|
|
node->GetType().c_str(), stream_id);
|
|
|
|
|
return stream_id;
|
|
|
|
|
}
|
|
|
|
@ -427,7 +427,7 @@ Status UpdateForSkippedEnginePass::Run(ComputeGraphPtr graph, const vector<Subgr
|
|
|
|
|
int64_t inout_stream = GetSingleInoutStream(node);
|
|
|
|
|
if (inout_stream != kInvalidStream) {
|
|
|
|
|
op_desc->SetStreamId(inout_stream);
|
|
|
|
|
GELOGI("Node %s of type %s reassign to stream %ld from stream %ld.", node->GetName().c_str(),
|
|
|
|
|
GELOGI("Node %s of type %s reassign to stream %ld from stream %ld", node->GetName().c_str(),
|
|
|
|
|
node->GetType().c_str(), inout_stream, stream_id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -455,7 +455,7 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
|
|
|
|
|
return NOT_CHANGED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GELOGI("AllReduceParallelPass is enabled.");
|
|
|
|
|
GELOGI("AllReduceParallelPass is enabled");
|
|
|
|
|
GE_DUMP(graph, "BeforeAllReduceParallel");
|
|
|
|
|
|
|
|
|
|
// All successors of HcomAllReduce.
|
|
|
|
@ -565,7 +565,7 @@ Status LogicalStreamAllocator::Assign(const ComputeGraphPtr &root_graph, const G
|
|
|
|
|
RefreshContinuousStreams(root_graph);
|
|
|
|
|
|
|
|
|
|
stream_num = context_.next_stream;
|
|
|
|
|
GELOGI("Assigned logical stream num: %ld.", stream_num);
|
|
|
|
|
GELOGI("Assigned logical stream num: %ld", stream_num);
|
|
|
|
|
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
@ -597,10 +597,10 @@ Status LogicalStreamAllocator::DoAssign(const ComputeGraphPtr &graph, const Grap
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GELOGD("Subgraphs of graph %s:", graph->GetName().c_str());
|
|
|
|
|
GELOGD("Subgraphs of graph %s.", graph->GetName().c_str());
|
|
|
|
|
for (const auto &subgraph : subgraphs) {
|
|
|
|
|
if (subgraph != nullptr) {
|
|
|
|
|
GELOGD("subgraph: %s", subgraph->name.c_str());
|
|
|
|
|
GELOGD("subgraph: %s.", subgraph->name.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -664,9 +664,9 @@ Status LogicalStreamAllocator::RunPasses(const ComputeGraphPtr &graph, const vec
|
|
|
|
|
|
|
|
|
|
Status status = pass->Run(graph, subgraphs, context_);
|
|
|
|
|
if (status == SUCCESS) {
|
|
|
|
|
GELOGD("Stream pass %s return SUCCESS.", pass->GetName().c_str());
|
|
|
|
|
GELOGD("Stream pass %s return SUCCESS", pass->GetName().c_str());
|
|
|
|
|
} else if (status == NOT_CHANGED) {
|
|
|
|
|
GELOGD("Stream pass %s return NOT_CHANGED.", pass->GetName().c_str());
|
|
|
|
|
GELOGD("Stream pass %s return NOT_CHANGED", pass->GetName().c_str());
|
|
|
|
|
} else {
|
|
|
|
|
GELOGE(status, "Stream pass %s failed.", pass->GetName().c_str());
|
|
|
|
|
return status;
|
|
|
|
|