[BYOC] Allow custom codegens to register their own constant updater#6697
Merged
zhiics merged 6 commits intoapache:mainfrom Oct 30, 2020
Merged
[BYOC] Allow custom codegens to register their own constant updater#6697zhiics merged 6 commits intoapache:mainfrom
zhiics merged 6 commits intoapache:mainfrom
Conversation
Contributor
Author
zhiics
reviewed
Oct 20, 2020
zhiics
reviewed
Oct 20, 2020
Contributor
Author
|
It seems the custom updater I registered in the test persists between tests in CI and causes failures. Is there a way to unregister a function? @tqchen |
Member
|
this is because pytest will run all testcases together, remove a global func exist in c++ API https://github.com/apache/incubator-tvm/blob/main/src/runtime/registry.cc#L77 we could expose that as a PackedFunc in tvm._ffi.remove_global_func(name) |
Currently, all codegens using BYOC must make use of the default ConstantUpdater pass. However, certain codegens, like Ethos-N, don't want to store any constants in metadata module. This provides an interface (via a global) to register a custom constant updating method and assigns a 'null' updater for the Ethos-N codegen. Change-Id: Ibd71d3091f992362eeede5d894eedb373b2dbc8f
Change-Id: I0ade81af9002d413c5b20a50488018e8cd8d8bad
Change-Id: Iea9ee0f689683512fa114afeadeccb7fc9048e4f
Change-Id: I8009940bb2ac949f2c3f0d72c943a5b74afd6954
Contributor
|
LGTM |
manupak
approved these changes
Oct 29, 2020
leandron
approved these changes
Oct 30, 2020
Contributor
leandron
left a comment
There was a problem hiding this comment.
It looks like there some CI issue within the validation of this PR, maybe just need to re trigger it.
FWIW, I successfully tested this locally on my machine to generate Ethos-N compiled modules.
Change-Id: I83c8c6f92cfe3be3a7e811e98a4eec17590186ff
zhiics
approved these changes
Oct 30, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 2, 2020
…pache#6697) * [BYOC] Allow custom codegens to register their own constant updater Currently, all codegens using BYOC must make use of the default ConstantUpdater pass. However, certain codegens, like Ethos-N, don't want to store any constants in metadata module. This provides an interface (via a global) to register a custom constant updating method and assigns a 'null' updater for the Ethos-N codegen. Change-Id: Ibd71d3091f992362eeede5d894eedb373b2dbc8f * Fix to use symbol in const name Change-Id: I0ade81af9002d413c5b20a50488018e8cd8d8bad * Remove ; Change-Id: I61967bc4997efb87f87b49dad7e0a660c536ef35 * Remove ccompiler constant updater Change-Id: Iea9ee0f689683512fa114afeadeccb7fc9048e4f * Unregister updater after test Change-Id: I8009940bb2ac949f2c3f0d72c943a5b74afd6954 * Create UpdateConstants utility function Change-Id: I83c8c6f92cfe3be3a7e811e98a4eec17590186ff
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 4, 2020
…pache#6697) * [BYOC] Allow custom codegens to register their own constant updater Currently, all codegens using BYOC must make use of the default ConstantUpdater pass. However, certain codegens, like Ethos-N, don't want to store any constants in metadata module. This provides an interface (via a global) to register a custom constant updating method and assigns a 'null' updater for the Ethos-N codegen. Change-Id: Ibd71d3091f992362eeede5d894eedb373b2dbc8f * Fix to use symbol in const name Change-Id: I0ade81af9002d413c5b20a50488018e8cd8d8bad * Remove ; Change-Id: I61967bc4997efb87f87b49dad7e0a660c536ef35 * Remove ccompiler constant updater Change-Id: Iea9ee0f689683512fa114afeadeccb7fc9048e4f * Unregister updater after test Change-Id: I8009940bb2ac949f2c3f0d72c943a5b74afd6954 * Create UpdateConstants utility function Change-Id: I83c8c6f92cfe3be3a7e811e98a4eec17590186ff
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Dec 4, 2020
…pache#6697) * [BYOC] Allow custom codegens to register their own constant updater Currently, all codegens using BYOC must make use of the default ConstantUpdater pass. However, certain codegens, like Ethos-N, don't want to store any constants in metadata module. This provides an interface (via a global) to register a custom constant updating method and assigns a 'null' updater for the Ethos-N codegen. Change-Id: Ibd71d3091f992362eeede5d894eedb373b2dbc8f * Fix to use symbol in const name Change-Id: I0ade81af9002d413c5b20a50488018e8cd8d8bad * Remove ; Change-Id: I61967bc4997efb87f87b49dad7e0a660c536ef35 * Remove ccompiler constant updater Change-Id: Iea9ee0f689683512fa114afeadeccb7fc9048e4f * Unregister updater after test Change-Id: I8009940bb2ac949f2c3f0d72c943a5b74afd6954 * Create UpdateConstants utility function Change-Id: I83c8c6f92cfe3be3a7e811e98a4eec17590186ff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, all codegens using BYOC must make use of the default ConstantUpdater pass. However, certain codegens, like Ethos-N, don't want to store any constants in metadata module. This provides an interface (via a global) to register a custom constant updating method and assigns a 'null' updater for the Ethos-N codegen.