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

[IR&PASS] part 1: add pass base, pass manager, adaptor pass, ut #54023

Merged
merged 2 commits into from
May 26, 2023

Conversation

yuanlehome
Copy link
Contributor

@yuanlehome yuanlehome commented May 22, 2023

PR types

Others

PR changes

Others

Description

新IR下的新PASS体系,新PASS体系适配新IR。该系列PR主要包括如下几个部分:
主要包括四个部分:(1) Pass base & PassManager & PassAdaptor; #54023 (2) AnalysisManager & Pass Instrumentation (PassTiming, IRPrinting..); (3) Pattern Rewrite ... (4) 其他。

本PR完成第一部分,新增Pass基类,PassManager类以及PassAdaptor类。

@paddle-bot
Copy link

paddle-bot bot commented May 22, 2023

你的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.

@paddle-bot
Copy link

paddle-bot bot commented May 22, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@yuanlehome yuanlehome force-pushed the pass_infra_part_1 branch from 39e93a3 to ff6b3b6 Compare May 22, 2023 06:31
@yuanlehome yuanlehome marked this pull request as ready for review May 22, 2023 06:31
@yuanlehome yuanlehome force-pushed the pass_infra_part_1 branch 2 times, most recently from 75c363c to c50db71 Compare May 23, 2023 11:28
@yuanlehome yuanlehome changed the title [IR&PASS] add pass base and pass manager (PART I) [IR&PASS] part 1: add pass base, pass manager, adaptor pass, ut May 23, 2023
paddle/pass/utils.h Outdated Show resolved Hide resolved
paddle/pass/pass_manager.h Outdated Show resolved Hide resolved

ir::IrContext *GetContext() const { return context_; }

bool Run(ir::Operation *op);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里要讨论下是不是要加个Program的重载

adaptor_pass_ = std::make_unique<detail::AdaptorPass>(this);
}

bool PassManager::Run(ir::Operation* op) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里加一个Pass依赖检查吧,之前忘加了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后面PR加

// (4) Test pass manager for op.
ir::pass::PassManager pm(ctx);
pm.AddPass(std::make_unique<TestPass>());
CHECK_EQ(pm.Run(op), true);
Copy link
Contributor

Choose a reason for hiding this comment

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

PassManager应该run在顶层Program上(或者有block的op上),可以看下有没有Program的单测可以参考

Copy link
Contributor Author

Choose a reason for hiding this comment

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

后面PR做修改

@yuanlehome yuanlehome force-pushed the pass_infra_part_1 branch from b067197 to ae8cd4b Compare May 25, 2023 08:56
Copy link
Contributor

@jiweibo jiweibo left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants