Uh oh!
There was an error while loading. Please reload this page.
[Unity] Support pattern-based rewriting - #14312
Conversation
tvm-bot
commented
Mar 15, 2023
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 |
ganler
left a comment
There was a problem hiding this comment.
LGTM. Just small comments on documentation improvements.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ganler
commented
Mar 15, 2023
Thanks for providing more examples and documentation. It looks great now! |
sunggg
left a comment
There was a problem hiding this comment.
Thank you so much for filling the missing piece!
LGTM.
One question. What happens if we try to rewrite to something invalid?
masahi
commented
Mar 16, 2023
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