Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
8358d614
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8358d614
编写于
11月 15, 2021
作者:
W
wanghuancoder
提交者:
GitHub
11月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix 3 bug of new_executor (#37142)
* fix 3 bug, test=develop * refine, test=develop
上级
b628c316
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
20 addition
and
5 deletion
+20
-5
paddle/fluid/framework/new_executor/interpretercore.cc
paddle/fluid/framework/new_executor/interpretercore.cc
+3
-0
paddle/fluid/framework/new_executor/interpretercore_garbage_collector.cc
...amework/new_executor/interpretercore_garbage_collector.cc
+4
-0
paddle/fluid/framework/new_executor/interpretercore_util.cc
paddle/fluid/framework/new_executor/interpretercore_util.cc
+7
-1
paddle/fluid/framework/new_executor/new_executor_defs.cc
paddle/fluid/framework/new_executor/new_executor_defs.cc
+1
-1
paddle/fluid/framework/new_executor/new_executor_defs.h
paddle/fluid/framework/new_executor/new_executor_defs.h
+2
-0
python/paddle/fluid/executor.py
python/paddle/fluid/executor.py
+3
-3
未找到文件。
paddle/fluid/framework/new_executor/interpretercore.cc
浏览文件 @
8358d614
...
...
@@ -98,6 +98,9 @@ void InterpreterCore::Convert() {
for
(
auto
&
item
:
op_func_node
.
input_index
)
{
for
(
auto
id
:
item
.
second
)
{
if
(
id
==
kEmptyVarIndex
)
{
continue
;
}
input_var2op_info_
.
at
(
id
).
push_back
(
op_idx
);
// var can be gc-ed
if
(
!
info
.
IsBuilt
())
{
...
...
paddle/fluid/framework/new_executor/interpretercore_garbage_collector.cc
浏览文件 @
8358d614
...
...
@@ -60,6 +60,10 @@ void InterpreterCoreGarbageCollector::Add(
void
InterpreterCoreGarbageCollector
::
Add
(
paddle
::
framework
::
Variable
*
var
,
paddle
::
platform
::
DeviceEvent
&
event
,
const
platform
::
DeviceContext
*
ctx
)
{
if
(
!
var
)
{
return
;
}
if
(
var
->
IsType
<
LoDTensor
>
())
{
Add
(
var
->
GetMutable
<
LoDTensor
>
()
->
MoveMemoryHolder
(),
event
,
ctx
);
}
else
if
(
var
->
IsType
<
...
...
paddle/fluid/framework/new_executor/interpretercore_util.cc
浏览文件 @
8358d614
...
...
@@ -446,7 +446,13 @@ void build_op_func_list(const platform::Place& place,
VariableValueMap
ins_map
;
VariableIdMap
ins_name2id
;
bool
enforce_exist
=
true
;
if
(
op
->
Type
()
==
"recurrent_grad"
)
enforce_exist
=
false
;
if
(
op
->
Type
()
==
"recurrent_grad"
||
op
->
Type
()
==
"rnn_memory_helper"
||
op
->
Type
()
==
"rnn_memory_helper_grad"
||
op
->
Type
()
==
"conditional_block"
||
op
->
Type
()
==
"conditional_block_grad"
||
op
->
Type
()
==
"while"
||
op
->
Type
()
==
"while_grad"
)
{
enforce_exist
=
false
;
}
std
::
tie
(
ins_map
,
ins_name2id
)
=
build_variable_map
(
inputs_names
,
var_scope
,
enforce_exist
);
...
...
paddle/fluid/framework/new_executor/new_executor_defs.cc
浏览文件 @
8358d614
...
...
@@ -480,7 +480,7 @@ const std::vector<Variable*>& InterpretercoreInferShapeContext::OutputVars(
VariableScope
::
VariableScope
(
Scope
*
scope
)
{
// for @EMPTY@ variable
var_list_
.
push_back
(
nullptr
);
name2id_
[
kEmptyVarName
]
=
0
;
name2id_
[
kEmptyVarName
]
=
kEmptyVarIndex
;
vec_meta_info_
.
emplace_back
(
0
,
nullptr
);
scope_
=
scope
;
PADDLE_ENFORCE_NE
(
...
...
paddle/fluid/framework/new_executor/new_executor_defs.h
浏览文件 @
8358d614
...
...
@@ -43,6 +43,8 @@ using OpKernelComputeFunc = std::function<void(const ExecutionContext&)>;
using
OpKernelMap
=
std
::
unordered_map
<
OpKernelType
,
OpKernelComputeFunc
,
OpKernelType
::
Hash
>
;
constexpr
int
kEmptyVarIndex
=
0
;
class
InterpretercoreInferShapeContext
:
public
InferShapeContext
{
public:
InterpretercoreInferShapeContext
(
const
OperatorBase
&
op
,
...
...
python/paddle/fluid/executor.py
浏览文件 @
8358d614
...
...
@@ -598,13 +598,13 @@ class _ExecutorCache(object):
assert
isinstance
(
program
,
Program
),
"Required type(Program), but received {}"
.
format
(
type
(
program
).
__name__
)
if
program
not
in
self
.
_cached_executors
:
if
str
(
program
)
not
in
self
.
_cached_executors
:
new_program
=
program
.
clone
()
_prune_feed_ops
(
new_program
)
new_exe
=
_StandaloneExecutor
(
self
.
_place
,
new_program
,
scope
)
self
.
_cached_executors
[
program
]
=
new_exe
self
.
_cached_executors
[
str
(
program
)
]
=
new_exe
return
self
.
_cached_executors
[
program
]
return
self
.
_cached_executors
[
str
(
program
)
]
class
Executor
(
object
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录