Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
927278be
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看板
提交
927278be
编写于
6月 24, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
!2552 check whether mpi instance is null
Merge pull request !2552 from chenjianping/host_reduce
上级
b1647976
c9f4889d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
11 deletion
+17
-11
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
+3
-1
mindspore/ccsrc/kernel/cpu/allgather_cpu_kernel.cc
mindspore/ccsrc/kernel/cpu/allgather_cpu_kernel.cc
+3
-2
mindspore/ccsrc/kernel/cpu/embedding_look_up_comm_grad_cpu_kernel.cc
...csrc/kernel/cpu/embedding_look_up_comm_grad_cpu_kernel.cc
+4
-2
mindspore/ccsrc/kernel/cpu/embedding_look_up_cpu_kernel.cc
mindspore/ccsrc/kernel/cpu/embedding_look_up_cpu_kernel.cc
+4
-3
mindspore/ccsrc/kernel/cpu/reduce_scatter_cpu_kernel.cc
mindspore/ccsrc/kernel/cpu/reduce_scatter_cpu_kernel.cc
+3
-3
未找到文件。
mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc
浏览文件 @
927278be
...
...
@@ -60,7 +60,9 @@ std::string GetRankId() {
auto
mpi_config_ptr
=
MpiConfig
::
GetInstance
();
MS_EXCEPTION_IF_NULL
(
mpi_config_ptr
);
if
(
mpi_config_ptr
->
enable_mpi
())
{
int
rank_id
=
device
::
cpu
::
MPIAdapter
::
Instance
().
GetRankId
();
auto
mpi_instance
=
device
::
cpu
::
MPIAdapter
::
Instance
();
MS_EXCEPTION_IF_NULL
(
mpi_instance
);
int
rank_id
=
mpi_instance
->
GetRankId
();
const
char
*
offset
=
std
::
getenv
(
"RANK_OFFSET"
);
if
(
offset
!=
nullptr
)
{
try
{
...
...
mindspore/ccsrc/kernel/cpu/allgather_cpu_kernel.cc
浏览文件 @
927278be
...
...
@@ -46,8 +46,9 @@ bool AllGatherCPUKernel::Launch(const std::vector<kernel::AddressPtr> &inputs,
auto
input_addr
=
reinterpret_cast
<
float
*>
(
inputs
[
0
]
->
addr
);
auto
output_addr
=
reinterpret_cast
<
float
*>
(
outputs
[
0
]
->
addr
);
auto
input_data_num
=
inputs
[
0
]
->
size
/
sizeof
(
float
);
return
device
::
cpu
::
MPIAdapter
::
Instance
()
->
AllGather
(
input_addr
,
output_addr
,
ranks_group_
,
input_data_num
);
auto
mpi_instance
=
device
::
cpu
::
MPIAdapter
::
Instance
();
MS_EXCEPTION_IF_NULL
(
mpi_instance
);
return
mpi_instance
->
AllGather
(
input_addr
,
output_addr
,
ranks_group_
,
input_data_num
);
}
}
// namespace kernel
}
// namespace mindspore
mindspore/ccsrc/kernel/cpu/embedding_look_up_comm_grad_cpu_kernel.cc
浏览文件 @
927278be
...
...
@@ -50,9 +50,11 @@ bool EmbeddingLookUpCommGradCPUKernel::Launch(const std::vector<kernel::AddressP
const
std
::
vector
<
int
>
&
rank_group
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
size_t
input_split_lens
=
input_size
/
split_num_
/
sizeof
(
float_t
);
size_t
output_split_lens
=
output_size
/
split_num_
/
sizeof
(
float_t
);
auto
mpi_instance
=
device
::
cpu
::
MPIAdapter
::
Instance
();
MS_EXCEPTION_IF_NULL
(
mpi_instance
);
for
(
int
i
=
0
;
i
<
split_num_
;
i
++
)
{
device
::
cpu
::
MPIAdapter
::
Instance
()
->
AllGather
(
input_addr
+
i
*
input_split_lens
,
output_addr
+
i
*
output_split_lens
,
rank_group
,
input_split_lens
);
mpi_instance
->
AllGather
(
input_addr
+
i
*
input_split_lens
,
output_addr
+
i
*
output_split_lens
,
rank_group
,
input_split_lens
);
}
#if defined(_WIN32) || defined(_WIN64)
auto
end_time
=
std
::
chrono
::
steady_clock
::
now
();
...
...
mindspore/ccsrc/kernel/cpu/embedding_look_up_cpu_kernel.cc
浏览文件 @
927278be
...
...
@@ -104,10 +104,11 @@ bool EmbeddingLookUpCPUKernel::Launch(const std::vector<kernel::AddressPtr> &inp
size_t
one_split_lens
=
gatherv2_out_lens_
/
split_num_
/
sizeof
(
float
);
size_t
reduce_scatter_out_lens
=
one_split_lens
/
8
;
const
std
::
vector
<
int
>
&
group
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
};
auto
mpi_instance
=
device
::
cpu
::
MPIAdapter
::
Instance
();
MS_EXCEPTION_IF_NULL
(
mpi_instance
);
for
(
int
i
=
0
;
i
<
split_num_
;
i
++
)
{
device
::
cpu
::
MPIAdapter
::
Instance
()
->
ReduceScatter
(
reinterpret_cast
<
float
*>
(
gather_v2_out_
)
+
i
*
one_split_lens
,
output_addr
+
i
*
reduce_scatter_out_lens
,
group
,
one_split_lens
/
8
,
"sum"
);
mpi_instance
->
ReduceScatter
(
reinterpret_cast
<
float
*>
(
gather_v2_out_
)
+
i
*
one_split_lens
,
output_addr
+
i
*
reduce_scatter_out_lens
,
group
,
one_split_lens
/
8
,
"sum"
);
}
}
#endif
...
...
mindspore/ccsrc/kernel/cpu/reduce_scatter_cpu_kernel.cc
浏览文件 @
927278be
...
...
@@ -46,9 +46,9 @@ bool ReduceScatterCPUKernel::Launch(const std::vector<kernel::AddressPtr> &input
auto
input_addr
=
reinterpret_cast
<
float
*>
(
inputs
[
0
]
->
addr
);
auto
output_addr
=
reinterpret_cast
<
float
*>
(
outputs
[
0
]
->
addr
);
auto
output_data_num
=
outputs
[
0
]
->
size
/
sizeof
(
float
);
return
device
::
cpu
::
MPIAdapter
::
Instance
()
->
ReduceScatter
(
input_addr
,
output_addr
,
ranks_group_
,
output_data_num
,
op_type_
);
auto
mpi_instance
=
device
::
cpu
::
MPIAdapter
::
Instance
();
MS_EXCEPTION_IF_NULL
(
mpi_instance
);
return
mpi_instance
->
ReduceScatter
(
input_addr
,
output_addr
,
ranks_group_
,
output_data_num
,
op_type_
);
}
}
// namespace kernel
}
// namespace mindspore
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录