lygztq opened a new pull request #8687:
URL: https://github.com/apache/tvm/pull/8687


   Before #8266, `tvm.tir.Any` is a subclass of `PrimExpr` which does not have 
the `__floordiv__` operator `//`. When the input has a dynamic shape with `Any` 
in it, this line `k = te.reduce_axis((0, K // vec), "k")` in `dense_nopack` 
will throw an error like
   
   ```
   ...
       k = te.reduce_axis((0, K // vec), "k")
   TypeError: unsupported operand type(s) for //: 'Any' and 'int'
   ```
   
   In #8166, I made a wrong fix of the `dense_nopack` operator in x86 platform 
(sorry for that :( ) where I used `M`, `N` and `K` in 
`_default_dense_nopack_config` directly as the input of `te.compute` in 
`dense_nopack` (actually they are used in `_default_dense_nopack_config` to 
compute tile sizes, I think). I think the correct fix should be
   
   ```
   if isinstance(K, tvm.tir.Any):
       k = te.reduce_axis((0, tvm.tir.floordiv(K, vec)), "k")
   else:
       k = te.reduce_axis((0, K // vec), "k")
   ```
   
   Now `tvm.tir.Any` is a subclass of `PrimExprWithOp` and performing floordiv 
with `//` is valid. I think we can remove this wrong fix now.
   


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