[RFC] TVMScript Metaprogramming

Hi all, we sent out an RFC for TVMScript Metaprogramming at https://github.com/apache/tvm-rfcs/pull/79. Below is a section quoted from the RFC for better visibility, describing what metaprogramming features we want to support in this RFC. Would love to hear about your thoughts and feedback!


Thanks for the work, for F4,do you mean we can write some impreative code that can be execute by Python?

Yes, that’s right. Actually you can write imperative code to construct IR graph now, by calling IR node constructors from tvm.tir.stmt|expr manually. The new things behind F4 are:

  1. IRBuilder API, which can be used to construct IR nodes in a more concise way compared to calling node constructor directly.
  2. The ability to embed these functions inside TVMScript. This means you can use imperative code to construct small fragments inside a large T.prim_func.

How about we consolidate our discussion to the RFC thread (https://github.com/apache/tvm-rfcs/pull/79) so that people can see what’s happening in a centralized place?

That’s a good idea. I cross posted the Q&A above to the RFC PR.

1 Like