Generalised loop tiling with examples#3039
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3039 +/- ##
=======================================
Coverage 99.90% 99.90%
=======================================
Files 370 371 +1
Lines 52055 52085 +30
=======================================
+ Hits 52005 52035 +30
Misses 50 50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for contributing this @mn416, I gave you permissions to modify labels (you should recieve an invite). Add a test for the missing Code Coverage line and then mark this PR with the "Ready for Review" label. |
hiker
left a comment
There was a problem hiding this comment.
Thanks a lot for this, I have been wanting to implement something like your work forever :)
Besides the comment here (sorry, you are suffering a bit from a change of coding style and our 'you touch it, you update it' :) ), two more basic questions:
- Wouldn't it be a lot easier if the old 2d implementation would inherit directly from your new transpose (and just provides the right dimension sizes)
- You renamed the name of the tiling option (
tilesizebefore,tiledimsnow). I think it would be easier if you could use the same name (tiledims). This would make it easier to replace (at some time in the future) to deprecate the old implemenation entirely. Also, if the same names would be used and you use the inherit as suggested, you remove a lot of code duplication in the validation checks for the parameters.
|
@arporter, @sergisiso - I am wondering if we could consider either removing the old 2d-only tiling (which would require some small changes to existing scripts), or at least deprecating it (i.e. warning, but still works)? |
I am in favour of removing it (without a deprecation notice/period) since it is currently not being used in any production application. |
|
Thank you very much @hiker for the review. I am AFK for the rest of this week, but will respond and make the fixes next week, all being well. |
No rush, I have a few days off myself as well :) |
|
Thanks @hiker and @sergisiso. I've dropped |
|
An additional comment: we discussed this PR in our last telco, and agreed that we are happy to replace the old 2d transformation long term. Since we are not certain if people are using the 2d transformation, we don't want to just break compatibility with the next release, Could you add a depreciation warning to the 2d transformation as well? |
|
We just said in the previous comment that we would delete it :) I am fairly sure nobody uses it, and the update is very simple. I think we are just adding unnecessary complexity to keeping it around. |
|
@sergisiso I just added it back (with a deprecation warning) before I saw your comment! But it's easy for me to delete it again. @hiker can you confirm whether you would like |
|
I'm bringing this up-to-master, and will then trigger the CI. |
hiker
left a comment
There was a problem hiding this comment.
CI passed, all issues addressed. Proceeding to merge.
This PR generalises
LoopTiling2DTranstoLoopTilingTransby lifting restrictions on the number of dimensions of the tile and the sizes of those dimensions (they no longer have to be uniform). For backwards compatibility,LoopTiling2DTransremains but is now defined in terms ofLoopTilingTrans.This work was motivated by a simple example I was exploring for learning purposes: accelerating the matrix multiplication loop, which benefits from 3D tiling. This example is included in the PR, as well as a simpler example for matrix transposition, which only involves 2D tiling.