Skip to content

Conversation

@Lunderberg
Copy link
Contributor

Prior to this commit, pattern matches were evaluated a single time, in the order of the block bindings. If a pattern rewrite produced a node which would also match the pattern (e.g. recursive reordering), the pattern would still only be evaluated once.

This commit updates PatternMatcher to iterate until convergence when provided with a pattern, analogous to its current behavior when called through rewrite_bindings.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Aug 6, 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

@Lunderberg Lunderberg force-pushed the pattern_match_rewrite_call_recursive branch from a4125ec to 896d058 Compare August 6, 2023 20:22
Prior to this commit, pattern matches were evaluated a single time, in
the order of the block bindings.  If a pattern rewrite produced a node
which would also match the pattern (e.g. recursive reordering), the
pattern would still only be evaluated once.

This commit updates `PatternMatcher` to iterate until convergence when
provided with a pattern, analogous to its current behavior when
called through `rewrite_bindings`.
@Lunderberg Lunderberg force-pushed the pattern_match_rewrite_call_recursive branch from 896d058 to 4da8f3c Compare August 7, 2023 20:43
Copy link
Contributor

@kparzysz-quic kparzysz-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add some guards against looping forever eventually in the fixed point rewriting.

@kparzysz-quic kparzysz-quic merged commit 61c693d into apache:unity Aug 10, 2023
@Lunderberg Lunderberg deleted the pattern_match_rewrite_call_recursive branch August 10, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants