[TUTORIAL][ANSOR] Using the template-free auto-scheduler on CPU#6488
[TUTORIAL][ANSOR] Using the template-free auto-scheduler on CPU#6488merrymercy merged 8 commits intoapache:masterfrom
Conversation
bd9c903 to
48aa0e9
Compare
| ) | ||
|
|
||
|
|
||
| def create_task(func, args, target, target_host=None, hardware_params=None): |
There was a problem hiding this comment.
I'm thinking about what's the different of calling SearchTask() directly, seems they just have different input parameters.
I notice that AutoTVM used an api of autotvm.task.create(), should we keep them the same?
Anyway, it's fine since we may continue to refine our APIs later.
There was a problem hiding this comment.
Python does not support constructor overloading, so I have to create a new function for this.
I think both auto_scheduler.create_task and auto_scheduler.task.create are okay.
tmoreau89
left a comment
There was a problem hiding this comment.
Nice work! I've only left cosmetic comments.
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
tmoreau89
left a comment
There was a problem hiding this comment.
Thanks @merrymercy LGTM
mbaret
left a comment
There was a problem hiding this comment.
I've just had a quick play around with this tutorial and it looks good to me. There is one thing I wonder though, which is that even when I boost the number of trials it never seems to decide to inline the bias add (x86). Is this a limitation of Ansor or is inlining just not performant here?
|
@mbaret Good catch! It is actually a small bug introduced during the upstream. Now the bug is fixed and you can give it another try. |
59583c7 to
5cad061
Compare
|
Ah nice, it's working as I expected now. |
| # We can kick off the search and let the auto-scheduler do its magic. | ||
| # After some measurement trials, it will return the best schedule it found. | ||
|
|
||
| sch, args = auto_scheduler.auto_schedule(task, tuning_options=tune_option) |
There was a problem hiding this comment.
It'd be nice to briefly describe what the return values of sch and args are here. I'm assuming that sch is a schedule, but is it encoded in TIR, or some other data structure? Same with args.
There was a problem hiding this comment.
If you check the doc string of the auto_scheduler.auto_schedule(), you'll find the explaination of the return values: A te.schedule and the a list of te.Tensor to be used in tvm.lower or tvm.build.
There was a problem hiding this comment.
I merged this first and will see whether the docstring link on the tvm website works.
If it is not working, I can add more explanations in the next PR, which is a similar tutorial for GPU.
…he#6488) * add tutorial * add tutorial * update * Apply suggestions from code review Co-authored-by: Cody Yu <comaniac0422@gmail.com> * address comments * fix bugs * add the exmple for resuming the search * fix lint Co-authored-by: Cody Yu <comaniac0422@gmail.com>
…he#6488) * add tutorial * add tutorial * update * Apply suggestions from code review Co-authored-by: Cody Yu <comaniac0422@gmail.com> * address comments * fix bugs * add the exmple for resuming the search * fix lint Co-authored-by: Cody Yu <comaniac0422@gmail.com>
…he#6488) * add tutorial * add tutorial * update * Apply suggestions from code review Co-authored-by: Cody Yu <comaniac0422@gmail.com> * address comments * fix bugs * add the exmple for resuming the search * fix lint Co-authored-by: Cody Yu <comaniac0422@gmail.com>
Add a tutorial on how to auto-schedule a subgraph for CPU.
Any feedback on the API is welcomed.
cc @jcf94 @tqchen @junrushao1994 @comaniac @jwfromm