Should I write custom relay pass for this problem?

Dear TVM/Relay experts,

I am newish, but learing the TVM/Relay. In the past, I have complained that the RESIZE operator in my DNN is too slow on a certain target (Almost 30% of time of overall inference is spend on RESIZE?) . I believe the TVM generates sub-optimal code or non-vectorized code. So I am wondering what I should do to solve this problem ?

  1. Should I write relay pass that optimizes all resize operators ?
  2. Should I create specific operator in relay that is optimized (vectorized) for the resize?

Any suggestions ? I am completely fine if you have anther and better way of solving this problem.

PS: I have not been able to understand how the TVM does vectoization of certain code. Any reference will be helpful.

Relay pass is used for graph-level optimization and it doesn not care codegen. Based on your description, implementing an efficient schedule function in TOPI seems more straightforward.

2 Likes

This what I thought by studying TVM. Do you know is there a tutorial that teaches me how to implement (or add) my custom schedule function ?

I am kind of lost and (to be honest) I am not really sure where is the current TVM resize operation is in the source code? I could not locate it, and Iā€™d really appreciate it if someone points me the source code of current TVM resize schedule function.

Thanks, John.