-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow divide_dim to divide to non-literal expressions #628
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #628 +/- ##
=======================================
Coverage 87.00% 87.01%
=======================================
Files 94 94
Lines 21814 21838 +24
=======================================
+ Hits 18979 19002 +23
- Misses 2835 2836 +1 ☔ View full report in Codecov by Sentry. |
@@ -1372,8 +1372,6 @@ def divide_dim(proc, alloc_cursor, dim_idx, quotient): | |||
`x : R[n, 3, 4, m]` | |||
`x[i, j / 4, j % 4, k] = ...` | |||
""" | |||
if quotient == 1: |
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.
Can you change the docstring above "This limited implementation of divide_dim
requires that the dimension being divided is constant itself." ?
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.
Done!
@@ -728,25 +768,10 @@ def ceildiv(lhs, rhs): | |||
elif tail_strategy in ["cut", "cut_and_guard"]: | |||
outer_hi = szop("/", N, inner_hi) # floor div | |||
elif tail_strategy == "perfect": | |||
if not isinstance(N, LoopIR.Const): |
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.
This is great!
src/exo/LoopIR_scheduling.py
Outdated
if isinstance(quot, int): | ||
quot_int = quot | ||
quot_ir = LoopIR.Const(quot, e.type, e.srcinfo) | ||
elif isinstance(quot, LoopIR.expr): |
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.
This should be elif isinstance(quot, LoopIR.Const):
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.
Good catch!
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 as long as the docstring and the elif isinstance(quot, LoopIR.Const):
thing is fixed
No description provided.