yzhliu commented on a change in pull request #8669:
URL: https://github.com/apache/tvm/pull/8669#discussion_r685690616
##########
File path: python/tvm/topi/x86/dense_alter_op.py
##########
@@ -39,6 +40,17 @@ def _alter_dense_layout(attrs, inputs, tinfos, out_type):
relay.op.get("nn.dense"), attrs, tinfos, out_type, target
)
workload = autotvm.task.get_workload(outs)
+
+ data_type =
relay.transform.InferType()(IRModule.from_expr(inputs[0]))["main"].body.checked_type
Review comment:
I see. I think it's a design flaw initially, or rather dilemma that
layout and shape are closely connected while they are dealt in separate passes.
You mentioned `InferCorrectLayout` doesn't really work with `AlterOpLayout`,
I'm not sure this is true, AlterOpLayout shall share the same strategy,
https://github.com/apache/tvm/blob/main/src/relay/transforms/transform_layout.h#L336-L372
. I think it is doable as long as 1) input[0]'s layout has been explicitly and
correctly inferred and 2) nn.dense's `InferCorrectLayout` takes the input
layout into consideration.
--
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]