-
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
[TVMC] Allow output module name to be passed as a command line argument #10962
Conversation
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.
@grant-arm thanks for this PR, looks great! a few minor comments, could be swayed either way on them (don't take my review as blocking)
@@ -202,6 +208,7 @@ def compile_model( | |||
pass_context_configs: Optional[List[str]] = None, | |||
additional_target_options: Optional[Dict[str, Dict[str, Any]]] = None, | |||
use_vm: bool = False, | |||
mod_name: Optional[str] = "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.
perhaps "default" should be a constant somewhere?
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.
Thanks @areusch , I agree it would be good to have "default" as a constant.
It feels like this should be a separate PR though.
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.
@grant-arm LGTM! Thanks for cc:ing me, I just learned about the different ACCEL_TYPES
:)
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.
LGTM!
681770c
to
b6435f1
Compare
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.
Looks good! :) Got a question about a test...
* Allows module-name as a command line argument to tvmc * Updates microNPU graph partitioner to pass module name to PartitionGraph() * Updates CMSIS-NN graph partitioner to pass module name to PartitionGraph() Change-Id: I12a4a2eef2ddc7e3c4a6c0dd8fdcab009c975bac
b6435f1
to
061f1ea
Compare
* main: (527 commits) [hexagon] 'add_hvx' test to explore HVX usage. (apache#10604) [COMMUNITY] @yzh119 -> Reviewer (apache#10993) [Metaschedule] Make custom schedule_rule registration optional (apache#10975) [ONNX] Add imports for BERT contrib operators (apache#10949) sort axes (apache#10985) [Hexagon] Remove HexagonBuffer external constructor and support (apache#10978) [CI] Update GPU image (apache#10992) [Runtime][Vulkan] Add RGP support to TVM for vulkan device (apache#10953) [FIX] resolve int64/32 for AttrStmtNode (apache#10983) [TVMC] Allow output module name to be passed as a command line argument (apache#10962) [ONNX] Add MatMulInteger importer (apache#10450) [COMMUNITY] @guberti -> Reviewer (apache#10976) Support `qnn.conv2d` in FoldExplicitPading (apache#10982) change Hexagon docker version (apache#10981) remove exception handling of autotvm xgboost extract functions (apache#10948) [CUDNN] Add partitioning support for conv2d and log_softmax (apache#10961) [Hexagon][LLVM] Enable/test tensorized Hexagon DMA on 2d transformed layout (apache#10905) [Hexagon] Move aot/graph_executor interactions into launcher (apache#10907) [HEXAGON] Split huge 1D DMA Transfers into smaller transfers with legal sizes. (apache#10971) [CI][DOCKER] Add pytest-lazy-fixture to images (apache#10970) ...
…nt (apache#10962) * Allows module-name as a command line argument to tvmc * Updates microNPU graph partitioner to pass module name to PartitionGraph() * Updates CMSIS-NN graph partitioner to pass module name to PartitionGraph() Change-Id: I12a4a2eef2ddc7e3c4a6c0dd8fdcab009c975bac
…nt (apache#10962) * Allows module-name as a command line argument to tvmc * Updates microNPU graph partitioner to pass module name to PartitionGraph() * Updates CMSIS-NN graph partitioner to pass module name to PartitionGraph() Change-Id: I12a4a2eef2ddc7e3c4a6c0dd8fdcab009c975bac
Currently there is no way to pass an output module name to tvmc on the command line when compiling a model.
This means that (for the use cases we are interested in) generated C code is always placed in files named
default_lib*.c
and that functions are namedtvmgen_default*()
.If we want to compile multiple models for use with a single application, the C source file names and function names are not unique, resulting in failure when building the generated C code.
This PR allows module-name to be passed to tvmc on the command line, for example:
In this case, the generated C code is placed in files named
classify_lib*.c
and functions are namedtvmgen_classify*()
.Additionally, this PR updates the microNPU and CMSIS-NN graph partitioners to pass the module name to PartitionGraph().
This is necessary to ensure that the C code function names generated for microNPU and CMSIS-NN include the module name and not
default
.@leandron @Mousius @manupa-arm @areusch
cc @gromero