lhutton1 commented on code in PR #17091:
URL: https://github.com/apache/tvm/pull/17091#discussion_r1639805176
##########
python/tvm/topi/arm_cpu/dense_alter_op.py:
##########
@@ -82,6 +83,31 @@ def _alter_dense(attrs, inputs, tinfos, out_type):
False,
transpose_b,
)
+ elif topi_impl == "dense_gemm.arm_cpu":
+ # Pre-compute transposed weights and convert to a matmul
+ assert isinstance(
+ inputs[1], relay.Constant
+ ), "dense_gemm.arm_cpu requires weights be a Relay Constant"
+
+ weight_dtype = tinfos[1].dtype
+ weight_data = inputs[1].data.numpy()
+ interleaved = weight_data.transpose()
+ encoded_weight = relay.const(interleaved, weight_dtype)
Review Comment:
Thanks for raising this, yes I think it would be great if we could also do
the same for SME! There is a subtle difference with SME in that adding
transpose here will likely be slower than doing a transpose interleave within
the schedule if the transpose (inserted here) cannot be fused into the
preceding op. Although, since neither functionality exists today, I'm happy
with adding the transpose here :)
--
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]