Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

[Add Pass] CommonSubexpressionElimination #1116

Merged
merged 28 commits into from
Jan 19, 2023

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Dec 14, 2022

@zrr1999 zrr1999 marked this pull request as ready for review December 14, 2022 18:27
@zrr1999 zrr1999 changed the title add CSE pass Add CommonSubexpressionElimination Pass Dec 15, 2022
@zrr1999
Copy link
Member Author

zrr1999 commented Dec 15, 2022

@SunNy820828449 @thisjiang 麻烦帮忙review一下

@SunNy820828449
Copy link
Collaborator

SunNy820828449 commented Dec 16, 2022

@SunNy820828449 @thisjiang 麻烦帮忙review一下

好的 你这个是基于frontend的pass,你可以参看一下文档,尝试开发基于hlir的pass,我们是希望把pass尽量放到hlir上实现。

@zrr1999
Copy link
Member Author

zrr1999 commented Dec 16, 2022

@SunNy820828449 @thisjiang 麻烦帮忙review一下

好的 你这个是基于frontend的pass,你可以参看一下文档,尝试开发基于hlir的pass,我们是希望把pass尽量放到hlir上实现。

好的,我去看看

@zrr1999
Copy link
Member Author

zrr1999 commented Dec 16, 2022

@SunNy820828449 @thisjiang 麻烦帮忙review一下

好的 你这个是基于frontend的pass,你可以参看一下文档,尝试开发基于hlir的pass,我们是希望把pass尽量放到hlir上实现。

我已经改成基于 hlir 的,麻烦再帮忙review一下

@SunNy820828449
Copy link
Collaborator

适当增加一些注释,方便其他人阅读。

@zrr1999
Copy link
Member Author

zrr1999 commented Jan 11, 2023

适当增加一些注释,方便其他人阅读。

好的,已经在关键的分支处加入了一些注释

cinn/runtime/flags.cc Show resolved Hide resolved
cinn/hlir/pass/common_subexpression_elimination.cc Outdated Show resolved Hide resolved
cinn/hlir/pass/common_subexpression_elimination.cc Outdated Show resolved Hide resolved
cinn/hlir/pass/common_subexpression_elimination.cc Outdated Show resolved Hide resolved
@zrr1999
Copy link
Member Author

zrr1999 commented Jan 17, 2023

因为transpose的参数命名存在一些问题,axis应该是一个整数,向量格式应该用axes或者perm,在最新版的Paddle中是统一使用的perm,所以我把CINN 里transpose的axis也全部修改为了perm

好像不止transpose存在这个问题

@zrr1999
Copy link
Member Author

zrr1999 commented Jan 17, 2023

现在special_attrs部分改成了暂时不对axis和dim进行处理

std::unordered_map<std::string, int> special_attrs = {
    //    {"axis", 1}, // due to the issue in some ops
    //    {"dim", 1}, // due to the issue in some ops
    {"axes", 2},
    {"perm", 2}
};

Copy link
Collaborator

@SunNy820828449 SunNy820828449 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1
Copy link
Collaborator

luotao1 commented Jan 18, 2023

cinn-ci 流水线失败

2023-01-18 11:15:57 The following tests FAILED:
2023-01-18 11:15:57 	119 - test_common_subexpression_elimination (Child aborted)

@zrr1999 zrr1999 changed the title Add CommonSubexpressionElimination Pass [Add Pass] CommonSubexpressionElimination Jan 18, 2023
@zrr1999
Copy link
Member Author

zrr1999 commented Jan 18, 2023

cinn-ci 流水线失败

2023-01-18 11:15:57 The following tests FAILED:
2023-01-18 11:15:57 	119 - test_common_subexpression_elimination (Child aborted)

我重启了一下,现在通过了,好像是因为我在前一个ci结束前提交了新的代码

@lanxianghit lanxianghit merged commit b9d799b into PaddlePaddle:develop Jan 19, 2023
@luotao1
Copy link
Collaborator

luotao1 commented Jan 19, 2023

@zrr1999 后续PR描述部分还是尽量写清楚,不是一定要求写很多,能简明表达PR实现的功能就行,这个只贴了一个整体任务的页面,不仔细看都不知道具体做的哪个任务。

@zrr1999
Copy link
Member Author

zrr1999 commented Jan 19, 2023

@zrr1999 后续PR描述部分还是尽量写清楚,不是一定要求写很多,能简明表达PR实现的功能就行,这个只贴了一个整体任务的页面,不仔细看都不知道具体做的哪个任务。

好的,买白了

CtfGo added a commit that referenced this pull request Jan 29, 2023
SunNy820828449 pushed a commit that referenced this pull request Jan 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants