comaniac commented on a change in pull request #6537:
URL: https://github.com/apache/incubator-tvm/pull/6537#discussion_r494581431



##########
File path: python/tvm/driver/tvmc/autotuner.py
##########
@@ -0,0 +1,301 @@
+# 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 auto-tuning networks using AutoTVM.
+"""
+import os.path
+import logging
+import time
+
+from tvm import autotvm
+from tvm import relay
+from tvm.autotvm.tuner import GATuner
+from tvm.autotvm.tuner import GridSearchTuner
+from tvm.autotvm.tuner import RandomTuner
+from tvm.autotvm.tuner import XGBTuner
+
+from . import common, frontends
+from .common import TVMCException
+from .main import register_parser
+
+
+@register_parser
+def add_tune_parser(subparsers):
+    """ Include parser for 'tune' subcommand """
+
+    parser = subparsers.add_parser("tune", help="auto-tune a model")
+    parser.set_defaults(func=drive_tune)
+    parser.add_argument(
+        "--early-stopping",
+        type=int,
+        help="minimum number of trials before early stopping",
+    )
+    parser.add_argument("--hostname", help="hostname or IP address of the host 
machine")
+    parser.add_argument(
+        "--min-repeat-ms",
+        default=1000,
+        type=int,
+        help="minimum time to run each trial (in milliseconds)",
+    )
+    parser.add_argument(
+        "--model-format",
+        choices=frontends.get_frontend_names(),
+        help="specify input model format",
+    )
+    parser.add_argument(
+        "--number",
+        default=10,
+        type=int,
+        help="number of runs a single repeat is made of. "
+        "The final number of tuning executions is: "
+        "(1 + number * repeat)",
+    )
+    parser.add_argument(
+        "-o",
+        "--output",
+        required=True,
+        help="output file to store the tuning records for the tuning process",
+    )
+    parser.add_argument(
+        "--parallel",
+        default=4,
+        type=int,
+        help="the maximum number of parallel devices to use when tuning",
+    )
+    parser.add_argument("--port", default=9090, type=int, help="the port to 
connect to")

Review comment:
       I aggregated the discussion of remote tuning here and resolve other 
places to better track the states. Per @FrozenGene 's suggestions of using 
`--tracker-key` and `--rpc-device-key`, I think `rpc-device-key` is fine, but 
`tracker-key` is not a key so I would still prefer `rpc-tracker`. I think we 
can expect them to know the meaning of "tracker" and "device key", because if 
users need to run RPC runner, they must know how to launch RPC tracker and RPC 
client in advance.
   
   In summary, here are the action items IMO:
   1. Use `--rpc-tracker=hostname[:port]` and `--rpc-device-key=key-name`.
   2. Have a checker to make sure both are specified or bot are not specified.
   3. Explain how to launch RPC tracker and RPC client in the TVMC tutorial.
   
   @leandron please share your thoughts on this.




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


Reply via email to