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:
[email protected]
With regards,
Apache Git Services