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

transformations: Add support for strided MemRefs in 'load' and 'store' #2854

Merged
merged 27 commits into from
Jul 7, 2024

Conversation

zero9178
Copy link
Contributor

@zero9178 zero9178 commented Jul 6, 2024

The lowering previously assumed an identity layout and errored if a strided layout was present. Strided layouts are unfortunately very common as they are a direct result of tiling. This PR therefore adds support for them in both the store and load operations.

superlopuh and others added 19 commits July 4, 2024 22:46
Co-authored-by: Markus Böck <markus.boeck02@gmail.com>
The lowering previously assumed an identity layout and errored if a strided layout was present.
Strided layouts are unfortunately very common as they are a direct result of tiling. This PR therefore adds support for them in both the store and load operations.

As a side-effect, the `memref.subview` implementation could also be heavily simplified.
Copy link

codecov bot commented Jul 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.88%. Comparing base (23745a6) to head (c1478be).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2854      +/-   ##
==========================================
- Coverage   89.89%   89.88%   -0.01%     
==========================================
  Files         398      398              
  Lines       49659    49626      -33     
  Branches     7633     7634       +1     
==========================================
- Hits        44641    44607      -34     
- Misses       3821     3822       +1     
  Partials     1197     1197              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@superlopuh
Copy link
Member

Yeah this looks much better. I already pushed to the other branch, causing some conflicts. It seems like a strict improvement over my PR, so maybe you could retarget your changes to main, and then I can rebase whatever other positive changes I have in my PR on top of this one?

@zero9178
Copy link
Contributor Author

zero9178 commented Jul 6, 2024

Yeah this looks much better. I already pushed to the other branch, causing some conflicts. It seems like a strict improvement over my PR, so maybe you could retarget your changes to main, and then I can rebase whatever other positive changes I have in my PR on top of this one?

That's a good idea! I think your PR should then also support subviews of strided MemRefs.

Note that I actually found a discrepency in the generated code (final offset being added) between our two PRs that I have not yet figured out whose at fault. But we can figure this out in your PR.

@superlopuh
Copy link
Member

Sounds good. Please ping me when you've retargeted to main and the PR is ready for review. I'll then retarget mine.

Can try to hunt for bugs once everything is in order :)

zero9178 added 2 commits July 6, 2024 23:28
The lowering previously assumed an identity layout and errored if a strided layout was present.
Strided layouts are unfortunately very common as they are a direct result of tiling. This PR therefore adds support for them in both the store and load operations.

As a side-effect, the `memref.subview` implementation could also be heavily simplified.
@zero9178 zero9178 changed the base branch from sasha/riscv/lower-memref-subview to main July 6, 2024 22:35
@zero9178
Copy link
Contributor Author

zero9178 commented Jul 6, 2024

Sounds good. Please ping me when you've retargeted to main and the PR is ready for review. I'll then retarget mine.

Can try to hunt for bugs once everything is in order :)

Should be good to go now. Some small utils (the ShapedType stuff) are duplicated between our PRs but should be okay I hope

zero9178 added 3 commits July 7, 2024 10:33
strides are not allowed to cause "internal" aliasing.
@zero9178 zero9178 merged commit 215c230 into main Jul 7, 2024
10 checks passed
@zero9178 zero9178 deleted the zero9178/riscv/strided-load-store branch July 7, 2024 09:50
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