@cron I think you’re asking about how to express a situation where a subgraph of two adjacent Relay operators may match two patterns in the graph partitioning logic. could you elaborate on the exact problem you’re having? I think the ordering logic should be sufficient to handle this, but it’d be good to understand your use case a bit further.
It’s worth mentioning that in the Ethos-U case, there are additional reasons to legalize into Ethos-U-specific Relay operators. Specifically, information is needed further down the compilation pipeline from that entire subgraph, and it’s only valid to drive the Ethos-U compilation pipeline with certain patterns of Relay operators and with certain arguments to those operators. So if I’m understanding your original question correctly, you could view the Ethos-U legalization as more of a sanity-check or input validation step rather than a workaround for a pattern-matcher limitation.
also cc @mbs-octoml @mbrookhart