-
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
[AutoScheduler] Add custom build function #7185
Conversation
Signed-off-by: leowang1225 <[email protected]>
@merrymercy @FrozenGene please help to review! |
Signed-off-by: leowang1225 <[email protected]>
""" | ||
|
||
def __init__(self, timeout=15, n_parallel=multiprocessing.cpu_count(), build_func="default"): | ||
self.__init_handle_by_constructor__(_ffi_api.LocalBuilder, timeout, n_parallel, build_func) | ||
if build_func == "default": |
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.
So this is designed to use the class static member?
Why not just use a self.build_func
.
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.
when auto_scheduler.local_builder.build is called, the context can't get LocalBuilder class instance
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.
He should keep the state information of build_func
between functions, so just self.build_func
can not meet the requirement because we will create one class instance.
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.
@FrozenGene @leowang1225
Since we pass the BuildFunc.name
to the constructor, how about just register the custom build function by @tvm._ffi.register_func
and pass the fuction name to it?
In this way, it can be serialized in args in the local_build_worker
below.
Signed-off-by: leowang1225 <[email protected]>
Signed-off-by: leowang1225 <[email protected]>
@jcf94 could you have another one round of review? |
""" | ||
|
||
def __init__(self, timeout=15, n_parallel=multiprocessing.cpu_count(), build_func="default"): | ||
self.__init_handle_by_constructor__(_ffi_api.LocalBuilder, timeout, n_parallel, build_func) | ||
if build_func == "default": |
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.
@FrozenGene @leowang1225
Since we pass the BuildFunc.name
to the constructor, how about just register the custom build function by @tvm._ffi.register_func
and pass the fuction name to it?
In this way, it can be serialized in args in the local_build_worker
below.
Sorry for I'm a little busy this afternoon. |
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.
Currently I don't have any better suggestions.
Signed-off-by: leowang1225 <[email protected]>
Thanks for the great work @leowang1225 and thanks for the reviewing @jcf94 , it is merged now. |
* [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * cheduler] Add custom build function * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]>
* [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * cheduler] Add custom build function * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]>
* [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * cheduler] Add custom build function * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]>
* [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * cheduler] Add custom build function * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]>
* [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * cheduler] Add custom build function * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]> * [AutoScheduler] Add custom build function Signed-off-by: leowang1225 <[email protected]>
Signed-off-by: leowang1225 [email protected]
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.