> Do you envisage this having a similar API to the existing pass? In particular > it’s important for us to retain the added ‘check’ function to confirm whether > a match is valid.
Good point. We need to evaluate if the check function can be fully integrated into the pattern language. @mbrookhart FYI, one use case for the check function we are talking about is: https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_pass_merge_composite.py#L754 In short, it provides a packed function to match ops with specific attributes. I imagine this can be done by something like `is_op('nn.conv2d').has_attr(...)`, but I'm not sure how powerful `has_attr` can achieve. > Looking forward slightly, I do wonder whether it will start making sense to > instead of creating composite functions just directly insert the annotations > around the match. This would give us an opportunity to link up ‘composite’ > matches with single ops as it’s currently quite unintuitive that these two > things are treated so differently. Actually the plan Zhi and I originally have was similar to the one you are talking about. The concept of composite function should be merged to annotation target and the external codegen is in charge of replacing patterns with accelerator specific instructions. > I think it would be good to know the pattern matcher has the flexibility to > annotate rather than partition. However, that will be a more significant > change to the overall BYOC flow so the priority first should be just > replicating existing functionality as described in this RFC. I agree. We can first make the composite pass with pattern language anyhow. The composite function is being processed by every passes in BYOC infra already and we need to more time to carefully figure out how to use annotations to replace composite functions. --- [Visit Topic](https://discuss.tvm.ai/t/byoc-use-pattern-language-to-create-composite-functions/6727/19) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/bf40d8aa11ce69fdbf152b3bc97d43781fd1f387a991804cfac9c72d70c16671).