leandron commented on a change in pull request #8086:
URL: https://github.com/apache/tvm/pull/8086#discussion_r636280545
##########
File path: python/tvm/driver/tvmc/compiler.py
##########
@@ -40,35 +40,42 @@
def add_compile_parser(subparsers):
""" Include parser for 'compile' subcommand """
- parser = subparsers.add_parser("compile", help="compile a model")
+ parser = subparsers.add_parser("compile", help="compile a model.")
parser.set_defaults(func=drive_compile)
parser.add_argument(
"--cross-compiler",
default="",
- help="the cross compiler to generate target libraries, e.g.
'aarch64-linux-gnu-gcc'",
+ help="the cross compiler to generate target libraries, e.g.
'aarch64-linux-gnu-gcc'.",
)
parser.add_argument(
"--desired-layout",
choices=["NCHW", "NHWC"],
default=None,
- help="change the data layout of the whole graph",
+ help="change the data layout of the whole graph.",
)
parser.add_argument(
"--dump-code",
metavar="FORMAT",
default="",
- help="comma separarated list of formats to export, e.g. 'asm,ll,relay'
",
+ help="comma separated list of possible formats to export the input
model, e.g. 'asm,ll,relay'.",
)
parser.add_argument(
"--model-format",
choices=frontends.get_frontend_names(),
- help="specify input model format",
+ help="specify input model format.",
+ )
+ parser.add_argument(
+ "-f",
+ "--output-format",
+ choices=["so", "mlf"],
+ default="so",
+ help="output format. Use 'so' for shared object or 'mlf' for Model
Library Format (only for µTVM targets).",
Review comment:
```suggestion
help="output format. Use 'so' for shared object or 'mlf' for Model
Library Format (only for µTVM targets). Defaults to 'so'",
```
##########
File path: python/tvm/driver/tvmc/model.py
##########
@@ -53,6 +53,7 @@
from tvm import relay
from tvm.contrib import utils
from tvm.relay.backend.executor_factory import GraphExecutorFactoryModule
+from tvm.micro import export_model_library_format
Review comment:
It seems this is the only hard dependency on micro. In case the
developer build their TVM with `USE_MICRO OFF`, this throws an error.
I **suggest** we lazy load that just before line 270 and throw a message in
case the import fails, such as "TVM was build without MicroTVM support. Please
make sure TVM was build with `USE_MICRO ON`.".
As a side effect of this PR, I think it makes sense to adjust the TVM
packaging project to build TVM with USE_MICRO ON, as we expect `tvmc` users are
likely to also install TVM using the package.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]