Skip to content

Conversation

@mgehre-amd
Copy link
Collaborator

When deciding whether to emit a map like
#map = affine_map<(d0, d1, d2, d3) -> (0, d1, d2, d3)> or #map = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)> for an operand of a linalg.generic when lowering element-wise TOSA ops, prefer the latter unless broadcasting of the operand is really needed.

This helps later transformations which often require the affine map to be a projected permuatation, which only the latter is.

@mgehre-amd mgehre-amd requested a review from josel-amd October 11, 2024 06:44
When deciding whether to emit a map like
`#map = affine_map<(d0, d1, d2, d3) -> (0, d1, d2, d3)>`
or `#map = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>`
for and operand of a linalg.generic when lowering element wise TOSA ops,
prefer the latter unless broadcasting of the operand is really needed.

This helps later transformations which often require the affine map to be
a projected permuatation, which only the latter is.
@mgehre-amd mgehre-amd force-pushed the matthias.tosa_prefer_identity_map branch from fd7da4a to e91175b Compare October 11, 2024 06:58
@josel-amd josel-amd merged commit 3cd352b into feature/fused-ops Oct 18, 2024
@josel-amd josel-amd deleted the matthias.tosa_prefer_identity_map branch October 18, 2024 15:06
mgehre-amd added a commit that referenced this pull request Jan 17, 2025
When deciding whether to emit a map like
`#map = affine_map<(d0, d1, d2, d3) -> (0, d1, d2, d3)>`
or `#map = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>`
for an operand of a `linalg.generic` when lowering element-wise TOSA ops,
prefer the latter unless broadcasting of the operand is really needed.

This helps later transformations which often require the affine map to be
a projected permuatation.
mgehre-amd added a commit that referenced this pull request Jan 17, 2025
When deciding whether to emit a map like
`#map = affine_map<(d0, d1, d2, d3) -> (0, d1, d2, d3)>`
or `#map = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>`
for an operand of a `linalg.generic` when lowering element-wise TOSA ops,
prefer the latter unless broadcasting of the operand is really needed.

This helps later transformations which often require the affine map to be
a projected permuatation.
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.

4 participants