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

Relax affine #353

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Relax affine #353

merged 2 commits into from
Sep 19, 2024

Conversation

josel-amd
Copy link
Collaborator

No description provided.

@josel-amd josel-amd changed the title Relaxe affine Relax affine Sep 18, 2024
Copy link
Collaborator

@cferry-AMD cferry-AMD left a comment

Choose a reason for hiding this comment

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

We can introduce stuff that breaks affine semantics by doing that, so we should be very careful. We may need to revisit this with an analysis that checks which ops generated a dimension (so affine.for and affine.parallel iterators would be legal for instance, along with linalg.index, and at a later point also check for affinity of expressions to allow linear combinations of indices).

@josel-amd
Copy link
Collaborator Author

We can introduce stuff that breaks affine semantics by doing that, so we should be very careful. We may need to revisit this with an analysis that checks which ops generated a dimension (so affine.for and affine.parallel iterators would be legal for instance, along with linalg.index, and at a later point also check for affinity of expressions to allow linear combinations of indices).

I agree. I can imagine that this only works as long as you only do very limited things in the realm of the affine dialect, like lowering to another dialect. Other kinds of analysis and transformations might e.g. try to get the origin of the index and fail to infer the affinity of the value in the context of affine expressions. I hope this is only temporary until either 1) upstream properly fixes it or 2) we find a better way to achieve our goals as time goes by.

@josel-amd
Copy link
Collaborator Author

josel-amd commented Sep 19, 2024

In the spirit of what I said above, I already tried to contain the changes as much as possible by only modifying the affine.if and by making sure that I'm not skipping any other checks that were there before.

@josel-amd josel-amd merged commit 9054950 into feature/fused-ops Sep 19, 2024
4 checks passed
@josel-amd josel-amd deleted the jose-relax-affine-if branch September 19, 2024 11:08
@cferry-AMD
Copy link
Collaborator

I hope this is only temporary until either 1) upstream properly fixes it or 2) we find a better way to achieve our goals as time goes by.

It would take some time but upstream has made some moves to disconnect Linalg from affine (e.g. with the tiling interface: there are operations that are loops but have neither an affine schedule nor affine data access patterns, but can still be tiled). Something like an "affinity preserving" interface would then make sense.

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