tkonolige opened a new pull request, #13925:
URL: https://github.com/apache/tvm/pull/13925

   Metaschedule (space generation specifically) requires python functions 
registered in TOPI to correctly detect targets. If topi was not manually 
imported then we would get a crash. Fix this by importing topi from 
metaschedule.
   
   Test script:
   ```
   import tvm
   from tvm.script import tir as T
   from tvm import meta_schedule as ms
   
   @tvm.script.ir_module
   class matmul:
       @T.prim_func
       def matmul_impl(
           A: T.Buffer[(12, 196, 64), "float32"],
           B: T.Buffer[(12, 64, 196), "float32"],
           C: T.Buffer[(12, 196, 196), "float32"],
       ):
           T.func_attr({"global_symbol": "main", "tir.noalias": True})
           for b in range(12):
               for i in range(196):
                   for j in range(196):
                       for k in range(64):
                           with T.block("main"):
                               vb, vi, vj, vk = T.axis.remap("SSSR", [b, i, j, 
k])
                               with T.init():
                                   C[vb, vi, vj] = 0.0
                               C[vb, vi, vj] += A[vb, vi, vk] * B[vb, vk, vj]
   
   db = ms.tune_tir(matmul, "llvm -mcpu=znver3 -num-cores=1", "tune_dir", 512)
   ```
   
   @zxybazh


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to