Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
4cd237ee
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看板
提交
4cd237ee
编写于
4月 16, 2020
作者:
Z
ZPaC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add GPU NCCL ci test cases.
上级
7d406e8e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
4 deletion
+47
-4
tests/st/nccl/test_nccl_all.py
tests/st/nccl/test_nccl_all.py
+44
-0
tests/st/nccl/test_nccl_all_reduce_op.py
tests/st/nccl/test_nccl_all_reduce_op.py
+1
-1
tests/st/nccl/test_nccl_lenet.py
tests/st/nccl/test_nccl_lenet.py
+2
-1
tests/st/nccl/test_nccl_reduce_scatter_op.py
tests/st/nccl/test_nccl_reduce_scatter_op.py
+0
-2
未找到文件。
tests/st/nccl/test_nccl_all.py
0 → 100644
浏览文件 @
4cd237ee
# 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.
# ============================================================================
import
os
import
pytest
@
pytest
.
mark
.
level0
@
pytest
.
mark
.
platform_x86_gpu_training
@
pytest
.
mark
.
env_single
def
test_nccl_lenet
():
return_code
=
os
.
system
(
"mpirun -n 8 pytest -s test_nccl_lenet.py"
)
assert
(
return_code
==
0
)
@
pytest
.
mark
.
level0
@
pytest
.
mark
.
platform_x86_gpu_training
@
pytest
.
mark
.
env_single
def
test_nccl_all_reduce_op
():
return_code
=
os
.
system
(
"mpirun -n 8 pytest -s test_nccl_all_reduce_op.py"
)
assert
(
return_code
==
0
)
@
pytest
.
mark
.
level0
@
pytest
.
mark
.
platform_x86_gpu_training
@
pytest
.
mark
.
env_single
def
test_nccl_all_gather_op
():
return_code
=
os
.
system
(
"mpirun -n 8 pytest -s test_nccl_all_gather_op.py"
)
assert
(
return_code
==
0
)
@
pytest
.
mark
.
level0
@
pytest
.
mark
.
platform_x86_gpu_training
@
pytest
.
mark
.
env_single
def
test_nccl_reduce_scatter_op
():
return_code
=
os
.
system
(
"mpirun -n 8 pytest -s test_nccl_reduce_scatter_op.py"
)
assert
(
return_code
==
0
)
tests/st/nccl/test_nccl_all_reduce_op.py
浏览文件 @
4cd237ee
...
...
@@ -20,7 +20,7 @@ import mindspore.context as context
from
mindspore.common.initializer
import
initializer
from
mindspore.common.parameter
import
Parameter
from
mindspore.communication.management
import
init
,
NCCL_WORLD_COMM_GROUP
,
get_rank
,
get_group_size
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
,
device_target
=
'GPU'
)
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
,
device_target
=
'GPU'
,
enable_dynamic_memory
=
False
)
init
(
'nccl'
)
rank
=
get_rank
()
...
...
tests/st/nccl/test_nccl_lenet.py
浏览文件 @
4cd237ee
...
...
@@ -27,7 +27,7 @@ context.set_context(mode=context.GRAPH_MODE, device_target="GPU")
init
(
'nccl'
)
epoch
=
2
total
=
5000
0
total
=
5000
batch_size
=
32
mini_batch
=
total
//
batch_size
...
...
@@ -94,3 +94,4 @@ def test_lenet_nccl():
with
open
(
"ms_loss.txt"
,
"w"
)
as
fo2
:
fo2
.
write
(
"loss:"
)
fo2
.
write
(
str
(
losses
[
-
5
:]))
assert
(
losses
[
-
1
]
<
0.01
)
tests/st/nccl/test_nccl_reduce_scatter_op.py
浏览文件 @
4cd237ee
...
...
@@ -62,8 +62,6 @@ def test_ReduceScatter():
expect1
=
np
.
ones
([
1
,
1
,
3
,
3
]).
astype
(
np
.
float32
)
*
0.01
*
size
diff1
=
output
[
1
].
asnumpy
()
-
expect1
error1
=
np
.
ones
(
shape
=
expect1
.
shape
)
*
1.0e-5
print
(
expect1
)
print
(
output
[
1
])
assert
np
.
all
(
diff1
<
error1
)
assert
(
output
[
1
].
shape
()
==
expect1
.
shape
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录