You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/11/25 05:04:00 UTC

[GitHub] [incubator-tvm] zxy844288792 commented on a change in pull request #4404: [AutoTVM] select model with the most tuned schedules

zxy844288792 commented on a change in pull request #4404: [AutoTVM] select model with the most tuned schedules
URL: https://github.com/apache/incubator-tvm/pull/4404#discussion_r349991732
 
 

 ##########
 File path: python/tvm/autotvm/tophub.py
 ##########
 @@ -218,12 +218,14 @@ def load_reference_log(backend, model, workload_name, template_key):
         if os.path.isfile(os.path.join(AUTOTVM_TOPHUB_ROOT_PATH, package_name)):
             find = False
             inp = None
+            counts = dict()
             for inp, res in load_from_file(filename):
+                counts[inp.target.model] = counts.get(inp.target.model, 0) + 1
                 if model == inp.target.model:
                     find = True
                     break
-            if not find and inp:
-                model = inp.target.model
+            if not find and len(counts) > 0:
+                model = max(counts.items(), key=lambda k: k[1])[0]
 
 Review comment:
   @broune Thanks for the advice! I will add some comments to explain context here, I agree it will help the reviewers to review the change.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services