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
[PatternLang] The pattern failed to match some subgraphs in a model #5928
Comments
I'll try to reproduce, thanks for filing the issue! |
This isn't making much sense to me, it looks like a few of the batch_norm call nodes are duplicated, i.e., exactly the same object. The partition pass is refusing to fuse the same op into two different graphs, cause that would be bad. |
Yeah it should not be a case for MobileNet model. MobileNet model should be a single dataflow pipeline without branches and residual connections. |
Found it: The original model has this:
and later:
|
It should probably just be:
To get the behavior you want. So...Relay level CSE? I'm going to double check the partition rejection logic, I'm not sure that 100% works right now, I think I might be partitioning one of those when I shouldn't. |
Ah apparently I was wrong. MobileNet has residual connections...I see. So |
I guess an ideal solution would be trying to figure out those two matches are duplicated and reuse the first partitioned function for the second match? But this would look like an ad hoc solution targeting to Relay graph with duplicated nodes... |
Yes. I think the right solution is CSE, but that is at lot of work. |
Those two PRs plus this change to the script fixes the issue for me:
|
Pointed out by @trevor-m, the following case that uses a
batch_norm -> get(0)
to match MobileNet V2, but some subgraphs were failed to be matched and partitioned.Here is a log snippet:
As can be seen,
batch_norm
%20
and%28
were successfully matched and partitioned, but%25
wasn't. It seems to me that they are all the same, tho.@mbrookhart could you help take a look? Thanks
The text was updated successfully, but these errors were encountered: