-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[pass] Upgrade Constant Folding Pass #49908
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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
@@ -143,6 +143,10 @@ void ConstantFoldingPass::ApplyImpl(ir::Graph *graph) const { | |||
} | |||
out_desc->SetShape(out_shape); | |||
out_desc->SetPersistable(true); | |||
auto *var_desc_out = op_node->Op()->Block()->Var(out_name); |
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.
可能是由于 Program 和 Graph 两套 IR 没法无损转换导致的问题
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
Others
Describe
Pass optimizations may have motifications on Graph or ProgramDesc:
TensrRT op_teller uses the information of BlockDesc inside ProgramDesc. So we should make var in OP block persistable after Constant Folding pass.
Related PR:#48763 #45494