Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
06f8aa5b
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
06f8aa5b
编写于
12月 12, 2018
作者:
S
sneaxiy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove while_op support temporarily
test=develop
上级
79230423
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
46 deletion
+3
-46
paddle/fluid/framework/executor.cc
paddle/fluid/framework/executor.cc
+2
-1
paddle/fluid/operators/controlflow/while_op.cc
paddle/fluid/operators/controlflow/while_op.cc
+1
-45
未找到文件。
paddle/fluid/framework/executor.cc
浏览文件 @
06f8aa5b
...
...
@@ -419,7 +419,8 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope,
int64_t
max_memory_size
=
GetEagerDeletionThreshold
();
std
::
unique_ptr
<
GarbageCollector
>
gc
;
if
(
max_memory_size
>=
0
)
{
// skip while_op and while_grad_op temporarily
if
(
max_memory_size
>=
0
&&
!
keep_kids
)
{
ctx
->
ResetReferenceCount
();
#ifdef PADDLE_WITH_CUDA
if
(
platform
::
is_gpu_place
(
place_
))
{
...
...
paddle/fluid/operators/controlflow/while_op.cc
浏览文件 @
06f8aa5b
...
...
@@ -365,51 +365,7 @@ class WhileGradOpDescMaker : public framework::SingleGradOpDescMaker {
// while operator could be renamed.
while_grad
->
SetAttr
(
"original_output_grad"
,
output_grads_list
);
/* The following codes are used in eager deletion mode */
std
::
unordered_set
<
std
::
string
>
bwd_skip_vars
;
if
(
framework
::
GetEagerDeletionThreshold
()
>=
0
)
{
std
::
unordered_set
<
std
::
string
>
fwd_skip_vars
;
for
(
auto
*
op_desc
:
grad_block
->
AllOps
())
{
auto
skippable
=
[
&
](
const
std
::
string
&
name
)
{
return
!
grad_block
->
HasVar
(
name
)
&&
(
fwd_block
->
HasVarRecursive
(
name
)
||
parent_block
->
HasVarRecursive
(
name
));
};
for
(
auto
&
in_arg_name
:
op_desc
->
InputArgumentNames
())
{
if
(
skippable
(
in_arg_name
))
{
fwd_skip_vars
.
insert
(
in_arg_name
);
}
}
for
(
auto
&
out_arg_name
:
op_desc
->
OutputArgumentNames
())
{
if
(
skippable
(
out_arg_name
))
{
fwd_skip_vars
.
insert
(
out_arg_name
);
}
}
}
if
(
!
fwd_skip_vars
.
empty
())
{
// FIXME(zjl): ugly const_cast here, maybe we should find a better way
// to modify forward while_op
auto
&
fwd_while_op
=
const_cast
<
framework
::
OpDesc
&>
(
ForwardOp
());
fwd_while_op
.
SetAttr
(
kSkipEagerDeletionVars
,
std
::
vector
<
std
::
string
>
(
fwd_skip_vars
.
begin
(),
fwd_skip_vars
.
end
()));
}
// Find backward skip vars
auto
fwd_input
=
Input
(
kX
);
for
(
size_t
i
=
0
;
i
<
igs
.
size
();
++
i
)
{
if
(
igs
[
i
]
==
framework
::
kEmptyVarName
)
{
continue
;
}
bwd_skip_vars
.
insert
(
igs
[
i
]);
bwd_skip_vars
.
insert
(
framework
::
GradVarName
(
fwd_input
[
i
]));
}
}
while_grad
->
SetAttr
(
kSkipEagerDeletionVars
,
std
::
vector
<
std
::
string
>
(
bwd_skip_vars
.
begin
(),
bwd_skip_vars
.
end
()));
while_grad
->
SetAttr
(
kSkipEagerDeletionVars
,
std
::
vector
<
std
::
string
>
());
return
std
::
unique_ptr
<
framework
::
OpDesc
>
(
while_grad
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录