[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. |
| _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.
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.
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
| 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.
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.
…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