Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
d5a30bb5
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看板
提交
d5a30bb5
编写于
6月 28, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
!2659 building _ms_mpi with mpi_initializer
Merge pull request !2659 from chenjianping/host_reduce
上级
32a2d5d2
303aa71c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
37 deletion
+10
-37
mindspore/ccsrc/device/CMakeLists.txt
mindspore/ccsrc/device/CMakeLists.txt
+3
-4
mindspore/ccsrc/device/cpu/mpi/mpi_interface.cc
mindspore/ccsrc/device/cpu/mpi/mpi_interface.cc
+0
-33
mindspore/ccsrc/device/gpu/mpi/mpi_initializer.cc
mindspore/ccsrc/device/gpu/mpi/mpi_initializer.cc
+7
-0
未找到文件。
mindspore/ccsrc/device/CMakeLists.txt
浏览文件 @
d5a30bb5
...
...
@@ -15,7 +15,6 @@ endif ()
if
(
ENABLE_CPU
)
file
(
GLOB_RECURSE CPU_SRC_LIST RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
"cpu/*.cc"
)
list
(
REMOVE_ITEM CPU_SRC_LIST
"cpu/mpi/mpi_adapter.cc"
)
list
(
REMOVE_ITEM CPU_SRC_LIST
"cpu/mpi/mpi_interface.cc"
)
endif
()
if
(
ENABLE_MPI
)
...
...
@@ -26,10 +25,10 @@ if (ENABLE_MPI)
add_library
(
mpi_adapter SHARED
${
MPI_SRC_LIST
}
)
target_link_libraries
(
mpi_adapter PRIVATE mindspore::ompi
)
set_property
(
SOURCE
"
cpu/mpi/mpi_interface
.cc"
set_property
(
SOURCE
"
gpu/mpi/mpi_initializer
.cc"
PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_DEVICE
)
pybind11_add_module
(
_ms_mpi
"
cpu/mpi/mpi_interface
.cc"
)
target_link_libraries
(
_ms_mpi PRIVATE mindspore::pybind11_module m
pi_adapter
)
pybind11_add_module
(
_ms_mpi
"
gpu/mpi/mpi_initializer
.cc"
)
target_link_libraries
(
_ms_mpi PRIVATE mindspore::pybind11_module m
indspore::ompi
)
endif
()
# gpu
...
...
mindspore/ccsrc/device/cpu/mpi/mpi_interface.cc
已删除
100644 → 0
浏览文件 @
32a2d5d2
/**
* Copyright 2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <pybind11/operators.h>
#include "device/cpu/mpi/mpi_adapter.h"
namespace
mindspore
{
namespace
device
{
namespace
cpu
{
int
get_rank_id
()
{
return
MPIAdapter
::
Instance
()
->
GetRankId
();
}
int
get_rank_size
()
{
return
MPIAdapter
::
Instance
()
->
GetRankSize
();
}
PYBIND11_MODULE
(
_ms_mpi
,
mpi_interface
)
{
mpi_interface
.
doc
()
=
"mindspore mpi python wrapper"
;
mpi_interface
.
def
(
"get_rank_id"
,
&
get_rank_id
,
"get rank id"
);
mpi_interface
.
def
(
"get_rank_size"
,
&
get_rank_size
,
"get rank size"
);
}
}
// namespace cpu
}
// namespace device
}
// namespace mindspore
mindspore/ccsrc/device/gpu/mpi/mpi_initializer.cc
浏览文件 @
d5a30bb5
...
...
@@ -17,6 +17,7 @@
#include "device/gpu/mpi/mpi_initializer.h"
#include <mpi.h>
#include <pybind11/operators.h>
#include <iostream>
namespace
mindspore
{
...
...
@@ -53,6 +54,12 @@ MPIInitializer &MPIInitializer::GetInstance() {
int
MPIInitializer
::
get_rank_id
()
{
return
MPIInitializer
::
GetInstance
().
rank_id_
;
}
int
MPIInitializer
::
get_rank_size
()
{
return
MPIInitializer
::
GetInstance
().
rank_size_
;
}
PYBIND11_MODULE
(
_ms_mpi
,
mpi_initializer
)
{
mpi_initializer
.
doc
()
=
"mindspore mpi python wrapper"
;
mpi_initializer
.
def
(
"get_rank_id"
,
&
MPIInitializer
::
get_rank_id
,
"get rank id"
);
mpi_initializer
.
def
(
"get_rank_size"
,
&
MPIInitializer
::
get_rank_size
,
"get rank size"
);
}
}
// namespace gpu
}
// namespace device
}
// namespace mindspore
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录