-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[PASS]fix conv_elementwise_tree_fuse_pass rm bug #6812
Conversation
Thanks for your contribution! |
@@ -146,9 +150,9 @@ void ConvElementwiseTreeFuser::InsertNewNode(SSAGraph* graph, | |||
} | |||
|
|||
// NOTE: Mark these node as intermediate at this place. |
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.
这里的NOTE同步也修改下吧
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.
OK
@@ -48,6 +60,7 @@ class ConvElementwiseTreeFuser : public FuseBase { | |||
PMNode* conv_output_; |
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.
这三个PMNode*
类型的成员变量可以去掉,改为临时变量。
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.
OK
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.
2个comments
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
【问题1】
在该 pass 中,需要限制 conv1x1 的输出 VarNode 只能有一个输出。当该 VarNode 有多个输出时,由于该 VarNode 被标记为了AsIntermediate,进而该 VarNode 被删除,导致该与该 VarNode 有连接关系的节点出现输入悬空状态,因此这时经 opt 转换输出的模型结构会出现问题。在 EfficientNetB0 模型上可以复现这个问题。
【解决方法】
对 conv1x1 的输出 VarNode 加上assert_only_one_output限制。
【效果】
可解决 EfficientNetB0 模型转换问题。
【问题2】
在对 HRNet_W18_C 模型进行 opt 转换时,图结果异常:有 5 个匹配 pattern,正常应该删除15个中间节点,但是删除了 39 个中间节点。
【解决方法】
该pass中将删除节点的操作从父类迁移到子类,删除节点操作不再依赖AsIntermediate()标记。
【效果】
可解决 HRNet_W18_C 模型转换问题。