Skip to content
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

Merged
merged 6 commits into from
Apr 27, 2024

Conversation

SamirDroubi
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 87.01%. Comparing base (0e2ec87) to head (df33a58).

Files Patch % Lines
src/exo/LoopIR_scheduling.py 87.50% 4 Missing ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

@@ -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:
Copy link
Member

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." ?

Copy link
Collaborator Author

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):
Copy link
Member

Choose a reason for hiding this comment

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

This is great!

if isinstance(quot, int):
quot_int = quot
quot_ir = LoopIR.Const(quot, e.type, e.srcinfo)
elif isinstance(quot, LoopIR.expr):
Copy link
Member

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):

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

@yamaguchi1024 yamaguchi1024 left a 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

@SamirDroubi SamirDroubi enabled auto-merge (squash) April 27, 2024 20:31
@SamirDroubi SamirDroubi merged commit 01a7db4 into main Apr 27, 2024
7 checks passed
@SamirDroubi SamirDroubi deleted the divide-expr-dim branch April 27, 2024 21:00
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