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

Use full slices when tiling by the full loop trip count (to support non-monotonic expressions) #468

Merged
merged 10 commits into from
Feb 13, 2025

Conversation

josel-amd
Copy link
Collaborator

@josel-amd josel-amd commented Feb 12, 2025

When tiling a chain of linalg.ops, we can only set the tile sizes of the first one to 0 to say untiled, but producers of it will get a tile size of <loop trip count>.
We must return the full slice in those case because the code that computes the slices sizes in the general case doesn't handle non-monotonic affine expressions.
Otherwise we would generate invalid code for non-monotonic expressions even if all involved dimensions are effectively untiled.

@josel-amd josel-amd changed the title Fix issues with tiling [WIP] Fix issues with tiling Feb 12, 2025
@josel-amd josel-amd force-pushed the jose.fix-tiling-problem branch from 57008e4 to e895262 Compare February 12, 2025 16:25
…op-nest.mlir:

The change to not slice when tiling with domain size caused a tensor.extract_slice
on %arg1 to disappear. The previous tensor.extract_slice was actually a noop:

%extracted_slice_1 = tensor.extract_slice %arg1[0, 0] [12, 25] [1, 1] : tensor<12x25xf32> to tensor<12x25xf32>

while %arg1 is defined as:  %arg1: tensor<12x25xf32>

Since the second operand of the matmul is no longer an extract slice but a block argument the emitted error
message also changed.
@josel-amd josel-amd force-pushed the jose.fix-tiling-problem branch from 1bc109b to 390a8e6 Compare February 13, 2025 08:13
@josel-amd josel-amd changed the title [WIP] Fix issues with tiling Fix issues with tiling Feb 13, 2025
@josel-amd josel-amd requested a review from mgehre-amd February 13, 2025 10:08
@mgehre-amd mgehre-amd changed the title Fix issues with tiling Use full slices when tiling by the full loop trip count (to support non-monotonic expressions) Feb 13, 2025
@josel-amd josel-amd force-pushed the jose.fix-tiling-problem branch from b02683d to 78da33c Compare February 13, 2025 12:23
@josel-amd josel-amd merged commit 479c8d6 into feature/fused-ops Feb 13, 2025
4 checks passed
@josel-amd josel-amd deleted the jose.fix-tiling-problem branch February 13, 2025 15:26
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