This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
[Add Pass] CommonSubexpressionElimination #1166
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
@zrr1999 请解决下冲突 |
好的,已修复 |
另外你这个实现的整体逻辑还是太复杂了,你把这个问题想简单一点,NodeData作为输入,后面链接几个Node,你只需要对后面Node进行去重,然后更新graph就可以了,然后循环对整个图进行这样的处理,不用建立map等这种复杂的数据结构,你再理理思路。 |
因为我不太确定后期会添加的其他算子,他们的attr是什么样的,如果每个特殊新算子在attr判断等效时直接通过判断算子名称,感觉似乎会更麻烦一些 |
201716010711
reviewed
Feb 3, 2023
SunNy820828449
approved these changes
Feb 16, 2023
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复 #1164 提到的两个随机错误
主要修改 cinn/hlir/pass/common_subexpression_elimination.cc 中的两处
store_nodes
时导致的死循环。(232行)