-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[ControlFlow] replace executor in run method of control flow ops with standalone_executor #45696
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
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:
ConditionalBlockOpandInterpreterCore.ConditionalBlockOpExecutorinRunImplwithInterpreterCorestd::shared_ptr<InterpreterCore> coreto cacheFLAGS_control_flow_use_new_executorto decide whether useInterpreterCorescopeevery times executingConditionalBlockOp::RunImpl, only when the cachedscopeis invalidInterpreterCorewill rebuild and reset scope. The scope that was used to initialized it may be invalid, since it may be dropped by outer executor.InterpreterCoreused_for_control_flow_opfor the initialization ofInterpreterCoreneed_fetchinInterpreterCore::Runinterpretercore_utils.cc::BuildVariableScopeshould 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_layoutreally. We simply callmemcpyinstead.