leandron commented on a change in pull request #6302: URL: https://github.com/apache/incubator-tvm/pull/6302#discussion_r483509079
########## File path: python/tvm/driver/tvmc/compiler.py ########## @@ -0,0 +1,305 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +""" +Provides support to compile networks both AOT and JIT. +""" +import logging +import os.path +import tarfile +from pathlib import Path + +import tvm +from tvm import autotvm +from tvm import relay +from tvm.contrib import cc +from tvm.contrib import util + +from . import common, frontends +from .main import register_parser + + +@register_parser +def add_compile_parser(subparsers): + """ Include parser for 'compile' subcommand """ + + 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'", + ) + parser.add_argument( + "--dump-code", + metavar="FORMAT", + default="", + help="comma separarated list of formats to export, e.g. 'asm,ll,relay' " + ) + parser.add_argument( + "--model-format", + choices=frontends.get_frontends(), + help="specify input model format", + ) + parser.add_argument( + "--input-shape", + type=common.parse_input_shapes, + metavar="INPUT_SHAPE,[INPUT_SHAPE]...", + help="for pytorch, e.g. '(1,3,224,224)'", + ) + parser.add_argument( + "-o", + "--output", + default="module.tar", + help="output the compiled module to an archive", + ) + parser.add_argument( + "--target", + help="compilation target as plain string, inline JSON or path to a JSON file", + required=True + ) + parser.add_argument( + "--tuning-records", + metavar="PATH", + default="", + help="path to an auto-tuning log file from AutoTVM" + ) + parser.add_argument( + "--desired-layout", + choices=["NCHW", "NHWC"], + default=None, + help="change the data layout of the whole graph", + ) + parser.add_argument( + "-v", "--verbose", action="count", default=0, help="increase verbosity" + ) + parser.add_argument("FILE") Review comment: The description will be present in my next commit. I added a TODO for modelzoo integration. ---------------------------------------------------------------- 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: us...@infra.apache.org