Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
f946aea1
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看板
提交
f946aea1
编写于
3月 31, 2020
作者:
L
lichenever
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix grpah mode loop sink bug in auto parallel
上级
976226f9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
12 deletion
+17
-12
mindspore/ccsrc/parallel/auto_parallel/graph_costmodel.h
mindspore/ccsrc/parallel/auto_parallel/graph_costmodel.h
+2
-2
mindspore/ccsrc/parallel/step_parallel.cc
mindspore/ccsrc/parallel/step_parallel.cc
+4
-0
mindspore/train/dataset_helper.py
mindspore/train/dataset_helper.py
+1
-1
tests/ut/python/parallel/test_auto_parallel_parameter_cast.py
...s/ut/python/parallel/test_auto_parallel_parameter_cast.py
+6
-6
tests/ut/python/parallel/test_auto_parallel_two_matmul.py
tests/ut/python/parallel/test_auto_parallel_two_matmul.py
+4
-3
未找到文件。
mindspore/ccsrc/parallel/auto_parallel/graph_costmodel.h
浏览文件 @
f946aea1
...
...
@@ -34,8 +34,8 @@ namespace parallel {
#define OPERATOR_TO_OPERATOR_CONNECTOR "-"
#define DEFAULT_DEVICE_MEMORY_CAPACITY (1024.0 * 1024.0 * 1024.0 * 16.0)
#define DEFAULT_COST_MODEL_ALPHA 1.0
#define DEFAULT_COST_MODEL_BETA
65
.0
#define DEFAULT_COST_MODEL_GAMMA 0.0
2
#define DEFAULT_COST_MODEL_BETA
260
.0
#define DEFAULT_COST_MODEL_GAMMA 0.0
01
#define DEFAULT_COST_MODEL_SIMPLIFY_CALCULATION true
#define DEFAULT_COST_MODEL_COMMUNI_THRESHOLD 2048.0
#define DEFAULT_COST_MODEL_COMMUNI_CONST 3072.0
...
...
mindspore/ccsrc/parallel/step_parallel.cc
浏览文件 @
f946aea1
...
...
@@ -375,6 +375,10 @@ bool IsParallelCareNode(const CNodePtr& cnode) {
MS_LOG
(
INFO
)
<<
"Parallel don't care node: "
<<
prim
->
name
();
return
false
;
}
// get_next is not in the forward graph, we need mark the get_next as the forward node
if
(
prim
->
name
()
==
GET_NEXT
)
{
return
true
;
}
if
((
prim
->
name
()
==
CAST
))
{
if
((
!
attrs
.
count
(
STRATEGY
))
&&
(
cnode
->
operator_info
()
==
nullptr
))
{
return
false
;
...
...
mindspore/train/dataset_helper.py
浏览文件 @
f946aea1
...
...
@@ -88,7 +88,7 @@ class _DatasetIter:
# times the batch dimension of tensors for run
if
_get_parallel_mode
()
in
(
ParallelMode
.
SEMI_AUTO_PARALLEL
,
ParallelMode
.
AUTO_PARALLEL
):
device_num
=
_get_device_num
()
dataset_shapes
=
_to_full_shapes
(
dataset_shapes
,
device_num
)
self
.
dataset_shapes
=
_to_full_shapes
(
dataset_shapes
,
device_num
)
def
__iter__
(
self
):
self
.
ind
=
0
...
...
tests/ut/python/parallel/test_auto_parallel_parameter_cast.py
浏览文件 @
f946aea1
...
...
@@ -80,9 +80,9 @@ def test_common_parameter():
_executor
.
compile
(
net
,
x
,
y
,
z
,
w
,
phase
=
'train'
)
strategies
=
_executor
.
_get_strategy
(
net
)
expected_strategies
=
{
'Default/network-Net/MatMul-op8'
:
[[
1
,
1
],
[
1
,
8
]],
'Default/network-Net/MatMul-op9'
:
[[
1
,
1
],
[
1
,
8
]],
'Default/network-Net/Cast-op10'
:
[[
1
,
8
]],
'Default/network-Net/MatMul-op0'
:
[[
1
,
1
],
[
1
,
8
]],
'Default/network-Net/Cast-op11'
:
[[
1
,
8
]]}
assert
strategies
==
expected_strategies
\ No newline at end of file
expected_strategies
=
{
'Default/network-Net/MatMul-op6'
:
[[
8
,
1
],
[
1
,
1
]],
'Default/network-Net/MatMul-op8'
:
[[
8
,
1
],
[
1
,
1
]],
'Default/network-Net/Cast-op7'
:
[[
1
,
1
]],
'Default/network-Net/MatMul-op0'
:
[[
8
,
1
],
[
1
,
1
]],
'Default/network-Net/Cast-op9'
:
[[
1
,
1
]]}
assert
strategies
==
expected_strategies
tests/ut/python/parallel/test_auto_parallel_two_matmul.py
浏览文件 @
f946aea1
...
...
@@ -86,9 +86,9 @@ def test_two_matmul():
costmodel_alpha
=
cost_model_context
.
get_cost_model_context
(
"costmodel_alpha"
)
assert
costmodel_alpha
==
1.0
costmodel_beta
=
cost_model_context
.
get_cost_model_context
(
"costmodel_beta"
)
assert
costmodel_beta
==
65
.0
assert
costmodel_beta
==
260
.0
costmodel_gamma
=
cost_model_context
.
get_cost_model_context
(
"costmodel_gamma"
)
assert
costmodel_gamma
==
0.0
2
assert
costmodel_gamma
==
0.0
01
costmodel_communi_threshold
=
cost_model_context
.
get_cost_model_context
(
"costmodel_communi_threshold"
)
assert
costmodel_communi_threshold
==
2048.0
costmodel_communi_const
=
cost_model_context
.
get_cost_model_context
(
"costmodel_communi_const"
)
...
...
@@ -137,4 +137,5 @@ def test_two_matmul():
strategies
=
_executor
.
_get_strategy
(
net
)
expected_strategies
=
{
'Default/network-Net/MatMul-op2'
:
[[
16
,
1
],
[
1
,
1
]],
'Default/network-Net/MatMul-op3'
:
[[
16
,
1
],
[
1
,
1
]]}
assert
strategies
==
expected_strategies
\ No newline at end of file
assert
strategies
==
expected_strategies
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录