Skip to content
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

[CINN] Delele some redundant code #69031

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Oct 29, 2024

PR Category

CINN

PR Types

Devs

Description

Pcard-67164

清理CINN中冗余执行流程

Copy link

paddle-bot bot commented Oct 29, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Comment on lines 26 to 30

void Module::Builder::AddFunction(ir::LoweredFunc func) {
optim::Simplify(&(func->body));
optim::SimplifyForLoops(&(func->body));
optim::SimplifyBlocks(&(func->body));
func->body = optim::Optimize(func->body, module_->target);
module_->functions.push_back(func);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥删除啊,删了之后和AddFunctionWithoutOptim一样了,相当于是把Add的功能清晰化了?但是外面又没有补充优化的函数

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我想是不是把AddFunctionWithoutOptim也删了,要做什么优化由持有Function的人来做,不是由Module来做

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,感觉可以下个PR改一下,Module Module::Builder::Build()那里的优化也最好可以提出来

@zyfncg zyfncg merged commit 63b8765 into PaddlePaddle:develop Oct 30, 2024
28 checks passed
@zyfncg zyfncg deleted the clear_code branch October 30, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants