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



##########
File path: python/tvm/driver/tvmc/autotuner.py
##########
@@ -0,0 +1,294 @@
+# 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 platform
+import logging
+import time
+
+from tvm import autotvm
+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 logger, 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")
+
+    is_x86 = platform.machine() in ("i386", "AMD64", "x86_64")
+    parser.add_argument(
+        "--min-repeat-ms",
+        default=0 if is_x86 else 1000,

Review comment:
       It's not that complicate tho. We can simply have `0 if target.keys[0] == 
"cpu" else 1000`. Since we have enabled clflush and it can make the measurement 
much more accurate, we don't need to set this value to 1000. However, it is 
only for x86, so we just need to check whether the first target key is for x86 
(i.e. `cpu`).




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