lhutton1 commented on code in PR #14165:
URL: https://github.com/apache/tvm/pull/14165#discussion_r1127741697
##########
python/tvm/driver/tvmc/compiler.py:
##########
@@ -40,17 +40,38 @@
from .transform import convert_graph_layout
from .shape_parser import parse_shape_string
from .workspace_pools import generate_workspace_pools_args,
workspace_pools_recombobulate
+from .extensions import load_extensions, get_extensions
+from .arguments import TVMCSuppressedArgumentParser
# pylint: disable=invalid-name
logger = logging.getLogger("TVMC")
@register_parser
-def add_compile_parser(subparsers, _, json_params):
+def add_compile_parser(subparsers, main_parser, json_params, argv):
"""Include parser for 'compile' subcommand"""
- parser = subparsers.add_parser("compile", help="compile a model.")
+ parser = subparsers.add_parser("compile", help="compile a model.",
add_help=False)
Review Comment:
I tried this out locally but see some difference in the help prompt when
executing `tvmc compile --help`. Before the patch we get something like:
```
$ tvmc compile --help
usage: tvmc compile [-h] [--cross-compiler CROSS_COMPILER]
[--cross-compiler-options CROSS_COMPILER_OPTIONS]
[--desired-layout {NCHW,NHWC}] [--dump-code FORMAT]
[--model-format
{keras,onnx,pb,tflite,pytorch,paddle,relay}]
[-o OUTPUT] [-f {so,mlf}] [--pass-config name=value]
[--target TARGET]
...
positional arguments:
FILE path to the input model file.
optional arguments:
-h, --help show this help message and exit
--cross-compiler CROSS_COMPILER
the cross compiler to generate target libraries, e.g.
'aarch64-linux-gnu-gcc'.
--cross-compiler-options CROSS_COMPILER_OPTIONS
the cross compiler options to generate target
libraries, e.g. '-mfpu=neon-vfpv4'.
--desired-layout {NCHW,NHWC}
change the data layout of the whole graph.
```
While after seems to lead to:
```
$ tvmc compile --help
usage: tvmc compile [--experimental-tvm-extension EXPERIMENTAL_TVM_EXTENSION]
[--cross-compiler CROSS_COMPILER]
[--cross-compiler-options CROSS_COMPILER_OPTIONS]
[--desired-layout {NCHW,NHWC}] [--dump-code FORMAT]
[--model-format
{keras,onnx,pb,tflite,pytorch,paddle,relay}]
[-o OUTPUT] [-f {so,mlf}] [--pass-config name=value]
[--target TARGET]
...
tvmc compile: error: the following arguments are required: FILE
```
Could you confirm if you see the same behaviour? I think it would be really
helpful if we can keep the argument descriptions as before
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]