-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Unity] Support pattern-based rewriting #14312
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
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
9514dc9 to
a9a6885
Compare
ganler
left a comment
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. Just small comments on documentation improvements.
|
Thanks for providing more examples and documentation. It looks great now! |
Hzfengsy
left a comment
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.
Really useful tools, thanks @masahi
sunggg
left a comment
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.
Thank you so much for filling the missing piece!
LGTM.
One question. What happens if we try to rewrite to something invalid?
Well, you'd just get an error somewhere, as with any other |
* stub * wip * works * restore binding * attention test work * use RemoveAllUnused * simplified callback api * pass original call node to callback * clean test * add doc * add test for the case where the original call is returned * callback -> rewriter and other doc improvement
* stub * wip * works * restore binding * attention test work * use RemoveAllUnused * simplified callback api * pass original call node to callback * clean test * add doc * add test for the case where the original call is returned * callback -> rewriter and other doc improvement
* stub * wip * works * restore binding * attention test work * use RemoveAllUnused * simplified callback api * pass original call node to callback * clean test * add doc * add test for the case where the original call is returned * callback -> rewriter and other doc improvement
* stub * wip * works * restore binding * attention test work * use RemoveAllUnused * simplified callback api * pass original call node to callback * clean test * add doc * add test for the case where the original call is returned * callback -> rewriter and other doc improvement
Currently, dataflow pattern matching in Relax only supports matching with boolean result and doesn't support rewriting matched expressions. This PR adds such utility following the Relay counterpart below (with a simpler API).
tvm/python/tvm/relay/dataflow_pattern/__init__.py
Line 884 in da99e9d
This is useful for, for example, rewriting a sequence of matmul -> softmax -> matmul into an attention op introduced in #14150.
@cyx-6 @sunggg @vinx13 @yelite @MasterJH5574 @spectrometerHBH @ganler