-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ControlFlow] replace executor in run method of control flow ops with standalone_executor #45696
[ControlFlow] replace executor in run method of control flow ops with standalone_executor #45696
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… print for program
… replace_control_flow_executor
… replace_control_flow_executor
…must exist in global scope
… replace_control_flow_executor
… replace_control_flow_executor
paddle/fluid/framework/new_executor/interpreter/interpreter_util.cc
Outdated
Show resolved
Hide resolved
1. remove flag use in conditional_block_op 2. pass execution_config to BuildOpFuncList instead of individual parameter
paddle/fluid/framework/new_executor/interpreter/interpreter_util.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
OPs
Describe
The main content of this pr is to replace executor in run method of conditional block op with standalone_executor. The changes are mainly about two parts:
ConditionalBlockOp
andInterpreterCore
.ConditionalBlockOp
Executor
inRunImpl
withInterpreterCore
std::shared_ptr<InterpreterCore> core
to cacheFLAGS_control_flow_use_new_executor
to decide whether useInterpreterCore
scope
every times executingConditionalBlockOp::RunImpl
, only when the cachedscope
is invalidInterpreterCore
will rebuild and reset scope. The scope that was used to initialized it may be invalid, since it may be dropped by outer executor.InterpreterCore
used_for_control_flow_op
for the initialization ofInterpreterCore
need_fetch
inInterpreterCore::Run
interpretercore_utils.cc::BuildVariableScope
should put persistent variables in global scope, which is the root of the scope tree.interpretercore_util.cc::BuildVariableMap
, some inputs or outputs of op in the control flow block is recorded in outer block, so the corresponding variables should be queried recursively.transfer_layout
really. We simply callmemcpy
instead.