-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[AutoScheduler] Update layout rewrite option setting for measuring #7156
Conversation
Will update the log version after #7144 since this PR has modified the log structure of SearchTask. |
@@ -245,15 +254,18 @@ def tune(self, tuning_options, search_policy=None): | |||
|
|||
_ffi_api.AutoSchedule(search_policy, tuning_options) | |||
|
|||
def apply_best(self, log_file, layout_rewrite_option=None): | |||
def apply_best(self, log_file, layout_rewrite_option=LayoutRewriteOption.NO_REWRITE): |
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.
Out of scope: Is it possible to maintain the layout rewrite option in the record? This semantic indicates that you need to know the right layout rewrite option when you want to apply a tuned log.
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.
Emm ... Then we should also add this to maybe MeasureInput? I'm thinking this may not be so necessary, since we'll always try to apply layout rewrite on network, and this API may only be used in the replying of standalone ops. The user of this API should know what this means.
a80dec7
to
cee5dd0
Compare
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.
LGTM
new_attrs.Set("ori_placeholder_layout", tvm::String(origin_layout)); | ||
new_attrs.Set("new_placeholder_layout", tvm::String(new_layout)); |
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.
Delete this?
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 would need to get the layout information when exporting the kernel to run in an environment outside the tvm.
Emm... it's also fine to remove them here.
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.
Ok. We can leave them here
…pache#7156) * Add layout rewrite options for measure * Update schedule for inserted transform stage * Set layout rewrite when tuning for network * Update the log version
…pache#7156) * Add layout rewrite options for measure * Update schedule for inserted transform stage * Set layout rewrite when tuning for network * Update the log version
…pache#7156) * Add layout rewrite options for measure * Update schedule for inserted transform stage * Set layout rewrite when tuning for network * Update the log version
…pache#7156) * Add layout rewrite options for measure * Update schedule for inserted transform stage * Set layout rewrite when tuning for network * Update the log version
AutoScheduler uses a cost model to guide the search search.
We now have NO_REWRITE, INSERT_TRANSFORM_STAGE, REWRITE_FOR_PRE_TRANSFORMED three options when applying schedule from AutoScheduler.
In my tests, if we set REWRITE_FOR_PRE_TRANSFORMED in program measuring, the final schedule we get will trend to perform better in REWRITE_FOR_PRE_TRANSFORMED mode. Though this schedule also works in other options, it will not perform the best performance if we would like to get a kernel with NO_REWRITE.
This PR:
python/tvm/topi/x86/injective.py
.cc @merrymercy @comaniac