Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_77200941
mindspore
提交
998ff039
M
mindspore
项目概览
2301_77200941
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
998ff039
编写于
8月 28, 2020
作者:
H
huanghui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clear codex and reviewbot warning
上级
2060edb0
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
30 addition
and
30 deletion
+30
-30
mindspore/ccsrc/backend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.cc
...ckend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.cc
+2
-2
mindspore/ccsrc/backend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.h
...ackend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.h
+4
-4
mindspore/ccsrc/backend/kernel_compiler/cpu/unique_cpu_kernel.h
...ore/ccsrc/backend/kernel_compiler/cpu/unique_cpu_kernel.h
+2
-3
mindspore/ccsrc/backend/kernel_compiler/cpu/unique_with_pad_cpu_kernel.h
.../backend/kernel_compiler/cpu/unique_with_pad_cpu_kernel.h
+1
-3
mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/lamb_next_mv_with_decay_v1_rule.cc
...mizer/ascend/ir_fusion/lamb_next_mv_with_decay_v1_rule.cc
+1
-2
mindspore/ccsrc/backend/optimizer/pass/communication_op_fusion.cc
...e/ccsrc/backend/optimizer/pass/communication_op_fusion.cc
+20
-15
mindspore/ccsrc/backend/optimizer/pass/convert_const_input_to_tensor_input.cc
...end/optimizer/pass/convert_const_input_to_tensor_input.cc
+0
-1
未找到文件。
mindspore/ccsrc/backend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.cc
浏览文件 @
998ff039
...
@@ -93,9 +93,9 @@ void ScatterNdUpdateCPUKernel::LaunchKernel(const std::vector<AddressPtr> &input
...
@@ -93,9 +93,9 @@ void ScatterNdUpdateCPUKernel::LaunchKernel(const std::vector<AddressPtr> &input
output_unit_offsets_
[
i
]
=
offset
;
output_unit_offsets_
[
i
]
=
offset
;
}
}
auto
mem_size
=
inputs
[
0
]
->
size
;
for
(
int
i
=
0
;
i
<
num_units_
;
i
++
)
{
for
(
int
i
=
0
;
i
<
num_units_
;
i
++
)
{
auto
ret
=
auto
ret
=
memcpy_s
(
x
+
output_unit_offsets_
[
i
],
mem_size
,
updates
+
unit_size_
*
i
,
unit_size_
*
sizeof
(
T
));
memcpy_s
(
x
+
output_unit_offsets_
[
i
],
unit_size_
*
sizeof
(
T
),
updates
+
unit_size_
*
i
,
unit_size_
*
sizeof
(
T
));
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
MS_LOG
(
EXCEPTION
)
<<
"memcpy_s error, errorno"
<<
ret
;
MS_LOG
(
EXCEPTION
)
<<
"memcpy_s error, errorno"
<<
ret
;
}
}
...
...
mindspore/ccsrc/backend/kernel_compiler/cpu/scatter_nd_update_cpu_kernel.h
浏览文件 @
998ff039
...
@@ -39,10 +39,10 @@ class ScatterNdUpdateCPUKernel : public CPUKernel {
...
@@ -39,10 +39,10 @@ class ScatterNdUpdateCPUKernel : public CPUKernel {
private:
private:
void
Check
(
const
CNodePtr
&
kernel_node
);
void
Check
(
const
CNodePtr
&
kernel_node
);
TypeId
dtype_
;
TypeId
dtype_
{
kTypeUnknown
}
;
int
unit_size_
;
int
unit_size_
{
0
}
;
int
num_units_
;
int
num_units_
{
0
}
;
int
indices_unit_rank_
;
int
indices_unit_rank_
{
0
}
;
std
::
vector
<
size_t
>
shape_
;
std
::
vector
<
size_t
>
shape_
;
std
::
vector
<
int
>
output_unit_offsets_
;
std
::
vector
<
int
>
output_unit_offsets_
;
std
::
vector
<
int
>
out_strides_
;
std
::
vector
<
int
>
out_strides_
;
...
...
mindspore/ccsrc/backend/kernel_compiler/cpu/unique_cpu_kernel.h
浏览文件 @
998ff039
...
@@ -39,8 +39,8 @@ class UniqueCPUKernel : public CPUKernel {
...
@@ -39,8 +39,8 @@ class UniqueCPUKernel : public CPUKernel {
private:
private:
void
CheckParam
(
const
CNodePtr
&
kernel_node
);
void
CheckParam
(
const
CNodePtr
&
kernel_node
);
size_t
n_
;
size_t
n_
{
0
}
;
TypeId
dtype_
;
TypeId
dtype_
{
kTypeUnknown
}
;
};
};
MS_REG_CPU_KERNEL
(
MS_REG_CPU_KERNEL
(
...
@@ -57,5 +57,4 @@ MS_REG_CPU_KERNEL(
...
@@ -57,5 +57,4 @@ MS_REG_CPU_KERNEL(
UniqueCPUKernel
);
UniqueCPUKernel
);
}
// namespace kernel
}
// namespace kernel
}
// namespace mindspore
}
// namespace mindspore
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_CPU_KERNEL_H_
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_CPU_KERNEL_H_
mindspore/ccsrc/backend/kernel_compiler/cpu/unique_with_pad_cpu_kernel.h
浏览文件 @
998ff039
...
@@ -40,7 +40,7 @@ class UniqueWithPadCPUKernel : public CPUKernel {
...
@@ -40,7 +40,7 @@ class UniqueWithPadCPUKernel : public CPUKernel {
private:
private:
void
CheckParam
(
const
CNodePtr
&
kernel_node
);
void
CheckParam
(
const
CNodePtr
&
kernel_node
);
int64_t
n_
{
0
};
int64_t
n_
{
0
};
TypeId
dtype_
{
0
};
TypeId
dtype_
{
kTypeUnknown
};
};
};
MS_REG_CPU_KERNEL
(
UniqueWithPad
,
MS_REG_CPU_KERNEL
(
UniqueWithPad
,
...
@@ -58,8 +58,6 @@ MS_REG_CPU_KERNEL(UniqueWithPad,
...
@@ -58,8 +58,6 @@ MS_REG_CPU_KERNEL(UniqueWithPad,
.
AddOutputAttr
(
kNumberTypeInt64
)
.
AddOutputAttr
(
kNumberTypeInt64
)
.
AddOutputAttr
(
kNumberTypeInt64
),
.
AddOutputAttr
(
kNumberTypeInt64
),
UniqueWithPadCPUKernel
);
UniqueWithPadCPUKernel
);
}
// namespace kernel
}
// namespace kernel
}
// namespace mindspore
}
// namespace mindspore
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_WITH_PAD_CPU_KERNEL_H_
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_WITH_PAD_CPU_KERNEL_H_
mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/lamb_next_mv_with_decay_v1_rule.cc
浏览文件 @
998ff039
...
@@ -195,8 +195,7 @@ const AnfNodePtr LambNextMVWithDecayV1Rule::Process(const FuncGraphPtr &func_gra
...
@@ -195,8 +195,7 @@ const AnfNodePtr LambNextMVWithDecayV1Rule::Process(const FuncGraphPtr &func_gra
std
::
vector
<
AnfNodePtr
>
fusion_node_outputs
;
std
::
vector
<
AnfNodePtr
>
fusion_node_outputs
;
CreateMultipleOutputsOfAnfNode
(
func_graph
,
fusion_node
,
kLambNextMVWithDecayV1OutputNum
,
&
fusion_node_outputs
);
CreateMultipleOutputsOfAnfNode
(
func_graph
,
fusion_node
,
kLambNextMVWithDecayV1OutputNum
,
&
fusion_node_outputs
);
if
(
fusion_node_outputs
.
size
()
!=
kLambNextMVWithDecayV1OutputNum
)
{
if
(
fusion_node_outputs
.
size
()
!=
kLambNextMVWithDecayV1OutputNum
)
{
MS_LOG
(
ERROR
)
<<
"create multiple outputs for fusion node fail!"
;
MS_LOG
(
EXCEPTION
)
<<
"create multiple outputs for fusion node fail!"
;
return
nullptr
;
}
}
(
void
)
manager
->
Replace
(
add0
,
fusion_node_outputs
[
1
]);
(
void
)
manager
->
Replace
(
add0
,
fusion_node_outputs
[
1
]);
...
...
mindspore/ccsrc/backend/optimizer/pass/communication_op_fusion.cc
浏览文件 @
998ff039
...
@@ -97,6 +97,25 @@ void CheckInputs(const std::vector<AnfNodePtr> &fusion_inputs) {
...
@@ -97,6 +97,25 @@ void CheckInputs(const std::vector<AnfNodePtr> &fusion_inputs) {
MS_LOG
(
EXCEPTION
)
<<
"Different communication op in one segment cannot share the same input"
;
MS_LOG
(
EXCEPTION
)
<<
"Different communication op in one segment cannot share the same input"
;
}
}
}
}
bool
CheckSegments
(
size_t
segments
,
size_t
communication_op_node_size
,
std
::
vector
<
size_t
>
*
segment_index
)
{
MS_EXCEPTION_IF_NULL
(
segment_index
);
if
(
segments
>=
communication_op_node_size
)
{
MS_LOG
(
INFO
)
<<
"fusion not changed: segment_num="
<<
segments
<<
", communication_op_node_size="
<<
communication_op_node_size
;
return
false
;
}
if
(
segment_index
->
at
(
segments
-
1
)
!=
communication_op_node_size
-
1
)
{
MS_LOG
(
EXCEPTION
)
<<
"the last segment index is invalid."
;
}
for
(
size_t
i
=
0
;
i
<
segments
-
1
;
++
i
)
{
if
(
segment_index
->
at
(
i
)
>
segment_index
->
at
(
i
+
1
))
{
MS_LOG
(
EXCEPTION
)
<<
"illegal split: segment_index["
<<
i
<<
"]="
<<
segment_index
->
at
(
i
)
<<
", segment_index[ "
<<
i
+
1
<<
"]="
<<
segment_index
->
at
(
i
+
1
);
}
}
return
true
;
}
}
// namespace
}
// namespace
bool
CommunicationOpFusion
::
GetSplitSegments
(
const
CommunicationOpInfo
&
communication_op_info
,
size_t
*
segment_num
,
bool
CommunicationOpFusion
::
GetSplitSegments
(
const
CommunicationOpInfo
&
communication_op_info
,
size_t
*
segment_num
,
...
@@ -137,22 +156,8 @@ bool CommunicationOpFusion::GetSplitSegments(const CommunicationOpInfo &communic
...
@@ -137,22 +156,8 @@ bool CommunicationOpFusion::GetSplitSegments(const CommunicationOpInfo &communic
segment_index
->
push_back
(
communication_op_node_size
-
1
);
segment_index
->
push_back
(
communication_op_node_size
-
1
);
}
}
if
(
segments
>=
communication_op_node_size
)
{
MS_LOG
(
INFO
)
<<
"fusion not changed: segment_num="
<<
segments
<<
", communication_op_node_size="
<<
communication_op_node_size
;
return
false
;
}
if
(
segment_index
->
at
(
segments
-
1
)
!=
communication_op_node_size
-
1
)
{
MS_LOG
(
EXCEPTION
)
<<
"the last segment index is invalid."
;
}
for
(
size_t
i
=
0
;
i
<
segments
-
1
;
++
i
)
{
if
(
segment_index
->
at
(
i
)
>
segment_index
->
at
(
i
+
1
))
{
MS_LOG
(
EXCEPTION
)
<<
"illegal split: segment_index["
<<
i
<<
"]="
<<
segment_index
->
at
(
i
)
<<
", segment_index[ "
<<
i
+
1
<<
"]="
<<
segment_index
->
at
(
i
+
1
);
}
}
*
segment_num
=
segments
;
*
segment_num
=
segments
;
return
true
;
return
CheckSegments
(
segments
,
communication_op_node_size
,
segment_index
)
;
}
}
AnfNodePtr
CommunicationOpFusion
::
CreateFusedCommunicationOp
(
const
FuncGraphPtr
&
func_graph
,
AnfNodePtr
CommunicationOpFusion
::
CreateFusedCommunicationOp
(
const
FuncGraphPtr
&
func_graph
,
...
...
mindspore/ccsrc/backend/optimizer/pass/convert_const_input_to_tensor_input.cc
浏览文件 @
998ff039
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
namespace
mindspore
{
namespace
mindspore
{
namespace
opt
{
namespace
opt
{
namespace
{
namespace
{
AnfNodePtr
CreateTensorInput
(
const
AnfNodePtr
&
node
,
const
KernelGraphPtr
&
kernel_graph
,
const
AnfNodePtr
&
input_node
)
{
AnfNodePtr
CreateTensorInput
(
const
AnfNodePtr
&
node
,
const
KernelGraphPtr
&
kernel_graph
,
const
AnfNodePtr
&
input_node
)
{
MS_EXCEPTION_IF_NULL
(
input_node
);
MS_EXCEPTION_IF_NULL
(
input_node
);
auto
value_node
=
input_node
->
cast
<
ValueNodePtr
>
();
auto
value_node
=
input_node
->
cast
<
ValueNodePtr
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录