rafzi commented on code in PR #14165:
URL: https://github.com/apache/tvm/pull/14165#discussion_r1142762861


##########
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:
   Alright, I can confirm this issue. The underlying issue is that the 
`TVMCSuppressedArgumentParser` still throws `SystemExit` when given such a 
command line. We also cannot override `error` of `ArgumentParser`, because the 
failing parser is the subparser, which is not a `TVMCSuppressedArgumentParser`.
   
   Before this patch, this problem already occurs. For example with `tvmc run 
--help`, `SystemExit` is thrown and a partial help message is printed (missing 
`--project-option`). So my suggested fix is to move the `parse_known_args` as 
far down as possible to yield a mostly complete help message.



-- 
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]

Reply via email to