-
Notifications
You must be signed in to change notification settings - Fork 4
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
template matching: only look at the inner dims of the schedule #351
Conversation
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.
Looks good!
tests/ir/dart/test_access_pattern.py
Outdated
sp_non_matching_pattern = SchedulePattern( | ||
bounds, | ||
AffineMap( | ||
num_dims=2, num_symbols=0, results=(AffineDimExpr(1), AffineDimExpr(0)) | ||
), | ||
) | ||
assert tp.matches(sp_non_matching_pattern) is False | ||
|
||
# check pattern with wrong bounds (should be irellevant for template check) |
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.
# check pattern with wrong bounds (should be irellevant for template check) | |
# check pattern with wrong bounds (should be irrelevant for template check) |
compiler/ir/dart/access_pattern.py
Outdated
@@ -196,6 +196,8 @@ def matches(self, sp: SchedulePattern): | |||
Check if a given schedule pattern matches this | |||
template pattern. | |||
""" | |||
if sp.num_dims > self.num_dims: | |||
sp = sp.inner_dims(self.num_dims) | |||
if sp.num_dims != self.num_dims: |
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.
maybe make this more explicit?
if sp.num_dims != self.num_dims: | |
elif sp.num_dims < self.num_dims: |
a04dc2b
to
d08edb2
Compare
stacked on #349
with this PR, when doing a template check with a template and a schedule, previously they are forced to the same number of dims. This PR checks if the schedule has larger dimensionality than the template, and reduces it to the number of dims of the template in this case.