quic-sanirudh commented on PR #13827:
URL: https://github.com/apache/tvm/pull/13827#issuecomment-1401464163

   > Thanks for contributing!
   > 
   > IIUC, you would like to apply non custom schedule rules to a block that 
has `schedule_rule` attribute. May I ask why is the attribute `schedule_rule` 
necessary if the custom schedule rule is not applied, i.e., can you remove the 
attribute instead?
   > 
   > On the other hand, if we set `schedule_rule` to `None` we can avoid 
certain block being used for schedule rule application, this PR would break the 
assumption here.
   
   Yes I'm trying to apply a non custom schedule rule to blocks that contain 
the `schedule_rule` attribute. Many generic topi implementations like 
[conv2d](https://github.com/apache/tvm/blob/main/python/tvm/topi/nn/conv2d.py#L571)
 and 
[pooling](https://github.com/apache/tvm/blob/main/include/tvm/topi/nn/pooling.h#L575)
 ops contain the `schedule_rule` attirbute which is the compute picked up by 
most targets. 
   
   When tuning a relay `IRModule` with metaschedule, we would have to introduce 
an op strategy to point to a different compute for each of these ops, just to 
remove the attribute. The idea behind this PR was to try and avoid those 
changes to each op.
   
   Also, there might be users new to metaschedule but familiar with generic TVM 
relay workflow and they might see that their ops are not tuned at all if their 
op strategy by default picks up this compute and they might not have any custom 
schedule functions registered. I ran into this as well, but luckily I was 
familiar with the meta schedule code enough to find the problem quickly.
   
   As for setting `schedule_rule` to `None`, IIUC, it only prevents from 
applying the custom rule, but we still don't apply non custom schedule rules to 
those blocks, which means the block doesn't get tuned at all.
   
   Alternative to this PR, we could remove those `schedule_rule` attributes 
from generic `topi.nn` ops and expect that the attribute should only be added 
to target specific op strategies. I'm not sure how that would affect existing 
targets now (potential performance degradation), as we don't know who relies on 
these attributes right now. 


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

Reply via email to