I am using tvm 0.21.0 tune_tir to tune my operator, which invokes another tvm.script.tir.Macro decorated function many times. The tune tir panicked like this:
Duplicated block name in function main not supported!
IMHO, the callsite of invoke Macro will be replaced with the macro’s content, so it truly is reasonable that the tvm will encounter duplicate block names if the macro has its own block.
The question 1 is, should we consider all the occurence of the block name defined in macro the same? or tune each of them seperately?
Question 2: is there a good way to bypass this problem now?
For me, I have to get rid of the block declaration in the macro, therefor allocate memories outside of the macro, which would be a lot convenient if do it inside of it. It’s not a good idea I think.
Another way to bypass it is that I transform the script tvm generated, modify each of the block with a unique name. Which requires me to modify the tvm source code itself. And too, this is also not a good idea.