leeexyz commented on pull request #7879:
URL: https://github.com/apache/tvm/pull/7879#issuecomment-823752535


   @llehtahw @comaniac The modification does not consider this reusing case. :( 
Substitute LHS (aka the provide) should solve this reusing case. The reason is 
after Normalize step, IterVar i is rebased, but only RHS (aka the intrin) has 
been updated.
   ```c++
   // src/te/operation/tensorize.cc:330
       PrimExpr lhs = ana.Simplify(Substitute(body[i], value_map));
   ```
   I think it is okay to reuse compute since this is a way to reuse the compute 
concepts to describe the behavior of HW intrinsic. Actually, we also do some 
reusings, but we don't use the same compute directly, what we do like follows.
   ```
       a, b, c = get_compute_args()
       s = tvm.te.create_schedule([c.op])
       # just like create a new op
       _, _, intrin_c = get_compute_args()
       # get the intrinsic
       intrin_c = get_intrin(intrin_c)
       # do tensorize
       s[c].tensorize(c.op.axis[0], intrin_c)
       tvm.lower(s, (a, b, c))
   ```


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


Reply via email to