Print out schedule for debugging


#1

Does anyone know how to dump out the schedule graph? I’d imagine it would be quite useful. If none exists today, what’s your experience/tricks/tips of debugging the schedule?


#2

Perhaps try printing the IR using

print(tvm.lower(s, inputs, simple_mode=True))

like in the tutorial, but you’ll have to modify the code to simple print the IR of each graph operator in Relay/NNVM, I think.


#3

Hi Nick, thanks for your suggestion.

tvm.lower() is useful and I am using it. In many cases I find the output of the first pass is more helpful than the final result (see Show unflattened tensor in tvm.lower()).

I still would like to see the schedule itself rather than the scheduled program. Does anyone else have the same need? I could try to create such a dumping function. But it seems the community has done well without such a tool. I am curious whether I am missing something in my debugging process.


#4

What exactly do you mean by “the schedule”?

  1. A graphical representation of the operator nodes and tensor shapes?
    I have thought about needing this especially to see the fused operators. Printing the IR in this case is doable but sometimes I feel a simple graph diagram (Networkx python package?) would be more straightforward.

  2. The HW independent schedule?
    So this is what I would call “vanilla” c code and is mostly equivalent to printing the IR after phase 0 (or even better just after. I think to some extent this could be implemented by a different level of the simple_modeparameter of the tvm.lower() function

  1. The scheduling operations defined in the scheduling rules?
    I think this would also be interesting to enable people to not have to read the source code, but I have no idea how this would be nicely represented.

#5

I meant 3. I’d also like to see a combined view with 3 on the left and 1 on the right :slight_smile:

(page 79 of https://people.csail.mit.edu/jrk/jrkthesis.pdf)


#6

This would be brilliant.