!186 fix hcom parrelle sc

Merge pull request !186 from 王笑天/development
pull/186/MERGE
王涛 5 years ago committed by Gitee
commit f72d32a01d

@ -462,7 +462,7 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
set<NodePtr> all_reduce_succs;
for (const NodePtr &node : graph->GetDirectNode()) {
if ((node->GetType() != HCOMALLREDUCE && node->GetType() != HVDCALLBACKALLREDUCE) ||
if (!IsHcomNode(node->GetType()) ||
node->GetInDataNodes().size() <= 1) {
continue;
}
@ -507,7 +507,7 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
old_stream_to_new.emplace(old_stream, new_stream);
}
if ((node->GetType() != HCOMALLREDUCE && node->GetType() != HVDCALLBACKALLREDUCE)) {
if (!IsHcomNode(node->GetType())) {
GELOGI("Stream of node %s has been updated from %ld to %ld.", node->GetName().c_str(), old_stream, new_stream);
node->GetOpDesc()->SetStreamId(new_stream);
}
@ -517,6 +517,11 @@ Status AllReduceParallelPass::Run(ComputeGraphPtr graph, const vector<SubgraphPt
return !all_reduce_succs.empty() ? SUCCESS : NOT_CHANGED;
}
bool AllReduceParallelPass::IsHcomNode(const std::string& node_type) {
return (node_type == HCOMALLREDUCE || node_type == HVDCALLBACKALLREDUCE);
}
LogicalStreamAllocator::LogicalStreamAllocator(const map<string, SchedulerConf> &scheduler_confs,
const map<string, int> &max_parallel_num)
: scheduler_confs_(scheduler_confs), max_parallel_num_(max_parallel_num) {}

@ -166,6 +166,8 @@ class AllReduceParallelPass : public LogicalStreamPass {
public:
STREAM_PASS_DEFAULT_FUNC(AllReduceParallelPass);
Status Run(ComputeGraphPtr graph, const std::vector<SubgraphPtr> &subgraphs, Context &context) override;
private:
bool IsHcomNode(const std::string& node_type);
};
// Assign logical streams which is not limited by the number of tasks.

Loading…
Cancel
Save