You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/11/17 23:49:53 UTC

[GitHub] [tvm] tkonolige commented on a diff in pull request #13423: [TOPI] Add handwritten matvec for dynamic cases

tkonolige commented on code in PR #13423:
URL: https://github.com/apache/tvm/pull/13423#discussion_r1025848318


##########
python/tvm/relay/op/strategy/x86.py:
##########
@@ -507,10 +507,26 @@ def matmul_strategy_cpu(attrs, inputs, out_type, target):
     return strategy
 
 
+def is_any(shape):
+    return any([isinstance(x, tir.Any) or isinstance(x, tir.SizeVar) for x in shape])
+
+
 @dense_strategy.register("cpu")
 def dense_strategy_cpu(attrs, inputs, out_type, target):
     """dense x86 strategy"""
+
     strategy = _op.OpStrategy()
+    # For dynamic shapes we use a hand written kernel. Right now it only
+    # supports matrix-vector multiplication.
+    if is_any(inputs[0].shape) or is_any(inputs[1].shape):

Review Comment:
   Added a check in the implementation.



##########
python/tvm/relay/op/strategy/x86.py:
##########
@@ -507,10 +507,26 @@ def matmul_strategy_cpu(attrs, inputs, out_type, target):
     return strategy
 
 
+def is_any(shape):

Review Comment:
   renamed to `is_dynamic_shape`



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