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

[Codegen] Sprinkle in PropagateDispatchSizeBounds passes #19677

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

krzysz00
Copy link
Contributor

Since the various tiling and distribution don't know how to set the upper bounds on workitem or workgroup IDs - even if that information is known from context, we use the PropagateDispatchSizeBounds pass to add that information before passes that use it.

The mani passes that use this information are those that use the ValueBoundsOpInterface - that is, loop invariant code motion, some vectorization code, and, in an upcoming commit,
RemoveSingleIterationLoop.

These calls can be removed in the future, but they'll do for now.

Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

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

LGTM

Add a model of ValueBoundsOpInterface (the one used for reasoning
about affine maps and loops) to the HAL ID ops and util.assume.int to
improve both loop invariant code motion and, in the future,
single-iteration loop removal.
@krzysz00 krzysz00 force-pushed the users/krzysz00/value-bound-hal-ops branch from 6cdfa93 to 6c59ac1 Compare January 18, 2025 03:32
Since the various tiling and distribution don't know how to set the
upper bounds on workitem or workgroup IDs - even if that information
is known from context, we use the PropagateDispatchSizeBounds pass to
add that information before passes that use it.

The mani passes that use this information are those that use the
ValueBoundsOpInterface - that is, loop invariant code motion, some
vectorization code, and, in an upcoming commit,
RemoveSingleIterationLoop.

These calls can be removed in the future, but they'll do for now.
@krzysz00 krzysz00 force-pushed the users/krzysz00/propagate-dispatch-sizes-everywhere branch from 3c1b7ec to 6d06506 Compare January 18, 2025 03:33
Base automatically changed from users/krzysz00/value-bound-hal-ops to main January 20, 2025 17:19
@krzysz00 krzysz00 enabled auto-merge (squash) January 20, 2025 17:37
@krzysz00 krzysz00 merged commit 9aae362 into main Jan 20, 2025
38 checks passed
@krzysz00 krzysz00 deleted the users/krzysz00/propagate-dispatch-sizes-everywhere branch January 20, 2025 17:40
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.

2 participants