-
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
[AutoTVM] Enhance tuning space of split #3949
Conversation
- Rename policy "all" to "factors" - Add policy "verbose" and "power2"
@vinx13 @kevinthesun @icemelon9 please help review this PR. |
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.
If we use verbose mode, we should get most performance improvement for inceptionv3?
Maybe. I did see the schedule AutoTVM found for some shapes (not in Inception V3) uses a combination of factors and power of two. However, the tuning space grows rapidly and it requires longer search time or smarter search algorithm. |
Thanks @comaniac @kevinthesun This is merged |
* Refine policies for define_split - Rename policy "all" to "factors" - Add policy "verbose" and "power2" * Refine search space * add doc
* Refine policies for define_split - Rename policy "all" to "factors" - Add policy "verbose" and "power2" * Refine search space * add doc
* Refine policies for define_split - Rename policy "all" to "factors" - Add policy "verbose" and "power2" * Refine search space * add doc
Hi @comaniac , this is really interesting change. I have not read all the code, but may I ask that if the PR changes the split representation such that the highest split is left as PS. I didn't verify all the patches, but the change leading to my concern is among these below.
|
Yes, this PR also changes the leftmost split factor to -1, but it performs exactly the same behavior as before, because AutoTVM will automatically replace -1 with L/prod(others) when applying the split factor. The reason I made this change is that we are trying to apply a schedule config from one shape to another. For example, assuming we have a config Sorry if this change breaks your schedule. Since CI was passed before merging this PR, I suppose this change should not afffect any schedule in TOPI. |
Interesting feature, which came into my mind that I saw the recorded split factors. I think the side effects are worth... Thank you. |
This PR enhances the tuning space of split scheduling primitive. Originally, it only has two policies: "all" for all divisible factors of the dimension length; "candidate" for manual entities. The issue is that for irregualr shape like prime numbers or product of prime numbers (e.g., 229x229 in Inception V3), the "all" policy has less opportunities to achieve a better performance.
In this change, split now has four policies:
Note that we will still use "factors" policy as the default one so merging this PR will not change performance of TOPI ops at all, but users can have an option to search more values as they want, and this could benefit to the follow-up dynamic shape implementation.
I use Inception V3 to illustrate the benefit of using "power2" policy. Here is the result of 44 tasks of Inception V3 tuned with "factors" (default) and "power2" on AWS EC2 c5.9xlarge. For each task, the n_trial is set to 100 and minimum repeat ms is set to 1000. In summary, 22/44 tasks achieve better performance with "power2" policy, and the average speedup over "factors" is 1.03. Note that the speedup is more obvious in later layers which have more irregular shapes.