How can I see the HW instruction(ISA) streams?

Hello forum,

I just watched on Youtube TVM - VTA instructions

on 33:33 he showed HW instruction flow. How can I print those flow out??

vta.build_config(debug_flag=2)

Hello, liangfu. Thanks for your comment.

I tried your advise on tutorial and only get one output - build_config(data_alignment, offset factor, …)

what I meant was Instruction stream like the video.

INSTRUCTION0 : LOAD UOP

INSTRUCTION1 : GEMM

and so on…

And also if possible, those extra information with the instructions. On which file could I possibly print those out?

See https://docs.tvm.ai/api/python/vta/index.html#vta.build_config

I really don’t want to bother you but…

I added following three lines to my tutorial code, referencing your link, but get the same output as tutorial code. (I’m working things on the first one - vector addition)

with vta.build_config(debug_flag=2):

  vta_module = tvm.build(s, [A, ....], ....)

print(vta_module)

Also, I think I found the same code like the video on

tvm/vta/src/runtime.cc #696 line , void DumpInsn()

Does vta.build_config function have to do with this function? The 'printf’s seem to be exactly the same as the video.

I figured it out, thank you for your advise

Hey, can you provide more info as to how you found the ISA HW Instruction streams? Thank you

run it with debug mode on. The second bit(0010) gives you ISA instruction stream.

Thank you for your reply. Does it work the same way if we are using relay.build(…) instead of a tvm.build(…) ? Because when I try to do the same with relay.build I am getting errors.

As fas as I know, it should work the same but I haven’t tried it. Maybe can you show me the code you’re working on with the errors? :slight_smile: