-
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
[Generic] Forward MS and AS rewrites for generic schedules #13754
[Generic] Forward MS and AS rewrites for generic schedules #13754
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
cc @tkonolige |
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 don't think this is correct. Specifying need_meta_schedule_layout
should be set from the specific target strategy. Like here: https://github.com/apache/tvm/blob/main/python/tvm/relay/op/strategy/arm_cpu.py#L581-L582
7f9d161
to
42b78dd
Compare
Is the a concern of correctness or style? There is no target-specific strategy in this case (batch_matmul on arm) so it hits the generic strategies. |
Currently auto/metaschedule layout transform is enabled on a target-by-target basis. You're changing the default to be enabled for all targets that do not specify. In the past we've had some problems with layout transform not working on all targets, so I don't think this is a safe default. |
Hmm so my bug though has us hit a generic strategy, but metaschedule still rewrites the layout during tuning. During compilation step we get an error since the rewriting is not forwarded properly. Is layout rewriting also enabled on a per-target basis? Otherwise all targets which hit generic strategy will get same problem. |
For context: tuning-based layout rewriting on Relay is quite hacky and buggy because Relay is not designed to support this feature (even if it's necessary to deliver better performance). Relax natively supports this optimization and will be more likely to work decently. |
@tkonolige would you be fine if I made copies of the generic strategies for my target, and properly forward rewrite info there? We still have the problem with generic strategies getting rewritten, but my problem will be solved. |
Ah so chatting with @tkonolige and others a bit more, this problem is a bit more complicated and maybe exposes some past inconsistency with tvm.target.Target. Anyway, here are my findings.
Based on this here are future work:
|
#13775 <-- is probably the best solution to my problem for now. |
Hitting generic strategies for ARM targets, which don't properly forward layout rewrite info.