Skip to content
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

Add build_create_shared_func to tvm/contrib/cc.py #3840

Merged
merged 1 commit into from Aug 29, 2019

Conversation

@apivovarov
Copy link
Contributor

commented Aug 27, 2019

This builder functions allows to build create_shared function with particular default options and compile_cmd.
Returned function can be used in autotune.LocalBuilder

Example:

# Create tuning_option for ARMv7 hf device (which does not have g++ installed)
from tvm.contrib import cc
build_func = cc.build_create_shared_func(compile_cmd="arm-linux-gnueabihf-g++")

tuning_option = {
    'tuner': 'xgb',
    'n_trial': 1500,
    'early_stopping': 800,

    'measure_option': autotvm.measure_option(
        builder=autotvm.LocalBuilder(
            build_func=build_func
        ),
        runner=autotvm.RPCRunner(
            device_key, host=tr_addr, port=tr_port,
            number=5,
            timeout=10,
        ),
    ),
}

The tuning_option above can be used to tune models for ARMv7 hf devices which does not have g++ installed. Auto-tuning a convolutional network for ARM CPU

Discussion - https://discuss.tvm.ai/t/lib-export-library-cc-param-was-renamed-to-compile-cmd/3644/3

@apivovarov

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

@weberlo Can you have a look?

@zhiics

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2019

LGTM. @merrymercy Can you take a look? Thanks.

Parameters
----------
options : List[str]
The list of additional options string.

This comment has been minimized.

Copy link
@weberlo

weberlo Aug 28, 2019

Contributor

Is this argument meant to specify a base of compiler options or a default set of compiler options. That meaning, if you pass in options=['a'], and the resulting create_shared_wrapper gets called with options=['b'], is the intent that options == ['a', 'b'] or options == ['b']? Because I think the code currently does the latter.

This comment has been minimized.

Copy link
@apivovarov

apivovarov Aug 28, 2019

Author Contributor

My intent was to havecreate_shared function builder which allows me to specify returned function default options and compile_cmd.

@merrymercy merrymercy merged commit 7391fc0 into dmlc:master Aug 29, 2019
5 checks passed
5 checks passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
windows_mac_build Build #20190827.7 succeeded
Details
windows_mac_build (MacOS_XCode9) MacOS_XCode9 succeeded
Details
windows_mac_build (Windows_VS2017_x64) Windows_VS2017_x64 succeeded
Details
windows_mac_build (Windows_VS2017_x86) Windows_VS2017_x86 succeeded
Details
@merrymercy

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

Thanks @apivovarov! It is merged

wweic added a commit to wweic/tvm that referenced this pull request Sep 16, 2019
wweic added a commit to wweic/tvm that referenced this pull request Sep 16, 2019
wweic added a commit to neo-ai/tvm that referenced this pull request Sep 16, 2019
@apivovarov apivovarov deleted the apivovarov:build_create_shared branch Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.