elvin-n commented on code in PR #11699:
URL: https://github.com/apache/tvm/pull/11699#discussion_r896433839
##########
python/tvm/autotvm/task/relay_integration.py:
##########
@@ -130,6 +130,10 @@ def extract_from_multiple_program(mods, params, target,
target_host=None, ops=No
assert isinstance(
mod, tvm.IRModule
), "only support relay Module or Function to be tuned"
+
+ with target:
Review Comment:
This change have to break backward compatibility. The current ideology of
AlterOpLayout and autotvm assumes that tuning does not get converted layout,
just plain ones and it is responsibility of schedule to create transformed
compute even for flattened data and it is responsibility of AlterOplLyout to
understand that flattened data in log stands for blocked one and substitute
workload to apply tuned statistics to blocked configuration.
For example[ here
is](https://github.com/apache/tvm/blob/main/python/tvm/topi/x86/conv2d.py#L224)
how conv2d compute get 4d tensor, figure out that it is autotvm session and
override them by 5d tensors
And [here
is](https://github.com/apache/tvm/blob/main/python/tvm/topi/x86/conv2d_alter_op.py#L129)
a place where AlterOpLayout understnabds that it should correct workload to
handle flattened initial tensors to packed one when AlterOpLayout is executed
during network compilation.
Approach looks hacky but how it is implemented now and change in the tuning
now will make previous tuned kernels not applicable for newer versions
BTW, I tried your change and it broke even tuning in cpu fp32 mode
--
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]