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

 ##########
 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:
   From a conversation I had just now with Xingyu, model refers to a device 
type (device model, like a car model), not an ML model, and what this code is 
doing is finding a default device type to use in the case where there are no 
schedules for the actual type of the device. A comment to briefly explain this 
would be good.

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


With regards,
Apache Git Services

Reply via email to