Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
b972d8e7
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看板
提交
b972d8e7
编写于
6月 30, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
!2702 configure slice tensors shape for auto parallel
Merge pull request !2702 from lirongzhen1/env
上级
e40ba6f8
40251d95
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
9 deletion
+16
-9
mindspore/ccsrc/operator/prim_others.cc
mindspore/ccsrc/operator/prim_others.cc
+9
-9
mindspore/ccsrc/parallel/step_parallel.cc
mindspore/ccsrc/parallel/step_parallel.cc
+6
-0
mindspore/ccsrc/pipeline/static_analysis/prim.h
mindspore/ccsrc/pipeline/static_analysis/prim.h
+1
-0
未找到文件。
mindspore/ccsrc/operator/prim_others.cc
浏览文件 @
b972d8e7
...
...
@@ -118,11 +118,9 @@ const size_t UndeterminedShapeType::fields_num = 6;
std
::
unordered_map
<
std
::
string
,
UndeterminedShapeType
>
g_undetermined_configs
;
void
InitUndeterminedFromEnv
(
const
std
::
string
&
sparse_shape_types
)
{
if
(
!
g_undetermined_configs
.
empty
())
{
return
;
}
std
::
string
tmp
;
std
::
stringstream
input
(
sparse_shape_types
);
g_undetermined_configs
.
clear
();
while
(
std
::
getline
(
input
,
tmp
,
';'
))
{
auto
config
=
UndeterminedShapeType
(
tmp
);
g_undetermined_configs
.
insert
(
std
::
make_pair
(
config
.
param_name
(),
config
));
...
...
@@ -145,17 +143,19 @@ AbstractBasePtr InferImplEnvGetItem(const AnalysisEnginePtr &, const PrimitivePt
if
(
!
key
->
sparse_grad
().
empty
())
{
// Will be fixed once undetermined type ready
auto
sparse_shape_types
=
common
::
GetEnv
(
"UNDETERMINED_SPARSE_SHAPE_TYPES"
);
if
(
sparse_shape_types
.
empty
())
{
sparse_shape_types
=
"sparse_key_w1:2:Int32:2 1 2:Float32:3 1 2;sparse_key_w2:2:Int32:2 1 2:Float32:3 1 2"
;
if
(
g_undetermined_configs
.
empty
())
{
auto
sparse_shape_types
=
common
::
GetEnv
(
"UNDETERMINED_SPARSE_SHAPE_TYPES"
);
MS_LOG
(
INFO
)
<<
"Undetermind sparse shape:"
<<
sparse_shape_types
;
if
(
sparse_shape_types
.
empty
())
{
sparse_shape_types
=
"sparse_key_w1:2:Int32:2 1 2:Float32:3 1 2;sparse_key_w2:2:Int32:2 1 2:Float32:3 1 2"
;
}
InitUndeterminedFromEnv
(
sparse_shape_types
);
}
InitUndeterminedFromEnv
(
sparse_shape_types
);
auto
shape_types
=
g_undetermined_configs
.
find
(
key
->
sparse_grad
());
if
(
shape_types
==
g_undetermined_configs
.
end
())
{
MS_LOG
(
EXCEPTION
)
<<
"Param "
<<
key
->
ToString
()
<<
" has sparse_grad, but shape/type is not configured in env UNDETERMINED_SPARSE_SHAPE_TYPES: "
<<
sparse_shape_types
;
<<
" has sparse_grad, but shape/type is not configured in env UNDETERMINED_SPARSE_SHAPE_TYPES"
;
}
MS_LOG
(
DEBUG
)
<<
"EnvGetItem is sparse_grad "
<<
key
->
ToString
();
AbstractBasePtrList
sparse_list
;
...
...
mindspore/ccsrc/parallel/step_parallel.cc
浏览文件 @
b972d8e7
...
...
@@ -43,6 +43,7 @@
#include "parallel/strategy_checkpoint/parallel_strategy_checkpoint.h"
#include "utils/comm_manager.h"
#include "utils/symbolic.h"
#include "pipeline/static_analysis/prim.h"
using
mindspore
::
tensor
::
Tensor
;
...
...
@@ -1371,6 +1372,11 @@ void SetClonedTensorShapeForOptimizer(const FuncGraphPtr &root) {
<<
cloned_index
<<
", but not found the be cloned parameter"
;
}
}
std
::
string
env
=
common
::
GetEnv
(
"SLICE_ENV"
);
if
(
!
env
.
empty
())
{
MS_LOG
(
INFO
)
<<
"Slice tensors shape will be configured from env:"
<<
env
;
abstract
::
InitUndeterminedFromEnv
(
env
);
}
}
void
SetVirtualDatasetStrategy
(
const
CNodePtr
&
node
)
{
...
...
mindspore/ccsrc/pipeline/static_analysis/prim.h
浏览文件 @
b972d8e7
...
...
@@ -349,6 +349,7 @@ AbstractBasePtr InferImplControlDepend(const AnalysisEnginePtr &, const Primitiv
AbstractBasePtr
InferImplDebug
(
const
AnalysisEnginePtr
&
,
const
PrimitivePtr
&
primitive
,
const
AbstractBasePtrList
&
args_spec_list
);
void
InitUndeterminedFromEnv
(
const
std
::
string
&
sparse_shape_types
);
}
// namespace abstract
}
// namespace mindspore
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录