-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[MetaSchedule] Support schedules with cache read in RewriteLayout #13384
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f55bb8
Update RewriteLayout to support schedules with cache read
masahi 1a55c21
add test
masahi b5f98f6
add test for multiple cache read cast
masahi 0b71c1a
do not use vtcm
masahi ad04242
add comment
masahi 29aa4ee
black
masahi e91f675
Fix CreatePrimFunc for link-params=True case
masahi 405a3d4
fix te create_primfunc test
masahi 30199c3
revert change in update_cost_model.cc
masahi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix for
RewriteLayoutto work whenlink-params = True, the breakage discussed in #13195. With this, I confirmed that the newRewriteLayoutimplementation works when there isCacheReadacting onAllocateConst. I'm not adding a test since TVMScript parsing is broken when there isAllocateConstwith a large constant (can't print the whole array).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing the discussion from this thread.
I am convinced that we need to store buffers in block attributes for hexagon-specific usecases, and the only thing that I feel less natural is generally storing IR nodes in attributes. As an example, in
layout_free_placeholders, we didn't store any IR nodes in the attribute, but instead use a list of integers which is simpler.In the meantime, I completely understand that we need to get around this quickly, so in this particular case, how about adding or reusing a pass config flag, e.g. the one we are using "link-params", and only add enable
topi_attrto be set when the flag is on?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative idea: having an extra flag in
CreatePrimFuncthat instructs the translator to retain buffers in block annotation, and the flag is on only iflink-paramis detected as "on" in TECompiler.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
elsebranch is only hit when there is a layout-free buffer that's not passed as a parameter to the prim func. Currently that can only happen whenlink-params = True(this is exactly whatlink-paramsis meant for). So isn't having another flag redundant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. That makes perfect sense to me :-) As long as it's not affecting normal lowering flow, it looks like a good idea!