Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
5b6b1ad7
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5b6b1ad7
编写于
4年前
作者:
M
mindspore-ci-bot
提交者:
Gitee
4年前
浏览文件
操作
浏览文件
下载
差异文件
!394 [AutoParallel] Simplify rec-prog parser mechanism
Merge pull request !394 from Chong/parser
上级
72880130
b1f5e44c
master
r0.2
r0.3
r0.5
r0.6
r0.7
v0.7.0-beta
v0.6.0-beta
v0.5.0-beta
v0.3.1-alpha
v0.3.0-alpha
v0.2.0-alpha
无相关合并请求
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
88 addition
and
260 deletion
+88
-260
mindspore/ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.cc
.../ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.cc
+76
-231
mindspore/ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.h
...e/ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.h
+11
-26
mindspore/ccsrc/parallel/step_auto_parallel.cc
mindspore/ccsrc/parallel/step_auto_parallel.cc
+1
-3
未找到文件。
mindspore/ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.cc
浏览文件 @
5b6b1ad7
此差异已折叠。
点击以展开。
mindspore/ccsrc/parallel/auto_parallel/rec_core/rec_parse_graph.h
浏览文件 @
5b6b1ad7
...
...
@@ -43,39 +43,24 @@ const std::map<std::string, OperatorType> DictOpType{
const
TensorParam
MakeTensor
(
int
n
,
int
c
,
int
h
,
int
w
);
bool
IsInList
(
const
std
::
string
&
name
,
const
std
::
vector
<
std
::
string
>&
list
);
Graph
::
NodeType
MakeNewOperator
(
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>
ops
,
size_t
iter_ops
);
Graph
::
NodeType
MakeNewTensor
(
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>
ops
,
const
size_t
iter_ops
,
const
std
::
string
&
input
,
const
size_t
iter_input_tensors
,
std
::
shared_ptr
<
Graph
>
graph
,
size_t
current_op_index
);
void
Fill2DTensor
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
size_t
iter_ops
,
const
std
::
shared_ptr
<
Graph
>
graph
,
const
size_t
iter_input_tensors
,
const
size_t
current_op_index
,
Graph
::
NodeType
NewTensor
);
void
CompleteOperatorInputs
(
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>
ops
,
size_t
iter_ops
,
size_t
iter_input_tensors
,
size_t
current_op_index
,
std
::
shared_ptr
<
Graph
>
graph
);
void
Complete2DInputs
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
size_t
iter_ops
,
const
std
::
shared_ptr
<
Graph
>
graph
,
const
size_t
iter_input_tensors
,
const
size_t
current_op_index
);
void
MakeEdge
(
std
::
shared_ptr
<
Graph
>
graph
,
const
size_t
input_index
,
const
size_t
current_op_index
);
TensorParam
Fill2DTensor
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
size_t
iter_ops
,
Graph
::
NodeType
NewTensor
);
OperatorRec
CompleteOperatorInputs
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
size_t
iter_ops
,
Graph
::
NodeType
NewTensor
);
void
ModifyTensorToOperator
(
std
::
shared_ptr
<
Graph
>
graph
,
const
size_t
current_op_index
,
const
size_t
iter_ops
,
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>
ops
);
TensorParam
Complete2DInputs
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
size_t
iter_ops
,
const
size_t
iter_input_tensor
,
Graph
::
NodeType
NewTensor
);
std
::
shared_ptr
<
Graph
>
ParseGraph
(
const
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>&
ops
,
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
input_tensor_names
,
const
std
::
shared_ptr
<
std
::
vector
<
size_t
>>&
ops_nodes_list
);
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
input_tensor_names
);
void
LinkOps
(
std
::
shared_ptr
<
Graph
>
graph
,
std
::
vector
<
std
::
shared_ptr
<
OperatorInfo
>>
ops
,
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
input_tensor_names
,
std
::
vector
<
std
::
string
>
current_graph
,
const
size_t
iter_ops
,
const
size_t
current_op_index
);
void
MakeEdge
(
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
input_tensor_names
,
std
::
shared_ptr
<
Graph
>
graph
);
std
::
shared_ptr
<
Graph
>
EliminateGraph
(
const
std
::
shared_ptr
<
Graph
>
graph
,
std
::
shared_ptr
<
std
::
vector
<
std
::
vector
<
size_t
>>>
eli_list
,
std
::
shared_ptr
<
std
::
vector
<
size_t
>>
index_list
);
void
Eliminate_Aux
(
const
size_t
node_index
,
std
::
shared_ptr
<
Graph
>
graph
,
const
std
::
shared_ptr
<
std
::
vector
<
std
::
vector
<
size_t
>>>
eli_list
);
size_t
GetIndexInInputTensorNames
(
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
input_tensor_names
,
const
std
::
string
&
input_name
);
}
// namespace parallel
}
// namespace mindspore
#endif // PARALLEL_AUTO_PARALLEL_REC_PARSE_GRAPH_H_
This diff is collapsed.
Click to expand it.
mindspore/ccsrc/parallel/step_auto_parallel.cc
浏览文件 @
5b6b1ad7
...
...
@@ -462,7 +462,6 @@ Status ConstructCostGraphNodes(const std::vector<AnfNodePtr> &all_nodes, const F
// Needed by rec_parser
operator_info
->
set_type
(
prim
->
name
());
std
::
vector
<
std
::
string
>
inputs_tensor_name
=
ExtractInputsTensorName
(
cnode
);
operator_info
->
set_cnode_name
(
cnode
->
ToString
());
entire_costgraph
->
AddOperator
(
operator_info
);
(
void
)
cnode
->
set_operator_info
(
operator_info
);
...
...
@@ -935,9 +934,8 @@ Status ParallelStrategyRecSearch(const std::vector<AnfNodePtr> &all_nodes, const
std
::
shared_ptr
<
std
::
vector
<
size_t
>>
index_list
(
new
std
::
vector
<
size_t
>
);
std
::
shared_ptr
<
std
::
vector
<
std
::
vector
<
size_t
>>>
eli_list
(
new
std
::
vector
<
std
::
vector
<
size_t
>>
);
std
::
shared_ptr
<
Graph
>
graph
=
ParseGraph
(
ops
,
input_tensor_names
,
ops_nodes_list
);
std
::
shared_ptr
<
Graph
>
graph
=
ParseGraph
(
ops
,
input_tensor_names
);
graph
=
EliminateGraph
(
graph
,
eli_list
,
index_list
);
size_t
num_device
=
g_device_manager
->
DeviceNum
();
if
(
PartitionForAllDevices
(
num_device
,
graph
)
==
SUCCESS
)
{
MS_LOG
(
INFO
)
<<
"Partition Success With "
<<
num_device
<<
" devices."
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部