[RFC] Hybrid Script Support for TIR

See the discussion in [RFC] TensorIR: A schedulable IR for TVM - #60 by masahi. Currently we cannot meta-program tvmscript, so we can only write a monolithic piece of code. There is an example of NMS written in hybrid script, but we shouldn’t encourage this style of programming (hard to read and maintain etc). https://github.com/apache/tvm/blob/main/python/tvm/topi/vision/nms.py#L244

I think meta programming support for tvmscript (by a macro system, for example) is a big open question. I’m very interested in this topic too, because often I need to write a complicated op like NMS, FFT etc and the only possibility is to use the IR builder. cc @junrushao @vinx13

2 Likes