You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "elvin-n (via GitHub)" <gi...@apache.org> on 2023/01/31 21:33:21 UTC

[GitHub] [tvm] elvin-n commented on a diff in pull request #13874: [TOPHUB] use keys as a keyword for searching of existing statistics

elvin-n commented on code in PR #13874:
URL: https://github.com/apache/tvm/pull/13874#discussion_r1092503969


##########
python/tvm/autotvm/tophub.py:
##########
@@ -110,6 +110,10 @@ def context(target, extra_files=None):
         device = tgt.attrs.get("device", "")
         if device != "":
             possible_names.append(_alias(device))
+        # for cases when we do have explicitly defined -device in the target,
+        # we still might have information about it stored in keys container
+        # in other case we will load statistics for definitely irrelative stat

Review Comment:
   :) tried to include logic of matching statistics without detailed description in this place.
   
   1. the only mandatory field in target is `kind`. it can be llvm/opencl/cuda/...
   2. it might be `device` specified, but not required. It might be "arm_cpu", or "adreno" for example
   3. it might be `model` specified, but not required. It might be "riscv32-unknown-linux-gnu" or "kirin970" for example
   4. the `keys` field is not specified but is filled after analysis of the Target string automatically by devices. It is done for hierarchical search in the `topi` implementations and do fallback to lower/parents layers
   
   Before this change, dedicated tophub *file* was searched only by `device` and second by `kind` 
   As you remember, `device` is not mandatory in the Target. At the same time TVM understands that target belongs to arm_cpu, it treat it as arm_cpu, but before my change, the target like `llvm -model=snapdragon835 -mtriple=arm64-linux-android -mattr=+neon` was treated only as `llvm` stat file. I cannot even imagine on which device `llvm` stat was collected, but definitely not on ARM. I.e. statistics was irrelevant.
   
   Adding keys to the priority before `kind` we increase the probability of searching proper statistics.
   
   Do I need to comment line by line your answer?



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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org