Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
06d35d8d
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看板
提交
06d35d8d
编写于
5月 15, 2020
作者:
Y
yao_yf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gatherv2 replace graph in auto parallel
上级
b0921c15
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
9 deletion
+14
-9
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.cc
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.cc
+9
-5
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.h
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.h
+1
-0
mindspore/ccsrc/parallel/ops_info/reshape_info.cc
mindspore/ccsrc/parallel/ops_info/reshape_info.cc
+4
-4
未找到文件。
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.cc
浏览文件 @
06d35d8d
...
...
@@ -258,16 +258,20 @@ Status GatherV2PInfo::ComputeReplaceGraph(const CNodePtr &cnode) {
return
SUCCESS
;
}
ReplaceGraphPtr
GatherV2PInfo
::
replace_graph
(
const
CNodePtr
&
cnode
)
{
auto
param_strategy
=
strategy_
->
GetInputDim
().
at
(
0
);
if
(
param_strategy
.
at
(
IntToSize
(
axis_
))
!=
1
&&
ComputeReplaceGraph
(
cnode
)
!=
SUCCESS
)
{
MS_LOG
(
ERROR
)
<<
name_
<<
": ComputeReplaceGraph failed."
;
return
nullptr
;
}
return
replace_graph_
;
}
Status
GatherV2PInfo
::
Init
(
const
StrategyPtr
&
strategy
)
{
auto
param_strategy
=
strategy
->
GetInputDim
().
at
(
0
);
if
(
InitWithAutoRepeatCalc
(
strategy
)
!=
SUCCESS
)
{
MS_LOG
(
ERROR
)
<<
name_
<<
": Init failed."
;
return
FAILED
;
}
if
(
param_strategy
.
at
(
IntToSize
(
axis_
))
!=
1
&&
ComputeReplaceGraph
(
cnode_
)
!=
SUCCESS
)
{
MS_LOG
(
ERROR
)
<<
name_
<<
": ComputeReplaceGraph failed."
;
return
FAILED
;
}
MS_LOG
(
INFO
)
<<
name_
<<
": Init success."
;
return
SUCCESS
;
}
...
...
mindspore/ccsrc/parallel/ops_info/gather_v2_p_info.h
浏览文件 @
06d35d8d
...
...
@@ -43,6 +43,7 @@ class GatherV2PInfo : public OperatorInfo {
Status
GenerateStrategies
(
int32_t
stage_id
)
override
;
Status
SetCostUnderStrategy
(
const
StrategyPtr
&
strategy
)
override
;
ReplaceGraphPtr
replace_graph
(
const
CNodePtr
&
cnode
)
override
;
std
::
shared_ptr
<
std
::
vector
<
std
::
vector
<
int32_t
>>>
GenerateBatchStrategies
()
override
;
protected:
...
...
mindspore/ccsrc/parallel/ops_info/reshape_info.cc
浏览文件 @
06d35d8d
...
...
@@ -138,9 +138,9 @@ Status ReshapeInfo::ComputeReplaceOp() {
MS_LOG
(
ERROR
)
<<
name_
<<
": tensor_redistribution init failed."
;
return
FAILED
;
}
MS_LOG
(
INFO
)
<<
name_
<<
": input "
<<
input_layout_
.
ToString
();
MS_LOG
(
INFO
)
<<
name_
<<
": output "
<<
output_layout_
.
ToString
();
MS_LOG
(
INFO
)
<<
name_
<<
": dev_list "
<<
dev_list
.
size
();
MS_LOG
(
DEBUG
)
<<
name_
<<
": input "
<<
input_layout_
.
ToString
();
MS_LOG
(
DEBUG
)
<<
name_
<<
": output "
<<
output_layout_
.
ToString
();
MS_LOG
(
DEBUG
)
<<
name_
<<
": dev_list "
<<
dev_list
.
size
();
RedistributionOpListPtr
redistribution_oplist_ptr
=
tensor_redistribution
.
InferTensorRedistributionOperatorList
();
if
(
redistribution_oplist_ptr
==
nullptr
)
{
MS_LOG
(
ERROR
)
<<
name_
<<
"InferTensorRedistribution failed."
;
...
...
@@ -148,7 +148,7 @@ Status ReshapeInfo::ComputeReplaceOp() {
}
replace_op_
=
redistribution_oplist_ptr
->
first
;
replace_op_info_
=
redistribution_oplist_ptr
->
second
;
MS_LOG
(
INFO
)
<<
name_
<<
": replace op size = "
<<
replace_op_
.
size
();
MS_LOG
(
DEBUG
)
<<
name_
<<
": replace op size = "
<<
replace_op_
.
size
();
return
SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录