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 2-1: add analysis_manager, pass_instrumentation #54170

Merged
merged 1 commit into from
May 30, 2023

Conversation

yuanlehome
Copy link
Contributor

@yuanlehome yuanlehome commented May 29, 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..); #54170 (3) Pattern Rewrite ... (4) 其他。

本PR工作:

  1. 完成第2部分中的AnalysisManager体系,Pass Instrumentation基类(不包含PassTiming, IRPrinting)。
  2. 根据IR目录组织规范调整pass目录位置 ref to [IR] rectify the new ir folder #54124

TODO: add ut.

@paddle-bot
Copy link

paddle-bot bot commented May 29, 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 29, 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 changed the title [IR&PASS] part 2: add analysis_manager, pass_instrumentation, ut [IR&PASS] part 2-1: add analysis_manager, pass_instrumentation, ut May 29, 2023
@yuanlehome yuanlehome changed the title [IR&PASS] part 2-1: add analysis_manager, pass_instrumentation, ut [IR&PASS] part 2-1: add analysis_manager, pass_instrumentation May 29, 2023
@yuanlehome yuanlehome force-pushed the pass_infra_part_2 branch 3 times, most recently from 3a794d0 to 83ced29 Compare May 29, 2023 15:06
XieYunshen
XieYunshen previously approved these changes May 30, 2023
Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM
单测重命名


/// Invalidate any cached analyses based upon the given set of preserved
void Invalidate(const PreservedAnalyses& pa) {
PreservedAnalyses pa_copy(pa);
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO:@jiweibo.
这里的pa_copy我忘了为啥这样了,先合入,后续在修改这里吧。


bool Run(ir::Operation *op);
// bool Run(ir::Program *program) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: 等Program支持ModuleOp后 uncomment.

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.

ModuleOp合入后,这里改为Run(Program)的单测+Run(Operation with block)的单测


bool Initialize(ir::IrContext *context);
private:
bool Initialize(ir::IrContext *context) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

Initialize是为了调用Pass的Initialize,大概率会修改成员变量,const感觉应该去掉。
后面记得修改。@jiweibo @yuanlehome

}

bool CanScheduleOn(ir::Operation *op) const override {
return std::strcmp(op->op_info().name(), "TestDialect.TestOp") == 0;
}
};

TEST(pass_manager_test, pass_manager_test) {
TEST(pass_manager_test, pass_manager) {
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: @jiweibo @yuanlehome IR合入Region, Block后,补充多Block单测,通过Coverage覆盖率。

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.

3 participants