[MetaSchedule] Use current pass context in compile_relay, extract_tasks#13470
[MetaSchedule] Use current pass context in compile_relay, extract_tasks#13470tkonolige wants to merge 2 commits intoapache:mainfrom
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 |
|
@junrushao @masahi This is a change to the API for compiling relay with metaschedule tuning. I believe it to be an improvement as it keeps the same passcontext api that is used in the rest of the codebase. |
Adds the pass config information necessary for tuning and compiling relay with metaschedule to the existing pass context instead of overriding the existing one. Allows users to pass in their own pass instruments, required passes, and disabled passes. This also keeps the same API used to compile relay with autotvm and auto_scheduler.
a50e95c to
b26d443
Compare
|
@junrushao @masahi any thoughts on this? The change is from to Although more verbose this mirrors the compilation process for non-metascheduled relay: |
|
They are intentionally designed this way to keep the primary APIs as simple as possible, for advanced usecases like you mentioned in this PR, please do not use |
|
@junrushao Isn't it actually simplifying the API? Also considering that this changes makes the MS API consistent with other tuner APIs, I think it is a good change. |
| ) | ||
| mod, target, params, executor = _normalize_params(mod, target, params, executor) | ||
| pass_ctx = transform.PassContext.current() | ||
| pass_config = dict(pass_ctx.config) |
There was a problem hiding this comment.
To prevent breaking user's script after this change, how about setting a default ctx with opt_level = 3 if there is no current ctx?
There was a problem hiding this comment.
Right now there is no way to determine whether or not if the current pass context is the default or not. It might be possible to add though.
It is not consistent with the rest of TVM to default the opt_level to 3 in meta schedule. Everywhere else defaults to 2. This does mean that we might break some user scripts.
Adds the pass config information necessary for tuning and compiling relay with metaschedule to the existing pass context instead of overriding the existing one. Allows users to pass in their own pass instruments, required passes, and disabled passes. This also keeps the same API used to compile relay with autotvm and auto_scheduler.